Skip to content
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

improve byte buffer handling #9331

Merged

Conversation

cgardens
Copy link
Contributor

@cgardens cgardens commented Jan 6, 2022

What

  • I think there is a simpler way to handle interacting with byte arrays. Typically if I want to read or write to a byte array, wrapping it in a ByteBuffer tends to be a lot simpler. I think you ended up trying to use ByteBuffers to insert and read out of byte[], but if you just wrap the byte[] you want to interact with, I think it gets way easier. I double checked that tests still pass. Definitely happy to discuss more if it's not clear!

@pmossman
Copy link
Contributor

pmossman commented Jan 6, 2022

This definitely looks like the way to go, muuuuch cleaner, thanks!

@pmossman pmossman merged commit 2fec48b into parker/per-stream-counts-and-more Jan 6, 2022
@pmossman pmossman deleted the cgardens/byte-buffer-handling branch January 6, 2022 18:25
pmossman added a commit that referenced this pull request Jan 11, 2022
…summary metadata (#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 (#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 <giardina.charles@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants