xushiyan commented on a change in pull request #4175:
URL: https://github.com/apache/hudi/pull/4175#discussion_r824621228
##########
File path:
hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/util/SyncUtilHelpers.java
##########
@@ -0,0 +1,67 @@
+package org.apache.hudi.sync.common.util;
+
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.util.ReflectionUtils;
+import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.sync.common.AbstractSyncTool;
+import org.apache.hudi.sync.common.HoodieSyncConfig;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+
+import java.util.Properties;
+
+/**
+ * Helper class for syncing Hudi commit data with external metastores.
+ */
+public class SyncUtilHelpers {
+
+ /**
+ * Create an instance of an implementation of {@link AbstractSyncTool} that
will sync all the relevant meta information
+ * with an external metastore such as Hive etc. to ensure Hoodie tables can
be queried or read via external systems.
+ *
+ * @param metaSyncClass The class that implements the sync of the metadata.
+ * @param props property map.
+ * @param hadoopConfig Hadoop confs.
+ * @param fs Filesystem used.
+ * @param targetBasePath The target base path that contains the hoodie table.
+ * @param baseFileFormat The file format used by the hoodie table (defaults
to PARQUET).
+ * @return
+ */
+ public static void createAndSyncHoodieMeta(String metaSyncClass,
+ TypedProperties props,
+ Configuration hadoopConfig,
+ FileSystem fs,
+ String targetBasePath,
+ String baseFileFormat) {
+ try {
+ createMetaSyncClass(metaSyncClass, props, hadoopConfig, fs,
targetBasePath, baseFileFormat).syncHoodieTable();
+ } catch (Throwable e) {
+ throw new HoodieException("Could not sync using the meta sync class " +
metaSyncClass, e);
+ }
+ }
+
+ static AbstractSyncTool createMetaSyncClass(String metaSyncClass,
Review comment:
IIUC "meta sync" and "hudi sync" or "hoodie sync" mean the same thing.
Since we call the module `hudi-sync` then we should just stick to it and call
`hoodieSync` throughout the codebase. no `metaSync` at all. WDYT?
--
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]