Class: LaunchDarkly::Impl::Integrations::DynamoDB::DynamoDBBigSegmentStore Private
- Inherits:
-
DynamoDBStoreImplBase
- Object
- DynamoDBStoreImplBase
- LaunchDarkly::Impl::Integrations::DynamoDB::DynamoDBBigSegmentStore
- Defined in:
- lib/ldclient-rb/impl/integrations/dynamodb_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.
Constant Summary collapse
- KEY_METADATA =
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_metadata'- KEY_CONTEXT_DATA =
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_user'- ATTR_SYNC_TIME =
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.
'synchronizedOn'- ATTR_INCLUDED =
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.
'included'- ATTR_EXCLUDED =
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.
'excluded'
Instance Method Summary collapse
- #description ⇒ Object private
- #get_membership(context_hash) ⇒ Object private
- #get_metadata ⇒ Object private
-
#initialize(table_name, opts) ⇒ DynamoDBBigSegmentStore
constructor
private
A new instance of DynamoDBBigSegmentStore.
Constructor Details
#initialize(table_name, opts) ⇒ DynamoDBBigSegmentStore
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.
Returns a new instance of DynamoDBBigSegmentStore.
243 244 245 |
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 243 def initialize(table_name, opts) super(table_name, opts) end |
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.
247 248 249 |
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 247 def description "DynamoDBBigSegmentStore" 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.
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 265 def get_membership(context_hash) data = @client.get_item( table_name: @table_name, key: { PARTITION_KEY => @prefix + KEY_CONTEXT_DATA, SORT_KEY => context_hash, }) return nil unless data.item excluded_refs = data.item[ATTR_EXCLUDED] || [] included_refs = data.item[ATTR_INCLUDED] || [] if excluded_refs.empty? && included_refs.empty? nil else membership = {} excluded_refs.each { |ref| membership[ref] = false } included_refs.each { |ref| membership[ref] = true } membership 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.
251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 251 def key = @prefix + KEY_METADATA data = @client.get_item( table_name: @table_name, key: { PARTITION_KEY => key, SORT_KEY => key, } ) = data.item && data.item[ATTR_SYNC_TIME] ? data.item[ATTR_SYNC_TIME] : nil LaunchDarkly::Interfaces::BigSegmentStoreMetadata.new() end |