steveloughran commented on code in PR #4669:
URL: https://github.com/apache/hadoop/pull/4669#discussion_r960653667
##########
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AStorageClass.java:
##########
@@ -43,13 +51,34 @@
/**
* Tests of storage class.
*/
+@RunWith(Parameterized.class)
public class ITestS3AStorageClass extends AbstractS3ATestBase {
+ /**
+ * HADOOP-18339. Parameterized the test for different fast upload buffer
types
+ * to ensure the storage class configuration works with all of them.
+ */
+ @Parameterized.Parameters(name = "fast-upload-buffer-{0}")
+ public static Collection<Object[]> params() {
+ return Arrays.asList(new Object[][]{
+ {FAST_UPLOAD_BUFFER_DISK},
+ {FAST_UPLOAD_BUFFER_ARRAY},
+ {FAST_UPLOAD_BYTEBUFFER}
Review Comment:
let's cut the bytebuffer one as we know the array option gives us the
coverage we need, and it will save test time
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/RequestFactoryImpl.java:
##########
@@ -416,19 +419,22 @@ public PutObjectRequest newDirectoryMarkerRequest(String
directory) {
String key = directory.endsWith("/")
? directory
: (directory + "/");
- // an input stream which is laways empty
- final InputStream im = new InputStream() {
+ // an input stream which is always empty
+ final InputStream inputStream = new InputStream() {
@Override
public int read() throws IOException {
return -1;
}
};
// preparation happens in here
- final ObjectMetadata md = createObjectMetadata(0L, true);
- md.setContentType(HeaderProcessing.CONTENT_TYPE_X_DIRECTORY);
- PutObjectRequest putObjectRequest =
- newPutObjectRequest(key, md, null, im);
- return putObjectRequest;
+ final ObjectMetadata metadata = createObjectMetadata(0L, true);
+ metadata.setContentType(HeaderProcessing.CONTENT_TYPE_X_DIRECTORY);
+
+ PutObjectRequest putObjectRequest = new PutObjectRequest(getBucket(), key,
+ inputStream, metadata);
+ setOptionalPutRequestParameters(putObjectRequest);
+ putObjectRequest.setCannedAcl(cannedACL);
Review Comment:
were we missing this before?
--
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]