Interface IBigSegmentStore
Interface for a read-only data store that allows querying of user membership in Big Segments.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Subsystems
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public interface IBigSegmentStore : IDisposable
Remarks
"Big Segments" are a specific type of user segments. For more information, read the LaunchDarkly documentation about user segments: https://docs.launchdarkly.com/home/users/segments
All query methods of the store are asynchronous.
Methods
| Edit this page View SourceGetMembershipAsync(string)
Queries the store for a snapshot of the current segment state for a specific user.
Declaration
Task<BigSegmentStoreTypes.IMembership> GetMembershipAsync(string userHash)
Parameters
Type | Name | Description |
---|---|---|
string | userHash | the hashed user identifier |
Returns
Type | Description |
---|---|
Task<BigSegmentStoreTypes.IMembership> | the user's segment membership state or null |
Remarks
The userHash is a base64-encoded string produced by hashing the user key as defined by the Big Segments specification; the store implementation does not need to know the details of how this is done, because it deals only with already-hashed keys, but the string can be assumed to only contain characters that are valid in base64.
If the store is working, but no membership state is found for this user, the method may return either null or an empty BigSegmentStoreTypes.IMembership. It should not throw an exception unless there is an unexpected database error or the retrieved data is malformed.
GetMetadataAsync()
Returns information about the overall state of the store.
Declaration
Task<BigSegmentStoreTypes.StoreMetadata?> GetMetadataAsync()
Returns
Type | Description |
---|---|
Task<BigSegmentStoreTypes.StoreMetadata?> | the store metadata or null |
Remarks
This method will be called only when the SDK needs the latest state, so it should not be cached.
If the store is working, but no metadata has been stored in it yet, the method should return null. It should not throw an exception unless there is an unexpected database error or the retrieved data is malformed.