[ 
https://issues.apache.org/jira/browse/FLINK-10865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16699318#comment-16699318
 ] 

ASF GitHub Bot commented on FLINK-10865:
----------------------------------------

StefanRRichter commented on a change in pull request #7123: [FLINK-10865] Add 
Aliyun OSS file systems without Hadoop dependencies
URL: https://github.com/apache/flink/pull/7123#discussion_r236344254
 
 

 ##########
 File path: 
flink-filesystems/flink-oss-fs-hadoop/src/test/java/org/apache/flink/fs/osshadoop/HadoopOSSFileSystemITCase.java
 ##########
 @@ -0,0 +1,113 @@
+/*
+ * 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.osshadoop;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.core.fs.FSDataInputStream;
+import org.apache.flink.core.fs.FSDataOutputStream;
+import org.apache.flink.core.fs.FileSystem;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
+import java.util.UUID;
+
+import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertTrue;
+
+/**
+ * Unit tests for the OSS file system support via AliyunOSSFileSystem.
+ * These tests do actually read from or write to OSS.
+ */
+public class HadoopOSSFileSystemITCase extends TestLogger {
+
+       private static final String ENDPOINT = 
System.getenv("ARTIFACTS_OSS_ENDPOINT");
+       private static final String BUCKET = 
System.getenv("ARTIFACTS_OSS_BUCKET");
+       private static final String TEST_DATA_DIR = "tests-" + 
UUID.randomUUID();
+       private static final String ACCESS_KEY = 
System.getenv("ARTIFACTS_OSS_ACCESS_KEY");
+       private static final String SECRET_KEY = 
System.getenv("ARTIFACTS_OSS_SECRET_KEY");
+
+       @BeforeClass
+       public static void checkIfCredentialsArePresent() {
+               Assume.assumeTrue("Aliyun OSS endpoint not configured, skipping 
test...", ENDPOINT != null);
+               Assume.assumeTrue("Aliyun OSS bucket not configured, skipping 
test...", BUCKET != null);
+               Assume.assumeTrue("Aliyun OSS access key not configured, 
skipping test...", ACCESS_KEY != null);
+               Assume.assumeTrue("Aliyun OSS secret key not configured, 
skipping test...", SECRET_KEY != null);
+       }
+
+       @Test
+       public void testReadAndWrite() throws Exception {
 
 Review comment:
   I found that there are more than one file system IT case that does similar 
things like testing a read-write cycle, listing directories, etc.
   
   I would suggest at this point to introduce an `AbstractFileSystemITCase` 
that serves as a base for all thoise tests and the tests only implement the 
setup and path creation. This would help us to deduplicate code. We could also 
separate tests for read/write and directory listing, because maybe not all file 
systems support the concept of a directory.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Implement Flink's own Aliyun OSS filesystem
> -------------------------------------------
>
>                 Key: FLINK-10865
>                 URL: https://issues.apache.org/jira/browse/FLINK-10865
>             Project: Flink
>          Issue Type: New Feature
>          Components: filesystem-connector
>    Affects Versions: 1.6.2
>            Reporter: wujinhu
>            Priority: Major
>              Labels: pull-request-available
>
> Aliyun OSS is widely used among China’s cloud users, and Hadoop supports 
> Aliyun OSS since 2.9.1. 
> Open this jira to wrap AliyunOSSFileSystem in flink(similar to s3 support), 
> so that user can read from & write to OSS more easily in flink. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to