-
Notifications
You must be signed in to change notification settings - Fork 97
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
CDC to S3/GCS #507
CDC to S3/GCS #507
Conversation
18dac94
to
3b62078
Compare
flow/connectors/s3/metadata.go
Outdated
pool *pgxpool.Pool | ||
} | ||
|
||
func NewPostgresMetadataStore(ctx context.Context, pgConfig *protos.PostgresConfig) (*PostgresMetadataStore, 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.
can we share this impl with eventhubs somehow?
flow/connectors/s3/s3.go
Outdated
var firstCP int64 = 0 | ||
tableNameRowsMapping := make(map[string]uint32) | ||
|
||
for _, record := range req.Records.Records { |
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.
don't we do this elsewhere too? can we refactor to share the code?
be6ad20
to
9ff768b
Compare
flow/connectors/eventhub/eventhub.go
Outdated
@@ -40,7 +41,9 @@ func NewEventHubConnector( | |||
} | |||
|
|||
hubManager := NewEventHubManager(ctx, defaultAzureCreds, config) | |||
pgMetadata, err := NewPostgresMetadataStore(ctx, config.GetMetadataDb()) | |||
metadataSchemaName := "peerdb_eventhub_metadata" |
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.
🚫 [golangci] reported by reviewdog 🐶
G101: Potential hardcoded credentials (gosec)
@@ -167,11 +161,10 @@ func (c *EventHubConnector) GetLastSyncBatchID(jobName string) (int64, error) { | |||
} | |||
|
|||
// update offset for a job | |||
func (c *EventHubConnector) updateLastOffset(jobName string, offset int64) error { | |||
ms := c.pgMetadata | |||
func (p *PostgresMetadataStore) UpdateLastOffset(jobName string, offset int64) 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.
🚫 [golangci] reported by reviewdog 🐶
unnecessary leading newline (whitespace)
@@ -206,14 +199,13 @@ func (c *EventHubConnector) updateLastOffset(jobName string, offset int64) error | |||
} | |||
|
|||
// update offset for a job | |||
func (c *EventHubConnector) incrementSyncBatchID(jobName string) error { | |||
ms := c.pgMetadata | |||
func (p *PostgresMetadataStore) IncrementID(jobName string) 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.
🚫 [golangci] reported by reviewdog 🐶
unnecessary leading newline (whitespace)
flow/connectors/utils/stream.go
Outdated
} | ||
|
||
first := true | ||
var firstCP int64 = req.CP |
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.
🚫 [golangci] reported by reviewdog 🐶
ST1023: should omit type int64 from declaration; it will be inferred from the right-hand side (stylecheck)
flow/connectors/eventhub/eventhub.go
Outdated
tableSchemas map[string]*protos.TableSchema | ||
creds *azidentity.DefaultAzureCredential | ||
hubManager *EventHubManager | ||
} | ||
|
||
const ( | ||
metadataSchemaName = "peerdb_eventhub_metadata" |
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.
🚫 [golangci] reported by reviewdog 🐶
G101: Potential hardcoded credentials (gosec)
af9e493
to
6e4b5e0
Compare
Initial Load: One folder per table
CDC is a separate folder
Tests added for both S3 and GCS versions of the peer (CDC)