-
Notifications
You must be signed in to change notification settings - Fork 140
CBG-5013 move gocb dcp client to separate file #7917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR renames the DCPClient struct to GoCBDCPClient and moves it to a dedicated file (gocb_dcp_client.go) in preparation for making DCPClient an interface. The changes are purely structural - no functional behavior is modified.
Key changes:
- Renamed
base/dcp_client.gotobase/gocb_dcp_client.go - Renamed all occurrences of
DCPClienttype toGoCBDCPClient - Updated all method receivers and return types accordingly
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
base/gocb_dcp_client.go |
Renamed struct DCPClient to GoCBDCPClient, updated all method receivers and function signatures |
base/dcp_client_test.go |
Updated test helper method receiver and variable type declarations to use GoCBDCPClient |
base/dcp_client_stream_observer.go |
Updated all stream observer method receivers from DCPClient to GoCBDCPClient |
tools/cache_perf_tool/dcpDataGeneration.go |
Updated variable and function signatures to use GoCBDCPClient instead of DCPClient |
| var ErrVbUUIDMismatch = errors.New("VbUUID mismatch when failOnRollback set") | ||
|
|
||
| type DCPClient struct { | ||
| type GoCBDCPClient struct { |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The struct name has inconsistent casing: 'GoCB' should be 'Gocb' to follow Go naming conventions (GocbDCPClient).
| type GoCBDCPClient struct { | |
| type GocbDCPClient struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't consistent with GoCB and Gocb. Most things use GoCB except GocbV2Bucket.
|
|
||
| // NewDCPClientForTest is a test-only function to create a DCP client with a specific number of vbuckets. | ||
| func NewDCPClientForTest(ctx context.Context, t *testing.T, ID string, callback sgbucket.FeedEventCallbackFunc, options DCPClientOptions, bucket *GocbV2Bucket, numVbuckets uint16) (*DCPClient, error) { | ||
| func NewDCPClientForTest(ctx context.Context, t *testing.T, ID string, callback sgbucket.FeedEventCallbackFunc, options DCPClientOptions, bucket *GocbV2Bucket, numVbuckets uint16) (*GoCBDCPClient, error) { |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name 'NewDCPClientForTest' no longer matches the struct type 'GoCBDCPClient'. Consider renaming to 'NewGoCBDCPClientForTest' for consistency.
| } | ||
|
|
||
| func createDCPClient(t *testing.T, ctx context.Context, bucket *base.GocbV2Bucket, callback sgbucket.FeedEventCallbackFunc, dbStats *expvar.Map, numWorkers, numVBuckets int) (*base.DCPClient, error) { | ||
| func createDCPClient(t *testing.T, ctx context.Context, bucket *base.GocbV2Bucket, callback sgbucket.FeedEventCallbackFunc, dbStats *expvar.Map, numWorkers, numVBuckets int) (*base.GoCBDCPClient, error) { |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name 'createDCPClient' no longer matches the struct type 'GoCBDCPClient'. Consider renaming to 'createGoCBDCPClient' for consistency.
| func createDCPClient(t *testing.T, ctx context.Context, bucket *base.GocbV2Bucket, callback sgbucket.FeedEventCallbackFunc, dbStats *expvar.Map, numWorkers, numVBuckets int) (*base.GoCBDCPClient, error) { | |
| func createGoCBDCPClient(t *testing.T, ctx context.Context, bucket *base.GocbV2Bucket, callback sgbucket.FeedEventCallbackFunc, dbStats *expvar.Map, numWorkers, numVBuckets int) (*base.GoCBDCPClient, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't rename this because it is a test tool.
CBG-5013 move gocb dcp client to separate file to prep for
DCPClientbecoming an interfacedcp_client.gotogocb_dcp_client.goDCPClienttoGocbDCPClientIntegration Tests
GSI=true,xattrs=truehttps://jenkins.sgwdev.com/job/SyncGatewayIntegration/192/ (unrelated db/indextest.TestRemoveIndexesUseViewsTrueAndFalse)