@Test public void testSystemDefaultConfig() { SystemDefaultConfig defaultDefaults = TDOperator.systemDefaultConfig(configFactory.create()); assertThat(defaultDefaults.getEndpoint(), is("api.treasuredata.com")); Config overrideConfig = configFactory.create() .set("config.td.default_endpoint", "api.treasuredata.co.jp"); SystemDefaultConfig overrides = TDOperator.systemDefaultConfig(overrideConfig); assertThat(overrides.getEndpoint(), is("api.treasuredata.co.jp")); }
static SystemDefaultConfig systemDefaultConfig(Config systemConfig) { final String endpoint = systemConfig.get("config.td.default_endpoint", String.class, "api.treasuredata.com"); return new SystemDefaultConfig() { @Override public String getEndpoint() { return endpoint; } }; }
TDOperator implements Closeable { static SystemDefaultConfig systemDefaultConfig(Config systemConfig) { final String endpoint = systemConfig.get("config.td.default_endpoint", String.class, "api.treasuredata.com"); return new SystemDefaultConfig() { @Override public String getEndpoint() { return endpoint; } }; } }
TDOperator implements Closeable { static SystemDefaultConfig systemDefaultConfig(Config systemConfig) { final String endpoint = systemConfig.get("config.td.default_endpoint", String.class, "api.treasuredata.com"); return new SystemDefaultConfig() { @Override public String getEndpoint() { return endpoint; } }; } TDOperator(TDClient client, String database); }
TDOperator implements Closeable { static SystemDefaultConfig systemDefaultConfig(Config systemConfig) { final String endpoint = systemConfig.get("config.td.default_endpoint", String.class, "api.treasuredata.com"); return new SystemDefaultConfig() { @Override public String getEndpoint() { return endpoint; } }; } TDOperator(TDClient client, String database); static TDOperator fromConfig(SystemDefaultConfig systemDefaultConfig, Map<String, String> env, Config config, SecretProvider secrets); static String escapeHiveIdent(String ident); static String escapePrestoIdent(String ident); static String escapeHiveTableName(TableParam table); static String escapePrestoTableName(TableParam table); TDOperator withDatabase(String anotherDatabase); String getDatabase(); void ensureDatabaseCreated(String name); void ensureDatabaseDeleted(String name); void ensureTableCreated(String tableName); void ensureTableDeleted(String tableName); void ensureExistentTableRenamed(String existentTable, String toName); boolean tableExists(String table); long lookupConnection(String name); String submitNewJobWithRetry(TDJobRequest req); String submitNewJobWithRetry(Submitter submitter); TDJobOperator newJobOperator(String jobId); TDJobOperator runJob(TaskState state, String key, DurationInterval pollInterval, DurationInterval retryInterval, JobStarter starter); @Override void close(); }
TDOperator implements Closeable { static SystemDefaultConfig systemDefaultConfig(Config systemConfig) { final String endpoint = systemConfig.get("config.td.default_endpoint", String.class, "api.treasuredata.com"); return new SystemDefaultConfig() { @Override public String getEndpoint() { return endpoint; } }; } TDOperator(TDClient client, String database); static TDOperator fromConfig(SystemDefaultConfig systemDefaultConfig, Map<String, String> env, Config config, SecretProvider secrets); static String escapeHiveIdent(String ident); static String escapePrestoIdent(String ident); static String escapeHiveTableName(TableParam table); static String escapePrestoTableName(TableParam table); TDOperator withDatabase(String anotherDatabase); String getDatabase(); void ensureDatabaseCreated(String name); void ensureDatabaseDeleted(String name); void ensureTableCreated(String tableName); void ensureTableDeleted(String tableName); void ensureExistentTableRenamed(String existentTable, String toName); boolean tableExists(String table); long lookupConnection(String name); String submitNewJobWithRetry(TDJobRequest req); String submitNewJobWithRetry(Submitter submitter); TDJobOperator newJobOperator(String jobId); TDJobOperator runJob(TaskState state, String key, DurationInterval pollInterval, DurationInterval retryInterval, JobStarter starter); @Override void close();  }