@Test public void testCopy() { DLASyncConfig dlaSyncConfig = new DLASyncConfig(); List<String> partitions = Arrays.asList("a", "b"); dlaSyncConfig.partitionFields = partitions; dlaSyncConfig.basePath = "/tmp"; dlaSyncConfig.assumeDatePartitioning = true; dlaSyncConfig.databaseName = "test"; dlaSyncConfig.tableName = "test"; dlaSyncConfig.dlaUser = "dla"; dlaSyncConfig.dlaPass = "dla"; dlaSyncConfig.jdbcUrl = "jdbc:mysql: dlaSyncConfig.skipROSuffix = false; DLASyncConfig copied = DLASyncConfig.copy(dlaSyncConfig); assertEquals(copied.partitionFields, dlaSyncConfig.partitionFields); assertEquals(copied.basePath, dlaSyncConfig.basePath); assertEquals(copied.assumeDatePartitioning, dlaSyncConfig.assumeDatePartitioning); assertEquals(copied.databaseName, dlaSyncConfig.databaseName); assertEquals(copied.tableName, dlaSyncConfig.tableName); assertEquals(copied.dlaUser, dlaSyncConfig.dlaUser); assertEquals(copied.dlaPass, dlaSyncConfig.dlaPass); assertEquals(copied.basePath, dlaSyncConfig.basePath); assertEquals(copied.jdbcUrl, dlaSyncConfig.jdbcUrl); assertEquals(copied.skipROSuffix, dlaSyncConfig.skipROSuffix); }
public static DLASyncConfig copy(DLASyncConfig cfg) { DLASyncConfig newConfig = new DLASyncConfig(); newConfig.databaseName = cfg.databaseName; newConfig.tableName = cfg.tableName; newConfig.dlaUser = cfg.dlaUser; newConfig.dlaPass = cfg.dlaPass; newConfig.jdbcUrl = cfg.jdbcUrl; newConfig.basePath = cfg.basePath; newConfig.partitionFields = cfg.partitionFields; newConfig.partitionValueExtractorClass = cfg.partitionValueExtractorClass; newConfig.assumeDatePartitioning = cfg.assumeDatePartitioning; newConfig.skipROSuffix = cfg.skipROSuffix; newConfig.useDLASyncHiveStylePartitioning = cfg.useDLASyncHiveStylePartitioning; return newConfig; }
DLASyncConfig implements Serializable { public static DLASyncConfig copy(DLASyncConfig cfg) { DLASyncConfig newConfig = new DLASyncConfig(); newConfig.databaseName = cfg.databaseName; newConfig.tableName = cfg.tableName; newConfig.dlaUser = cfg.dlaUser; newConfig.dlaPass = cfg.dlaPass; newConfig.jdbcUrl = cfg.jdbcUrl; newConfig.basePath = cfg.basePath; newConfig.partitionFields = cfg.partitionFields; newConfig.partitionValueExtractorClass = cfg.partitionValueExtractorClass; newConfig.assumeDatePartitioning = cfg.assumeDatePartitioning; newConfig.skipROSuffix = cfg.skipROSuffix; newConfig.useDLASyncHiveStylePartitioning = cfg.useDLASyncHiveStylePartitioning; return newConfig; } }
DLASyncConfig implements Serializable { public static DLASyncConfig copy(DLASyncConfig cfg) { DLASyncConfig newConfig = new DLASyncConfig(); newConfig.databaseName = cfg.databaseName; newConfig.tableName = cfg.tableName; newConfig.dlaUser = cfg.dlaUser; newConfig.dlaPass = cfg.dlaPass; newConfig.jdbcUrl = cfg.jdbcUrl; newConfig.basePath = cfg.basePath; newConfig.partitionFields = cfg.partitionFields; newConfig.partitionValueExtractorClass = cfg.partitionValueExtractorClass; newConfig.assumeDatePartitioning = cfg.assumeDatePartitioning; newConfig.skipROSuffix = cfg.skipROSuffix; newConfig.useDLASyncHiveStylePartitioning = cfg.useDLASyncHiveStylePartitioning; return newConfig; }  }
DLASyncConfig implements Serializable { public static DLASyncConfig copy(DLASyncConfig cfg) { DLASyncConfig newConfig = new DLASyncConfig(); newConfig.databaseName = cfg.databaseName; newConfig.tableName = cfg.tableName; newConfig.dlaUser = cfg.dlaUser; newConfig.dlaPass = cfg.dlaPass; newConfig.jdbcUrl = cfg.jdbcUrl; newConfig.basePath = cfg.basePath; newConfig.partitionFields = cfg.partitionFields; newConfig.partitionValueExtractorClass = cfg.partitionValueExtractorClass; newConfig.assumeDatePartitioning = cfg.assumeDatePartitioning; newConfig.skipROSuffix = cfg.skipROSuffix; newConfig.useDLASyncHiveStylePartitioning = cfg.useDLASyncHiveStylePartitioning; return newConfig; }  static DLASyncConfig copy(DLASyncConfig cfg); @Override String toString(); }
DLASyncConfig implements Serializable { public static DLASyncConfig copy(DLASyncConfig cfg) { DLASyncConfig newConfig = new DLASyncConfig(); newConfig.databaseName = cfg.databaseName; newConfig.tableName = cfg.tableName; newConfig.dlaUser = cfg.dlaUser; newConfig.dlaPass = cfg.dlaPass; newConfig.jdbcUrl = cfg.jdbcUrl; newConfig.basePath = cfg.basePath; newConfig.partitionFields = cfg.partitionFields; newConfig.partitionValueExtractorClass = cfg.partitionValueExtractorClass; newConfig.assumeDatePartitioning = cfg.assumeDatePartitioning; newConfig.skipROSuffix = cfg.skipROSuffix; newConfig.useDLASyncHiveStylePartitioning = cfg.useDLASyncHiveStylePartitioning; return newConfig; }  static DLASyncConfig copy(DLASyncConfig cfg); @Override String toString(); @Parameter(names = {"--database"}, description = "name of the target database in DLA", required = true)
  public String databaseName; @Parameter(names = {"--table"}, description = "name of the target table in DLA", required = true)
  public String tableName; @Parameter(names = {"--user"}, description = "DLA username", required = true)
  public String dlaUser; @Parameter(names = {"--pass"}, description = "DLA password", required = true)
  public String dlaPass; @Parameter(names = {"--jdbc-url"}, description = "DLA jdbc connect url", required = true)
  public String jdbcUrl; @Parameter(names = {"--base-path"}, description = "Basepath of hoodie table to sync", required = true)
  public String basePath; @Parameter(names = "--partitioned-by", description = "Fields in the schema partitioned by")
  public List<String> partitionFields; @Parameter(names = "--partition-value-extractor", description = "Class which implements PartitionValueExtractor "
      + "to extract the partition values from HDFS path")
  public String partitionValueExtractorClass; @Parameter(names = {"--assume-date-partitioning"}, description = "Assume standard yyyy/mm/dd partitioning, this"
      + " exists to support backward compatibility. If you use hoodie 0.3.x, do not set this parameter")
  public Boolean assumeDatePartitioning; @Parameter(names = {"--skip-ro-suffix"}, description = "Skip the `_ro` suffix for Read optimized table, when registering")
  public Boolean skipROSuffix; @Parameter(names = {"--hive-style-partitioning"}, description = "Use DLA hive style partitioning, true if like the following style: field1=value1/field2=value2")
  public Boolean useDLASyncHiveStylePartitioning; @Parameter(names = {"--help", "-h"}, help = true)
  public Boolean help; }