feat: Add C bindings for Redis Big Segments store#574
Open
beekld wants to merge 1 commit into
Open
Conversation
a42553c to
bb517aa
Compare
2ce9c92 to
e06f24a
Compare
bb517aa to
2f888ea
Compare
e06f24a to
c0acca8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a C binding for
RedisBigSegmentStoreso C callers can wire the existing Redis Big Segments integration into the SDK's Big Segments config.New public surface:
LDServerBigSegmentsRedisStoreopaque handle.struct LDServerBigSegmentsRedisResultwithstoreanderror_messagefields.LDSERVER_BIGSEGMENTS_REDISSTORE_ERROR_MESSAGE_SIZEmacro.LDServerBigSegmentsRedisStore_New(uri, prefix, out_result)factory.LDServerBigSegmentsRedisStore_Free(store).Tests:
Design decision worth flagging: the type name uses config-section-first word order (
BigSegments+Redis+Store) to mirror the existing Redis LazyLoad C binding'sLDServerLazyLoadRedisSource(LazyLoad+Redis+Source). This differs from the C++ class nameRedisBigSegmentStore-- a literal C++ mirror would have beenLDServerRedisBigSegmentStore. Chose consistency with the sibling C binding in the same header directory over C++ class-name parity.Stacked on #573 (Big Segments C bindings). Please review that PR first.
Note
Low Risk
New public C API and thin wrapper around existing C++ store logic; no changes to core flag evaluation or auth paths.
Overview
Exposes a C API for the existing Redis-backed Big Segments store so C callers can plug it into
LDServerBigSegmentsBuilderthe same way the Lazy Load Redis binding works for data sources.The new surface includes an opaque
LDServerBigSegmentsRedisStorehandle, a stack-allocatedLDServerBigSegmentsRedisResult(store pointer plus fixed-sizeerror_message), andLDServerBigSegmentsRedisStore_New/_Free. The implementation delegates toRedisBigSegmentStore::Createand documents that the SDK may take ownership instead of calling_Free. The redis-source library build now compilesbindings/redis/redis_big_segment_store.cpp.Tests cover create/free and failure paths (non-empty error, null store), plus an integration test that seeds Redis sync metadata, wires the store through the C Big Segments config, and waits on the Big Segment store status listener until available.
Reviewed by Cursor Bugbot for commit c0acca8. Bugbot is set up for automated code reviews on this repo. Configure here.