szetszwo commented on a change in pull request #2858:
URL: https://github.com/apache/ozone/pull/2858#discussion_r774459803
##########
File path:
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
##########
@@ -125,6 +132,8 @@
private List<String> customizableGetHeaders = new ArrayList<>();
private int bufferSize;
+ private int chunkSize;
+ private boolean enableStreaming;
Review comment:
Let's call it "datastreamEnabled".
##########
File path:
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
##########
@@ -195,16 +211,24 @@ public Response put(
// Normal put object
OzoneBucket bucket = getBucket(bucketName);
-
- output = bucket.createKey(keyPath, length, replicationType,
- replicationFactor, new HashMap<>());
-
if ("STREAMING-AWS4-HMAC-SHA256-PAYLOAD"
.equals(headers.getHeaderString("x-amz-content-sha256"))) {
body = new SignedChunksInputStream(body);
}
- IOUtils.copy(body, output);
+ if (enableStreaming) {
Review comment:
Let's move the new code to a new class, say ObjectEndpointStreaming.
Otherwise, there are many changes here and it becomes hard to maintain.
```
@PUT
public Response put(
@PathParam("bucket") String bucketName,
@PathParam("path") String keyPath,
@HeaderParam("Content-Length") long length,
@QueryParam("partNumber") int partNumber,
@QueryParam("uploadId") @DefaultValue("") String uploadID,
InputStream body) throws IOException, OS3Exception {
if (datastreamEnabled) {
return objectEndpointStreaming.put(bucketName, keyPath, length,
partNumber, uploadID, body);
}
...
}
```
##########
File path:
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/S3GatewayConfigKeys.java
##########
@@ -64,6 +64,10 @@
public static final String OZONE_S3G_KERBEROS_PRINCIPAL_KEY =
"ozone.s3g.kerberos.principal";
+ public static final String OZONE_S3G_STREAMING_PUT_ENABLE =
+ "ozone.s3g.streaming.put.enable";
+ public static final boolean OZONE_S3G_STREAMING_PUT_ENABLE_DEFAULT =
+ false;
Review comment:
Please reuse OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLE
instead of adding a new conf.
--
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]