Skip to content

Commit

Permalink
[FLINK-16400][filesystem] Deprecating filesystem kind.
Browse files Browse the repository at this point in the history
Also removing invalid HdfsKindTest cases.
  • Loading branch information
Arvid Heise authored and pnowojski committed Mar 5, 2020
1 parent be0eb54 commit 3e66fcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,9 @@ public FSDataOutputStream create(Path f, boolean overwrite) throws IOException {

/**
* Gets a description of the characteristics of this file system.
* @deprecated this method is not used anymore.
*/
@Deprecated
public abstract FileSystemKind getKind();

// ------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,6 @@ public void testHdfsKind() throws IOException {
assertEquals(FileSystemKind.FILE_SYSTEM, fs.getKind());
}

@Test
public void testS3Kind() throws IOException {
try {
Class.forName("org.apache.hadoop.fs.s3.S3FileSystem");
} catch (ClassNotFoundException ignored) {
// not in the classpath, cannot run this test
log.info("Skipping test 'testS3Kind()' because the S3 file system is not in the class path");
return;
}

final FileSystem s3 = new Path("s3:https://myId:mySecret@bucket/some/bucket/some/object").getFileSystem();
assertEquals(FileSystemKind.OBJECT_STORE, s3.getKind());
}

@Test
public void testS3nKind() throws IOException {
try {
Class.forName("org.apache.hadoop.fs.s3native.NativeS3FileSystem");
} catch (ClassNotFoundException ignored) {
// not in the classpath, cannot run this test
log.info("Skipping test 'testS3nKind()' because the Native S3 file system is not in the class path");
return;
}

final FileSystem s3n = new Path("s3n:https://myId:mySecret@bucket/some/bucket/some/object").getFileSystem();
assertEquals(FileSystemKind.OBJECT_STORE, s3n.getKind());
}

@Test
public void testS3aKind() throws IOException {
try {
Class.forName("org.apache.hadoop.fs.s3a.S3AFileSystem");
} catch (ClassNotFoundException ignored) {
// not in the classpath, cannot run this test
log.info("Skipping test 'testS3aKind()' because the S3AFileSystem is not in the class path");
return;
}

final FileSystem s3a = new Path("s3a:https://myId:mySecret@bucket/some/bucket/some/object").getFileSystem();
assertEquals(FileSystemKind.OBJECT_STORE, s3a.getKind());
}

@Test
public void testS3fileSystemSchemes() {
assertEquals(FileSystemKind.OBJECT_STORE, HadoopFileSystem.getKindForScheme("s3"));
Expand Down

0 comments on commit 3e66fcf

Please sign in to comment.