forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track per-stream record counts and records committed, and other sync …
…summary metadata (airbytehq#9327) * StateDeltaTracker class and tests * working prototype implementation of per-stream record tracking * misc stuff to get build working * add new fields to replicationAttemptSummary * update AirbyteMessageTracker to use StateDeltaTracker, and new interface methods * finish implementation and tests for stateDeltaTracker and all new ReplicationAttemptSummary fields * undo temporary changes to files that I accidentally committed * simplify interactions with byte buffers (airbytehq#9331) * define a map instead of generic object for counts by stream * follow convention of keyToValue instead of valueByKey for maps * use synchronized blocks instead of synchronized methods * add totalBytesEmitted field to eventually replace bytesSynced * misc PR feedback nits * additionalProperties probably should still be false * javadoc formatting * define syncStats and use it for total and per-stream stats * change per-stream stats map to a list, and set stats in standardSyncSummary * wrap entire method bodies in synchronized block * use a long instead of a Long for required fields * remove extranneous 'this' * set committed records to emitted records if sync has success status * throw checked exception if commit state before add state, simplify exception handling throughout * set delta tracker memory limit to 20MiB * log error message that was thrown instead of assumed cause * StreamSyncStats wrapper, add test case for populating stats on failure, misc formatting Co-authored-by: Charles <[email protected]>
- Loading branch information
Showing
13 changed files
with
987 additions
and
120 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
airbyte-config/models/src/main/resources/types/StreamSyncStats.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"$schema": http://json-schema.org/draft-07/schema# | ||
"$id": https://github.com/airbytehq/airbyte/blob/master/airbyte-config/models/src/main/resources/types/StreamSyncStats.yaml | ||
title: StreamSyncStats | ||
description: Sync stats for a particular stream. | ||
type: object | ||
required: | ||
- streamName | ||
- stats | ||
additionalProperties: false | ||
properties: | ||
streamName: | ||
type: string | ||
stats: | ||
"$ref": SyncStats.yaml |
19 changes: 19 additions & 0 deletions
19
airbyte-config/models/src/main/resources/types/SyncStats.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
"$schema": http://json-schema.org/draft-07/schema# | ||
"$id": https://github.com/airbytehq/airbyte/blob/master/airbyte-config/models/src/main/resources/types/SyncStats.yaml | ||
title: SyncStats | ||
description: sync stats. | ||
type: object | ||
required: | ||
- recordsEmitted | ||
- bytesEmitted | ||
additionalProperties: false | ||
properties: | ||
recordsEmitted: | ||
type: integer | ||
bytesEmitted: | ||
type: integer | ||
stateMessagesEmitted: # TODO make required once per-stream state messages are supported in V2 | ||
type: integer | ||
recordsCommitted: | ||
type: integer # if unset, committed records could not be computed |
This file contains 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
This file contains 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
Oops, something went wrong.