|
C++ Server-Side SDK
LaunchDarkly SDK
|
Interface for a Big Segments persistent store. More...
#include <ibig_segment_store.hpp>
Public Types | |
| using | GetMembershipResult = tl::expected< Membership, std::string > |
| using | GetMetadataResult = tl::expected< std::optional< StoreMetadata >, std::string > |
Public Member Functions | |
| IBigSegmentStore (IBigSegmentStore const &)=delete | |
| IBigSegmentStore (IBigSegmentStore &&)=delete | |
| IBigSegmentStore & | operator= (IBigSegmentStore const &)=delete |
| IBigSegmentStore & | operator= (IBigSegmentStore &&)=delete |
| virtual GetMembershipResult | GetMembership (std::string const &context_hash) const noexcept=0 |
| Looks up the Big Segments membership for a single context. More... | |
| virtual GetMetadataResult | GetMetadata () const noexcept=0 |
| Returns store-level metadata used by the SDK to detect staleness. More... | |
Interface for a Big Segments persistent store.
A Big Segment is a segment whose membership list lives outside the LaunchDarkly flag payload, in an external shared store populated by the LaunchDarkly Relay Proxy. At evaluation time the SDK does a point lookup against the store rather than carrying the full membership list in memory.
Implementations of this interface live in dedicated integration libraries (e.g. server-sdk-redis-source, server-sdk-dynamodb-source) and are passed to the SDK via the Big Segments config builder. The SDK wraps every implementation in an internal caching / staleness-tracking layer, so implementations should NOT cache results themselves — perform every lookup the SDK asks for.
The SDK hashes the context key (SHA-256 then base64-encoded) before calling GetMembership, so an implementation only ever sees opaque hashes; raw context keys are never sent to the store.
Implementations must be thread-safe.
|
pure virtualnoexcept |
Looks up the Big Segments membership for a single context.
| context_hash | Base64-encoded SHA-256 of the context key. Implementations should treat this as an opaque identifier. |
std::nullopt). Returns an error if the lookup itself failed.
|
pure virtualnoexcept |
Returns store-level metadata used by the SDK to detect staleness.
std::nullopt if no metadata has ever been written (the store was never populated), or an error if the lookup itself failed.