get

读取一条数据

  1. ///
  2. /// \brief get
  3. /// get value by key from the cluster.
  4. /// \param hashkey
  5. /// used to decide which partition to get this k-v
  6. /// \param sortkey
  7. /// all the k-v under hashkey will be sorted by sortkey.
  8. /// \param value
  9. /// the returned value will be put into it.
  10. /// \param timeout_milliseconds
  11. /// if wait longer than this value, will return time out error
  12. /// \return
  13. /// int, the error indicates whether or not the operation is succeeded.
  14. /// this error can be converted to a string using get_error_string().
  15. /// returns PERR_NOT_FOUND if no value is found under the <hashkey,sortkey>.
  16. ///
  17. virtual int get(const std::string &hashkey,
  18. const std::string &sortkey,
  19. std::string &value,
  20. int timeout_milliseconds = 5000,
  21. internal_info *info = NULL) = 0;