public Optional<String> getStoragePort() { return this.conf.getProperty(STORAGE_PORT).isPresent() ? Optional.of(this.conf.getProperty(STORAGE_PORT).get()) : Optional.absent(); }
public Optional<String> getSSLStoragePort() { return this.conf.getProperty(SSL_STORAGE_PORT).isPresent() ? Optional.of(this.conf.getProperty(SSL_STORAGE_PORT).get()) : Optional.absent(); }
public Path getPath() { return new Path(this.conf.getProperty(PATH).get()); } public static List<String> getMandatoryProperties() {
public String getType() { return this.conf.getProperty(TYPE).get().toLowerCase(); }
public int getIntProperty(final String key, final int defaultValue) { final Optional<String> val = getProperty(key); return val.isPresent() ? Integer.parseInt(val.get()) : defaultValue; }
public double getDoubleProperty(final String key, final double defaultValue) { final Optional<String> val = getProperty(key); return val.isPresent() ? Double.parseDouble(val.get()) : defaultValue; }
public long getLongProperty(final String key, final long defaultValue) { final Optional<String> val = getProperty(key); return val.isPresent() ? Long.parseLong(val.get()) : defaultValue; }
public boolean getBooleanProperty(final String key, final boolean defaultValue) { final Optional<String> val = getProperty(key); return val.isPresent() ? Boolean.parseBoolean(val.get()) : defaultValue; }
public Optional<Long> getTimeToLive() { return this.conf.getProperty(TIME_TO_LIVE).isPresent() ? Optional.of(this.conf.getLongProperty(TIME_TO_LIVE, DEFAULT_TIME_TO_LIVE)) : Optional.absent(); }
public ForkOperator(@NonNull final JavaRDD<DI> inputRDD, @NonNull final ForkFunction<DI> forkFunction, @NonNull final Configuration conf) { this.inputRDD = inputRDD; this.forkFunction = forkFunction; this.persistLevel = StorageLevel .fromString(conf.getProperty(PERSIST_LEVEL, DEFAULT_PERSIST_LEVEL)); }
public KafkaSourceConfiguration(@NonNull final Configuration conf) { super(conf); this.topicName = getConf().getProperty(KAFKA_TOPIC_NAME).get(); this.clusterName = getConf().getProperty(KAFKA_CLUSTER_NAME).get(); this.startTime = DateTime.parse(getConf().getProperty(KAFKA_START_DATE).get(), DateTimeFormat.forPattern(KafkaSourceConfiguration.KAFKA_START_DATE_FORMAT).withZoneUTC() ).toDate().getTime(); }
public String getKeyspace() { return this.getConf().getProperty(KEYSPACE).get().trim(); }
public HiveSourceConfiguration(@NonNull final Configuration conf) { super(conf); this.saveCheckpoint = this.getConf().getBooleanProperty(SAVE_CHECKPOINT, true); this.startDate = getConf().getProperty(HIVE_START_DATE).isPresent() ? Optional.of(DateTime.parse(getConf().getProperty(HIVE_START_DATE).get(), DateTimeFormat.forPattern(HIVE_START_DATE_FORMAT).withZoneUTC()).toDate()) : Optional.absent(); }
/** * @return hoodie base path directory */ public String getBasePath() { // HOODIE_BASE_PATH is a mandatory property. Please check {#getMandatoryProperties()}. return this.getConf().getProperty(getTablePropertyKey(HOODIE_BASE_PATH, this.tableKey)).get(); }
/** * @return hoodie table name. */ public String getTableName() { return this.getConf().getProperty(getTablePropertyKey(HOODIE_TABLE_NAME, this.tableKey)).get(); }
/** * @return hoodie metrics prefix. * */ public String getHoodieMetricsPrefix() { return this.getConf().getProperty(getTablePropertyKey(HOODIE_METRICS_PREFIX, this.tableKey)).get(); }
public ZookeeperConfiguration(@NonNull final Configuration conf) { this.conf = conf; ConfigUtil.checkMandatoryProperties(this.getConf(), getMandatoryProperties()); this.zkQuorum = this.getConf().getProperty(ZK_QUORUM).get(); this.zkPort = this.getConf().getProperty(ZK_PORT).get(); }
public IRetryStrategy getRetryStrategy() { final String strategy = conf.getProperty(DEFAULT_STRATEGY, SIMPLE_RETRY_STRATEGY); switch (strategy) { case SIMPLE_RETRY_STRATEGY: return new SimpleRetryStrategy(new SimpleRetryStrategyConfiguration(conf)); default: throw new JobRuntimeException(String.format("Retry strategy %s is not supported.", strategy)); } } }
public ErrorTableConfiguration(@NonNull final Configuration conf) { this.conf = conf; this.isEnabled = conf.getBooleanProperty(IS_ENABLED, DEFAULT_IS_ENABLED); if (this.isEnabled()) { ConfigUtil.checkMandatoryProperties(this.conf, getMandatoryProperties()); this.destPath = new Path(conf.getProperty(DESTINATION_PATH).get()); } this.isDatePartitioned = conf.getBooleanProperty(IS_DATE_PARTITIONED, DEFAULT_IS_DATE_PARTITIONED); this.writeParallelism = conf.getIntProperty(WRITE_PARALLELISM, DEFAULT_WRITE_PARALLELISM); }
public LockManagerConfiguration(@NonNull final Configuration conf) { this.conf = conf; this.isEnabled = this.getConf().getBooleanProperty(IS_ENABLED, DEFAULT_IS_ENABLED); if (this.isEnabled()) { ConfigUtil.checkMandatoryProperties(conf, getMandatoryProperties()); this.zkBasePath = cleanZkBasePath(this.getConf().getProperty(ZK_BASE_PATH).get()); } else { this.zkBasePath = null; } this.zkSessionTimeoutMs = this.getConf().getIntProperty(ZK_SESSION_TIMEOUT_MS, DEFAULT_ZK_SESSION_TIMEOUT_MS); this.zkConnectionTimeoutMs = this.getConf().getIntProperty(ZK_CONNECTION_TIMEOUT_MS, DEFAULT_ZK_CONNECTION_TIMEOUT_MS); this.acquireLockTimeMs = this.getConf().getIntProperty(ACQUIRE_LOCK_TIME_MS, DEFAULT_ACQUIRE_LOCK_TIME_MS); }