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

feat: add support of startOffset and endOffset #430

Merged
merged 2 commits into from Jul 17, 2020

Conversation

athakor
Copy link
Contributor

@athakor athakor commented Jul 13, 2020

Fixes #424

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 13, 2020
@codecov
Copy link

codecov bot commented Jul 13, 2020

Codecov Report

Merging #430 into master will decrease coverage by 0.11%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #430      +/-   ##
============================================
- Coverage     63.27%   63.15%   -0.12%     
+ Complexity      618      610       -8     
============================================
  Files            32       32              
  Lines          5113     5133      +20     
  Branches        486      490       +4     
============================================
+ Hits           3235     3242       +7     
- Misses         1713     1726      +13     
  Partials        165      165              
Impacted Files Coverage Δ Complexity Δ
...om/google/cloud/storage/spi/v1/HttpStorageRpc.java 1.60% <0.00%> (+0.09%) 2.00 <0.00> (+1.00)
...rc/main/java/com/google/cloud/storage/Storage.java 80.64% <100.00%> (-0.26%) 0.00 <0.00> (ø)
...va/com/google/cloud/storage/spi/v1/StorageRpc.java 66.23% <100.00%> (+1.36%) 0.00 <0.00> (ø)
...in/java/com/google/cloud/storage/PostPolicyV4.java 62.66% <0.00%> (-1.72%) 4.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 117f092...40f4805. Read the comment docs.

storage.list(
bucketName,
Storage.BlobListOption.startOffset("test-list-blobs-start-offset-blob"),
Storage.BlobListOption.endOffset("test-list-blobs-end-offset-blob3"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend starting from not the first object in the new objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this test with new one.

Storage.BlobListOption.startOffset("test-list-blobs-start-offset-blob"),
Storage.BlobListOption.endOffset("test-list-blobs-end-offset-blob3"));
// Listing blobs is eventually consistent, we loop until the list is of the expected size.
while (Iterators.size(page.iterateAll().iterator()) != 3) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell if this is working because it's using all the objects created during the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frankyn yes you are right, i have wrote new test instead of that. Now you can easily verify it.

@athakor athakor added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jul 17, 2020
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 17, 2020
@athakor
Copy link
Contributor Author

athakor commented Jul 17, 2020

@frankyn PTAL

@frankyn frankyn merged commit 38c1c34 into googleapis:master Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage: support startOffset and endOffset query param during object listing
4 participants