Skip to content

Commit

Permalink
[core] Make FileIOLoader extends Serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Jan 17, 2025
1 parent 7e768c0 commit 107e5ec
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.paimon.annotation.Public;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

Expand All @@ -29,7 +30,7 @@
* @since 0.4.0
*/
@Public
public interface FileIOLoader {
public interface FileIOLoader extends Serializable {

String getScheme();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/** {@link FileIOLoader} to load {@link HadoopFileIO}. */
public class HadoopFileIOLoader implements FileIOLoader {

private static final long serialVersionUID = 1L;

@Override
public String getScheme() {
return "hdfs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/** {@link FileIOLoader} to load {@link HadoopFileIO}. */
public class HadoopViewFsFileIOLoader implements FileIOLoader {

private static final long serialVersionUID = 1L;

@Override
public String getScheme() {
return "viewfs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/** {@link FileIOLoader} to load {@link LocalFileIO}. */
public class LocalFileIOLoader implements FileIOLoader {

private static final long serialVersionUID = 1L;

public static final String SCHEME = "file";

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
/** Test {@link FileIOLoader}. */
public class RequireOptionsFileIOLoader implements FileIOLoader {

private static final long serialVersionUID = 1L;

@Override
public String getScheme() {
return "require-options";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public void testHadoopConfDirWithScheme() throws Exception {
/** {@link FileIOLoader} for this test. */
public static class TestFileIOLoader implements FileIOLoader {

private static final long serialVersionUID = 1L;

private static final String SCHEME = "hadoop-utils-test-file-io";

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ public static void retryArtificialException(Runnable runnable) throws Exception
/** Loader for {@link FailingFileIO}. */
public static class Loader implements FileIOLoader {

private static final long serialVersionUID = 1L;

@Override
public String getScheme() {
return SCHEME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ public static List<PositionOutputStream> openOutputStreams(Predicate<Path> filte
/** Loader for {@link TraceableFileIO}. */
public static class Loader implements FileIOLoader {

private static final long serialVersionUID = 1L;

@Override
public String getScheme() {
return SCHEME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
/** A {@link PluginLoader} to load oss. */
public class OSSLoader implements FileIOLoader {

private static final long serialVersionUID = 1L;

private static final String OSS_CLASSES_DIR = "paimon-plugin-oss";

private static final String OSS_CLASS = "org.apache.paimon.oss.OSSFileIO";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
/** A {@link PluginLoader} to load oss. */
public class S3Loader implements FileIOLoader {

private static final long serialVersionUID = 1L;

private static final String S3_CLASSES_DIR = "paimon-plugin-s3";

private static final String S3_CLASS = "org.apache.paimon.s3.S3FileIO";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
/** Flink {@link FileIOLoader} for {@link FlinkFileIO}. */
public class FlinkFileIOLoader implements FileIOLoader {

private static final long serialVersionUID = 1L;

@Override
public String getScheme() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public void write(byte[] b, int off, int len) throws IOException {
/** Loader for {@link CloneActionSlowFileIO}. */
public static class Loader implements FileIOLoader {

private static final long serialVersionUID = 1L;

@Override
public String getScheme() {
return SCHEME;
Expand Down

0 comments on commit 107e5ec

Please sign in to comment.