diff --git a/src/include/aerospike/as_command.h b/src/include/aerospike/as_command.h index f26f68c87..ad13a6d0e 100644 --- a/src/include/aerospike/as_command.h +++ b/src/include/aerospike/as_command.h @@ -366,8 +366,8 @@ as_command_write_header_write( uint8_t* as_command_write_header_read( uint8_t* cmd, const as_policy_base* policy, as_policy_read_mode_ap read_mode_ap, - as_policy_read_mode_sc read_mode_sc, uint32_t timeout, uint16_t n_fields, uint16_t n_bins, - uint8_t read_attr, uint8_t write_attr, uint8_t info_attr + as_policy_read_mode_sc read_mode_sc, int read_ttl, uint32_t timeout, uint16_t n_fields, + uint16_t n_bins, uint8_t read_attr, uint8_t write_attr, uint8_t info_attr ); /** @@ -377,7 +377,8 @@ as_command_write_header_read( uint8_t* as_command_write_header_read_header( uint8_t* cmd, const as_policy_base* policy, as_policy_read_mode_ap read_mode_ap, - as_policy_read_mode_sc read_mode_sc, uint16_t n_fields, uint16_t n_bins, uint8_t read_attr + as_policy_read_mode_sc read_mode_sc, int read_ttl, uint16_t n_fields, uint16_t n_bins, + uint8_t read_attr ); /** diff --git a/src/include/aerospike/as_policy.h b/src/include/aerospike/as_policy.h index 61c41abf5..1dc32fabc 100644 --- a/src/include/aerospike/as_policy.h +++ b/src/include/aerospike/as_policy.h @@ -576,6 +576,26 @@ typedef struct as_policy_read_s { */ as_policy_read_mode_sc read_mode_sc; + /** + * Determine how record TTL (time to live) is affected on reads. When enabled, the server can + * efficiently operate as a read-based LRU cache where the least recently used records are expired. + * The value is expressed as a percentage of the TTL sent on the most recent write. + * + * For example, if the most recent write had a TTL of 10 hours and read_touch_ttl_percent is set to + * 80, the next read after 8 hours will result in a touch, resetting the TTL to another 10 hours. + * + * Values: + * + *
  • + * + * Default: 0 + */ + int read_touch_ttl_percent; + /** * Should raw bytes representing a list or map be deserialized to as_list or as_map. * Set to false for backup programs that just need access to raw bytes. @@ -768,8 +788,9 @@ typedef struct as_policy_operate_s { /** * The default time-to-live (expiration) of the record in seconds. This field will - * only be used if "as_operations.ttl" is set to AS_RECORD_CLIENT_DEFAULT_TTL. The - * as_operations instance is passed in to operate functions along with as_policy_operate. + * only be used if one or more of the operations is a write operation and if "as_operations.ttl" + * is set to AS_RECORD_CLIENT_DEFAULT_TTL. The as_operations instance is passed in to + * operate functions along with as_policy_operate. * * There are also special values that can be set in the record ttl: *