You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/07/07 16:32:14 UTC

[GitHub] [beam] aromanenko-dev commented on a change in pull request #15036: [BEAM-12435] Generalize S3FileSystem to support multiple URI schemes.

aromanenko-dev commented on a change in pull request #15036:
URL: https://github.com/apache/beam/pull/15036#discussion_r665529848



##########
File path: sdks/java/io/amazon-web-services/src/test/java/org/apache/beam/sdk/io/aws/s3/S3WritableByteChannelTest.java
##########
@@ -60,29 +59,29 @@
 
   @Test
   public void write() throws IOException {
-    writeFromOptions(s3Options());

Review comment:
       Should it still support write from options?

##########
File path: sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3FileSystemSchemeRegistrar.java
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.beam.sdk.io.aws.s3;
+
+import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkNotNull;
+
+import com.google.auto.service.AutoService;
+import javax.annotation.Nonnull;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Experimental.Kind;
+import org.apache.beam.sdk.io.aws.options.S3Options;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+
+/** Registers the "s3" uri schema to be handled by {@link S3FileSystem}. */
+@AutoService(S3FileSystemSchemeRegistrar.class)
+@Experimental(Kind.FILESYSTEM)
+public class DefaultS3FileSystemSchemeRegistrar implements S3FileSystemSchemeRegistrar {

Review comment:
       Do we need to have this class public?

##########
File path: sdks/java/io/amazon-web-services/src/test/java/org/apache/beam/sdk/io/aws/s3/S3FileSystemTest.java
##########
@@ -107,59 +106,64 @@ public static void afterClass() {
 
   @Test
   public void testGetScheme() {
-    S3FileSystem s3FileSystem = new S3FileSystem(s3Options());
+    S3FileSystem s3FileSystem = new S3FileSystem(s3Config("s3"));

Review comment:
       Would it better to keep using `s3Options()` here to make sure that schema is properly parsed from options as well?
   
   In general, I'd prefer to keep all old tests as they were before to make sure that we don't have any user API breakage.




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org