JingsongLi commented on a change in pull request #23:
URL: https://github.com/apache/flink-table-store/pull/23#discussion_r811736268



##########
File path: 
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/FileStoreOptions.java
##########
@@ -20,33 +20,111 @@
 
 import org.apache.flink.configuration.ConfigOption;
 import org.apache.flink.configuration.ConfigOptions;
+import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.MemorySize;
-import org.apache.flink.configuration.ReadableConfig;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.table.store.file.mergetree.MergeTreeOptions;
+
+import java.io.Serializable;
+import java.time.Duration;
+
+import static org.apache.flink.configuration.ConfigOptions.key;
 
 /** Options for {@link FileStore}. */
-public class FileStoreOptions {
+public class FileStoreOptions implements Serializable {
 
     public static final ConfigOption<Integer> BUCKET =
             ConfigOptions.key("bucket")
                     .intType()
                     .defaultValue(1)
                     .withDescription("Bucket number for file store.");
 
+    public static final ConfigOption<String> FILE_PATH =
+            ConfigOptions.key("file.path")
+                    .stringType()
+                    .noDefaultValue()
+                    .withDescription("The file path of the table store in the 
filesystem.");
+
+    public static final ConfigOption<String> FILE_FORMAT =
+            ConfigOptions.key("file.format")
+                    .stringType()
+                    .defaultValue("orc")
+                    .withDescription("Specify the message format of data 
files.");
+
+    public static final ConfigOption<String> MANIFEST_FORMAT =
+            ConfigOptions.key("manifest.format")
+                    .stringType()
+                    .defaultValue("avro")
+                    .withDescription("Specify the message format of manifest 
files.");
+
     public static final ConfigOption<MemorySize> MANIFEST_TARGET_FILE_SIZE =
             ConfigOptions.key("manifest.target-file-size")
                     .memoryType()
                     .defaultValue(MemorySize.ofMebiBytes(8))
                     .withDescription("Suggested file size of a manifest 
file.");
 
-    public final int bucket;
-    public final MemorySize manifestSuggestedSize;
+    public static final ConfigOption<String> PARTITION_DEFAULT_NAME =
+            key("partition.default-name")
+                    .stringType()
+                    .defaultValue("__DEFAULT_PARTITION__")
+                    .withDescription(
+                            "The default partition name in case the dynamic 
partition"
+                                    + " column value is null/empty string.");
+
+    public static final ConfigOption<Integer> SNAPSHOT_NUM_RETAINED =
+            ConfigOptions.key("snapshot.num-retained")
+                    .intType()
+                    .defaultValue(Integer.MAX_VALUE)
+                    .withDescription("The maximum number of completed 
snapshots to retain.");
+
+    public static final ConfigOption<Duration> SNAPSHOT_TIME_RETAINED =
+            ConfigOptions.key("snapshot.time-retained")
+                    .durationType()
+                    .defaultValue(Duration.ofDays(1))
+                    .withDescription("The maximum time of completed snapshots 
to retain.");
+
+    private final Configuration options;
+
+    public FileStoreOptions(Configuration options) {
+        this.options = options;
+        // TODO validate all keys
+    }
+
+    public int bucket() {
+        return options.get(BUCKET);
+    }
+
+    public Path path() {
+        return new Path(options.get(FILE_PATH));
+    }
+
+    public FileFormat fileFormat() {
+        return FileFormat.fromTableOptions(
+                Thread.currentThread().getContextClassLoader(), options, 
FILE_FORMAT);
+    }
+
+    public FileFormat manifestFormat() {
+        return FileFormat.fromTableOptions(
+                Thread.currentThread().getContextClassLoader(), options, 
MANIFEST_FORMAT);
+    }

Review comment:
       `FileFormat` is not serializable.




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