peterxcli commented on code in PR #10166:
URL: https://github.com/apache/ozone/pull/10166#discussion_r3180692841
##########
hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto:
##########
@@ -1101,6 +1101,11 @@ message KeyArgs {
// the given ETag for the operation to succeed. This is used for
// S3 conditional writes with the If-Match header.
optional string expectedETag = 24;
+
+ // Byte range requested by S3 GET. OM uses it to return only the
+ // key locations needed to satisfy the read.
+ optional uint64 byteRangeStart = 25;
+ optional uint64 byteRangeEnd = 26;
Review Comment:
How about introducing a common msg, I remember few DN-SCM pb messages have
range concept, maybe we could reuse theirs?
```proto
message ByteRange {
// Inclusive start and end offsets: [start, end].
optional uint64 start = 1;
optional uint64 end = 2;
}
message KeyArgs {
// ...
optional ByteRange byteRange = 25;
}
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerRequestHandler.java:
##########
@@ -658,6 +663,11 @@ private GetKeyInfoResponse getKeyInfo(GetKeyInfoRequest
request,
keyArgs.getForceUpdateContainerCacheFromSCM())
.setMultipartUploadPartNumber(keyArgs.getMultipartNumber())
.build();
+ if (keyArgs.hasByteRangeStart() && keyArgs.hasByteRangeEnd()) {
Review Comment:
could become
```suggestion
if (keyArgs.hasByteRange()) {
```
if we introduce new range message.
https://github.com/apache/ozone/pull/10166/changes#r3180692841
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/protocol/ClientProtocol.java:
##########
@@ -178,6 +179,49 @@ OzoneKeyDetails getS3KeyDetails(String bucketName, String
keyName,
int partNumber)
throws IOException;
+ /**
+ * Get OzoneKey in S3 context with content positioned at the requested
+ * byte range start.
+ * @param bucketName Name of the Bucket
+ * @param keyName Key name
+ * @param partNumber Multipart-upload part number, or zero for the whole key
+ * @param startOffset inclusive byte range start offset
+ * @param endOffset inclusive byte range end offset
+ * @return {@link OzoneKey}
+ * @throws IOException
+ */
+ default OzoneKeyDetails getS3KeyDetails(String bucketName, String keyName,
Review Comment:
this should sit in ClientProtocolStub.
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/protocol/ClientProtocol.java:
##########
@@ -178,6 +179,49 @@ OzoneKeyDetails getS3KeyDetails(String bucketName, String
keyName,
int partNumber)
throws IOException;
+ /**
+ * Get OzoneKey in S3 context with content positioned at the requested
+ * byte range start.
+ * @param bucketName Name of the Bucket
+ * @param keyName Key name
+ * @param partNumber Multipart-upload part number, or zero for the whole key
+ * @param startOffset inclusive byte range start offset
+ * @param endOffset inclusive byte range end offset
+ * @return {@link OzoneKey}
+ * @throws IOException
+ */
+ default OzoneKeyDetails getS3KeyDetails(String bucketName, String keyName,
Review Comment:
why there is a implementation?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]