-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(storage): adding disabling option for bidi reads #13506
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
base: main
Are you sure you want to change the base?
Changes from all commits
2db4acb
351729c
72af919
91e8f36
e67803a
a24e32a
5c3c71a
dc264f8
6a02a24
4b3c67e
1c1e08e
14c148b
31f5144
4e03119
13e89cb
78f32bd
d1723f2
9d44e29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -151,7 +151,7 @@ private AccumulatingRead( | |||||
| super(rangeSpec, retryContext, onCloseCallback); | ||||||
| this.readId = readId; | ||||||
| this.hasher = | ||||||
| (rangeSpec.begin() == 0 && !(hasher instanceof Hasher.NoOpHasher)) | ||||||
| (rangeSpec.begin() == 0) | ||||||
| ? new CumulativeHasher(hasher, 0, rangeSpec.maxLength()) | ||||||
| : hasher; | ||||||
| this.complete = SettableApiFuture.create(); | ||||||
|
|
@@ -284,7 +284,7 @@ static class StreamingRead extends BaseObjectReadSessionStreamRead<ScatteringByt | |||||
| super(rangeSpec, retryContext, onCloseCallback); | ||||||
| this.readId = new AtomicLong(readId); | ||||||
| this.hasher = | ||||||
| (rangeSpec.begin() == 0 && !(hasher instanceof Hasher.NoOpHasher)) | ||||||
| (rangeSpec.begin() == 0) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By removing the
Suggested change
References
|
||||||
| ? new CumulativeHasher(hasher, 0, rangeSpec.maxLength()) | ||||||
| : hasher; | ||||||
| this.closed = false; | ||||||
|
|
||||||
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.
By removing the
!(hasher instanceof Hasher.NoOpHasher)check, aCumulativeHasheris now always allocated and wrapped around the delegate hasher whenrangeSpec.begin() == 0, even if checksum validation is disabled (i.e., whenhasheris aNoOpHasher). Keeping this check avoids unnecessary object allocation and overhead when checksumming is disabled.References