ttl

获取单行数据的TTL时间。TTL表示Time To Live,表示该数据还能存活多久。如果超过存活时间,数据就读不到了

  1. ///
  2. /// \brief ttl (time to live)
  3. /// get ttl in seconds of this k-v.
  4. /// key is composed of hashkey and sortkey. must provide both to get the value.
  5. /// \param hashkey
  6. /// used to decide which partition to get this k-v
  7. /// \param sortkey
  8. /// all the k-v under hashkey will be sorted by sortkey.
  9. /// \param ttl_seconds
  10. /// the returned ttl value in seconds.
  11. /// \param timeout_milliseconds
  12. /// if wait longer than this value, will return time out error
  13. /// \return
  14. /// int, the error indicates whether or not the operation is succeeded.
  15. /// this error can be converted to a string using get_error_string()
  16. ///
  17. virtual int ttl(const std::string &hashkey,
  18. const std::string &sortkey,
  19. int &ttl_seconds,
  20. int timeout_milliseconds = 5000,
  21. internal_info *info = NULL) = 0;