Class: LaunchDarkly::Impl::Integrations::Redis::RedisBigSegmentStore Private
- Inherits:
-
RedisStoreImplBase
- Object
- RedisStoreImplBase
- LaunchDarkly::Impl::Integrations::Redis::RedisBigSegmentStore
- Defined in:
- lib/ldclient-rb/impl/integrations/redis_impl.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Internal implementation of the Redis big segment store.
Constant Summary collapse
- KEY_LAST_UP_TO_DATE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
':big_segments_synchronized_on'- KEY_CONTEXT_INCLUDE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
':big_segment_include:'- KEY_CONTEXT_EXCLUDE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
':big_segment_exclude:'
Instance Method Summary collapse
- #description ⇒ Object private
- #get_membership(context_hash) ⇒ Object private
- #get_metadata ⇒ Object private
Methods inherited from RedisStoreImplBase
Constructor Details
This class inherits a constructor from LaunchDarkly::Impl::Integrations::Redis::RedisStoreImplBase
Instance Method Details
#description ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
283 284 285 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 283 def description "RedisBigSegmentStore" end |
#get_membership(context_hash) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 292 def get_membership(context_hash) with_connection do |redis| included_refs = redis.smembers(@prefix + KEY_CONTEXT_INCLUDE + context_hash) excluded_refs = redis.smembers(@prefix + KEY_CONTEXT_EXCLUDE + context_hash) if !included_refs && !excluded_refs nil else membership = {} excluded_refs.each { |ref| membership[ref] = false } included_refs.each { |ref| membership[ref] = true } membership end end end |
#get_metadata ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
287 288 289 290 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 287 def value = with_connection { |redis| redis.get(@prefix + KEY_LAST_UP_TO_DATE) } Interfaces::BigSegmentStoreMetadata.new(value.nil? ? nil : value.to_i) end |