-
Notifications
You must be signed in to change notification settings - Fork 241
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
Move list object API to java storage. #1083
base: master
Are you sure you want to change the base?
Move list object API to java storage. #1083
Conversation
ee51416
to
ddcfbfe
Compare
@@ -90,6 +105,17 @@ public class GoogleCloudStorageClientImpl extends ForwardingGoogleCloudStorage { | |||
.setDaemon(true) | |||
.build()); | |||
|
|||
@Nullable | |||
private static byte[] decodeMetadataValues(String value) { |
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.
We can considering somehow reusing the implementation rather then duplicating the code.
"listStorageObjectsInternal(%s, %s): item not found", resource, listOptions); | ||
return null; | ||
} | ||
throw new IOException("Error listing " + resource, e); |
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 include the e.message as well to the IOException message. Sometime some of the tools just log the message and skip the inner exception details.
"listStorageObjectsInternal(%s, %s): item not found", resource, listOptions); | ||
return null; | ||
} | ||
throw new IOException("Error listing " + resource, e); |
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.
Veneer would have retried, correct?
} | ||
|
||
// Create inferred directory for the prefix object if necessary. | ||
if (listOptions.isIncludePrefix() |
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.
Code duplication. Is there a way to avoid this?
if (maxResults <= 0) { | ||
return Long.MAX_VALUE; | ||
} | ||
return maxResults - blobs.size(); |
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.
This logic is different from Apiary implementation. Why?
return maxResults - blobs.size(); | ||
} | ||
|
||
private static BlobField getBlobField(String field) { |
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.
Where is this getting used?
List<BlobListOption> blobListOptions = new ArrayList<>(); | ||
|
||
blobListOptions.add(BlobListOption.pageSize( | ||
maxResults <= 0 || maxResults >= storageOptions.getMaxListItemsPerCall() |
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.
why no use Math.min? It might be bit more readable.
byte[] md5Hash = null; | ||
byte[] crc32c = null; | ||
|
||
if (!isNullOrEmpty(blob.getCrc32c())) { |
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.
Please try to avoid code duplication.
ddcfbfe
to
611f17f
Compare
611f17f
to
e99f850
Compare
No description provided.