Izeren commented on code in PR #28867:
URL: https://github.com/apache/flink/pull/28867#discussion_r3806288401


##########
flink-filesystems/flink-s3-fs-native/src/test/java/org/apache/flink/fs/s3native/writer/NativeS3RecoverableWriterRecoveryITCase.java:
##########
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.fs.s3native.writer;
+
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.core.fs.RecoverableFsDataOutputStream;
+import org.apache.flink.core.fs.RecoverableWriter;
+import org.apache.flink.core.testutils.AllCallbackWrapper;
+import org.apache.flink.core.testutils.TestContainerExtension;
+import org.apache.flink.fs.s3native.SeaweedFsNativeS3TestContainer;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.io.TempDir;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.UUID;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+/**
+ * Integration tests for {@link NativeS3RecoverableWriter#recover} running 
against SeaweedFS.
+ *
+ * <p>SeaweedFS enforces the S3 5 MiB minimum part size on multipart-complete, 
so every scenario
+ * writes one full {@value #PART}-byte first part (the only non-final part) 
followed by a small tail
+ * that becomes the final part.
+ */
+class NativeS3RecoverableWriterRecoveryITCase {
+
+    private static final int PART = 5 * 1024 * 1024;
+    private static final long MIN_PART_SIZE = PART;
+
+    @RegisterExtension
+    private static final 
AllCallbackWrapper<TestContainerExtension<SeaweedFsNativeS3TestContainer>>
+            SEAWEEDFS_EXTENSION =
+                    new AllCallbackWrapper<>(
+                            new 
TestContainerExtension<>(SeaweedFsNativeS3TestContainer::new));
+
+    @TempDir java.nio.file.Path tmp;
+
+    private String bucket;
+    private String key;
+    private SeaweedFsNativeS3Operations s3;
+
+    @BeforeEach
+    void setUp() {
+        bucket = getContainer().getDefaultBucketName();
+        key = "out-" + UUID.randomUUID() + ".txt";
+        s3 = new SeaweedFsNativeS3Operations(getContainer().getClient(), 
bucket);
+    }
+
+    private static SeaweedFsNativeS3TestContainer getContainer() {
+        return SEAWEEDFS_EXTENSION.getCustomExtension().getTestContainer();
+    }
+
+    private NativeS3RecoverableWriter writer() {
+        return NativeS3RecoverableWriter.writer(s3, tmp.toString(), 
MIN_PART_SIZE, 1);
+    }
+
+    private Path targetPath() {
+        return new Path("s3://" + bucket + "/" + key);
+    }
+
+    private String incompletePrefix() {
+        int lastSlash = key.lastIndexOf('/');

Review Comment:
   It is not blocking, but it looks like the feedback was addressed elsewhere, 
but not in this method



-- 
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]

Reply via email to