azkaban.utils.Props.getLong()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(10.3k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中azkaban.utils.Props.getLong()方法的一些代码示例,展示了Props.getLong()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Props.getLong()方法的具体详情如下:
包路径:azkaban.utils.Props
类名称:Props
方法名:getLong

Props.getLong介绍

[英]Returns the long representation of the value. If the value is null, then a UndefinedPropertyException will be thrown. If the value isn't a long, then a parse exception will be thrown.
[中]返回值的长表示形式。如果该值为null,则会引发UndefinedPropertyException。如果该值不长,则会引发解析异常。

代码示例

代码示例来源:origin: azkaban/azkaban

public long getRetryBackoff() {
 return this.inputProps.getLong("retry.backoff", 0);
}

代码示例来源:origin: azkaban/azkaban

/**
 * @param azkProps Azkaban Properties
 */
public InMemoryMetricEmitter(final Props azkProps) {
 this.historyListMapping = new ConcurrentHashMap<>();
 this.timeWindow = azkProps.getLong(INMEMORY_METRIC_REPORTER_WINDOW, 60 * 60 * 24 * 7 * 1000);
 this.numInstances = azkProps.getLong(INMEMORY_METRIC_NUM_INSTANCES, 50);
 this.standardDeviationFactor = azkProps.getDouble(INMEMORY_METRIC_STANDARDDEVIATION_FACTOR, 2);
}

代码示例来源:origin: azkaban/azkaban

private CleanerThread createCleanerThread() {
 final long executionLogsRetentionMs = this.azkProps.getLong("execution.logs.retention.ms",
   DEFAULT_EXECUTION_LOGS_RETENTION_MS);
 return new CleanerThread(executionLogsRetentionMs);
}

代码示例来源:origin: azkaban/azkaban

/**
 * Constructor taking global props.
 */
@Inject
public SessionCache(final Props props) {
 this.effectiveSessionTimeToLive = props.getLong(ConfigurationKeys.SESSION_TIME_TO_LIVE,
   DEFAULT_SESSION_TIME_TO_LIVE);
 this.cache = CacheBuilder.newBuilder()
   .maximumSize(props.getInt("max.num.sessions", MAX_NUM_SESSIONS))
   .expireAfterAccess(effectiveSessionTimeToLive, TimeUnit.MILLISECONDS)
   .build();
}

代码示例来源:origin: azkaban/azkaban

@Inject
public ExecutorHealthChecker(final Props azkProps, final ExecutorLoader executorLoader,
  final ExecutorApiGateway apiGateway, final AlerterHolder alerterHolder) {
 this.healthCheckIntervalMin = azkProps
   .getLong(ConfigurationKeys.AZKABAN_EXECUTOR_HEALTHCHECK_INTERVAL_MIN,
     DEFAULT_EXECUTOR_HEALTHCHECK_INTERVAL.toMinutes());
 this.executorMaxFailureCount = azkProps.getInt(ConfigurationKeys
   .AZKABAN_EXECUTOR_MAX_FAILURE_COUNT, DEFAULT_EXECUTOR_MAX_FAILURE_COUNT);
 this.alertEmails = azkProps.getStringList(ConfigurationKeys.AZKABAN_ADMIN_ALERT_EMAIL);
 this.scheduler = Executors.newSingleThreadScheduledExecutor();
 this.executorLoader = executorLoader;
 this.apiGateway = apiGateway;
 this.alerterHolder = alerterHolder;
}

代码示例来源:origin: azkaban/azkaban

private QueueProcessorThread setupQueueProcessor() {
 return new QueueProcessorThread(
   this.azkProps.getBoolean(Constants.ConfigurationKeys.QUEUEPROCESSING_ENABLED, true),
   this.azkProps.getLong(Constants.ConfigurationKeys.ACTIVE_EXECUTOR_REFRESH_IN_MS, 50000),
   this.azkProps.getInt(
     Constants.ConfigurationKeys.ACTIVE_EXECUTOR_REFRESH_IN_NUM_FLOW, 5),
   this.azkProps.getInt(
     Constants.ConfigurationKeys.MAX_DISPATCHING_ERRORS_PERMITTED,
     this.activeExecutors.getAll().size()),
   this.sleepAfterDispatchFailure);
}

代码示例来源:origin: azkaban/azkaban

@Inject
public TriggerManager(final Props props, final TriggerLoader triggerLoader,
  final ExecutorManagerAdapter executorManagerAdapter) throws TriggerManagerException {
 requireNonNull(props);
 requireNonNull(executorManagerAdapter);
 this.triggerLoader = requireNonNull(triggerLoader);
 final long scannerInterval =
   props.getLong("trigger.scan.interval", DEFAULT_SCANNER_INTERVAL_MS);
 this.runnerThread = new TriggerScannerThread(scannerInterval);
 this.checkerTypeLoader = new CheckerTypeLoader();
 this.actionTypeLoader = new ActionTypeLoader();
 try {
  this.checkerTypeLoader.init(props);
  this.actionTypeLoader.init(props);
 } catch (final Exception e) {
  throw new TriggerManagerException(e);
 }
 Condition.setCheckerLoader(this.checkerTypeLoader);
 Trigger.setActionTypeLoader(this.actionTypeLoader);
 logger.info("TriggerManager loaded.");
}

代码示例来源:origin: azkaban/azkaban

void initialize() throws ExecutorManagerException {
 if (this.initialized) {
  return;
 }
 this.initialized = true;
 this.setupExecutors();
 this.loadRunningExecutions();
 this.queuedFlows = new QueuedExecutions(
   this.azkProps.getLong(ConfigurationKeys.WEBSERVER_QUEUE_SIZE, 100000));
 this.loadQueuedFlows();
 this.cacheDir = new File(this.azkProps.getString("cache.directory", "cache"));
 // TODO extract QueueProcessor as a separate class, move all of this into it
 setupExecutotrComparatorWeightsMap();
 setupExecutorFilterList();
 this.queueProcessor = setupQueueProcessor();
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

public long getRetryBackoff() {
    return inputProps.getLong("retry.backoff", 0);
  }
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

public long getRetryBackoff() {
 return this.inputProps.getLong("retry.backoff", 0);
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

/**
 * @param azkProps Azkaban Properties
 */
public InMemoryMetricEmitter(final Props azkProps) {
 this.historyListMapping = new ConcurrentHashMap<>();
 this.timeWindow = azkProps.getLong(INMEMORY_METRIC_REPORTER_WINDOW, 60 * 60 * 24 * 7 * 1000);
 this.numInstances = azkProps.getLong(INMEMORY_METRIC_NUM_INSTANCES, 50);
 this.standardDeviationFactor = azkProps.getDouble(INMEMORY_METRIC_STANDARDDEVIATION_FACTOR, 2);
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

/**
 * Constructor taking global props.
 */
@Inject
public SessionCache(final Props props) {
 this.effectiveSessionTimeToLive = props.getLong(ConfigurationKeys.SESSION_TIME_TO_LIVE,
   DEFAULT_SESSION_TIME_TO_LIVE);
 this.cache = CacheBuilder.newBuilder()
   .maximumSize(props.getInt("max.num.sessions", MAX_NUM_SESSIONS))
   .expireAfterAccess(effectiveSessionTimeToLive, TimeUnit.MILLISECONDS)
   .build();
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

new QueueProcessorThread(
  this.azkProps.getBoolean(Constants.ConfigurationKeys.QUEUEPROCESSING_ENABLED, true),
  this.azkProps.getLong(Constants.ConfigurationKeys.ACTIVE_EXECUTOR_REFRESH_IN_MS, 50000),
  this.azkProps.getInt(
    Constants.ConfigurationKeys.ACTIVE_EXECUTOR_REFRESH_IN_NUM_FLOW, 5),

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

@Inject
public TriggerManager(final Props props, final TriggerLoader triggerLoader,
  final ExecutorManager executorManager) throws TriggerManagerException {
 requireNonNull(props);
 requireNonNull(executorManager);
 this.triggerLoader = requireNonNull(triggerLoader);
 final long scannerInterval =
   props.getLong("trigger.scan.interval", DEFAULT_SCANNER_INTERVAL_MS);
 this.runnerThread = new TriggerScannerThread(scannerInterval);
 this.checkerTypeLoader = new CheckerTypeLoader();
 this.actionTypeLoader = new ActionTypeLoader();
 try {
  this.checkerTypeLoader.init(props);
  this.actionTypeLoader.init(props);
 } catch (final Exception e) {
  throw new TriggerManagerException(e);
 }
 Condition.setCheckerLoader(this.checkerTypeLoader);
 Trigger.setActionTypeLoader(this.actionTypeLoader);
 logger.info("TriggerManager loaded.");
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

String projectName = schedProps.getString("projectName");
int projectId = schedProps.getInt("projectId");
long firstSchedTimeLong = schedProps.getLong("firstScheduleTimeLong");
ReadablePeriod period = Utils.parsePeriodString(schedProps.getString("period"));
long nextExecTimeLong = schedProps.getLong("nextExecTimeLong");
long submitTimeLong = schedProps.getLong("submitTimeLong");

代码示例来源:origin: com.linkedin.azkaban/azkaban

executionDirRetention = props.getLong("execution.dir.retention", executionDirRetention);
logger.info("Execution dir retention set to " + executionDirRetention + " ms");

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

@Inject
public ExecutorManager(final Props azkProps, final ExecutorLoader loader,
  final AlerterHolder alerterHolder,
  final CommonMetrics commonMetrics,
  final ExecutorApiGateway apiGateway) throws ExecutorManagerException {
 this.alerterHolder = alerterHolder;
 this.azkProps = azkProps;
 this.commonMetrics = commonMetrics;
 this.executorLoader = loader;
 this.apiGateway = apiGateway;
 this.setupExecutors();
 this.loadRunningFlows();
 this.queuedFlows = new QueuedExecutions(
   azkProps.getLong(Constants.ConfigurationKeys.WEBSERVER_QUEUE_SIZE, 100000));
 // The default threshold is set to 30 for now, in case some users are affected. We may
 // decrease this number in future, to better prevent DDos attacks.
 this.maxConcurrentRunsOneFlow = azkProps
   .getInt(Constants.ConfigurationKeys.MAX_CONCURRENT_RUNS_ONEFLOW,
     DEFAULT_MAX_ONCURRENT_RUNS_ONEFLOW);
 this.loadQueuedFlows();
 this.cacheDir = new File(azkProps.getString("cache.directory", "cache"));
 this.executingManager = new ExecutingManagerUpdaterThread();
 if (isMultiExecutorMode()) {
  setupMultiExecutorMode();
 }
 final long executionLogsRetentionMs =
   azkProps.getLong("execution.logs.retention.ms",
     DEFAULT_EXECUTION_LOGS_RETENTION_MS);
 this.cleanerThread = new CleanerThread(executionLogsRetentionMs);
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

public ExecutorManager(Props props, ExecutorLoader loader, Map<String, Alerter> alters) throws ExecutorManagerException {
  this.executorLoader = loader;
  this.loadRunningFlows();
  executorHost = props.getString("executor.host", "localhost");
  executorPort = props.getInt("executor.port");
  
  alerters = alters;
  
  cacheDir = new File(props.getString("cache.directory", "cache"));
  executingManager = new ExecutingManagerUpdaterThread();
  executingManager.start();
  
  long executionLogsRetentionMs = props.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS);
  cleanerThread = new CleanerThread(executionLogsRetentionMs);
  cleanerThread.start();
  
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

/**
 * Constructor taking global props.
 * 
 * @param props
 */
public SessionCache(Props props) {
  CacheManager manager = CacheManager.getInstance();
  
  cache = manager.createCache();
  cache.setEjectionPolicy(EjectionPolicy.LRU);
  cache.setMaxCacheSize(props.getInt("max.num.sessions", MAX_NUM_SESSIONS));
  cache.setExpiryTimeToLiveMs(props.getLong("session.time.to.live", SESSION_TIME_TO_LIVE));
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

public TriggerManager(Props props, TriggerLoader triggerLoader, ExecutorManager executorManager) throws TriggerManagerException {
  this.triggerLoader = triggerLoader;
  
  long scannerInterval = props.getLong("trigger.scan.interval", DEFAULT_SCANNER_INTERVAL_MS);
  runnerThread = new TriggerScannerThread(scannerInterval);
  checkerTypeLoader = new CheckerTypeLoader();
  actionTypeLoader = new ActionTypeLoader();
  try {
    checkerTypeLoader.init(props);
    actionTypeLoader.init(props);
  } catch (Exception e) {
    throw new TriggerManagerException(e);
  }
  
  Condition.setCheckerLoader(checkerTypeLoader);
  Trigger.setActionTypeLoader(actionTypeLoader);
  
  executorManager.addListener(listener);
  
  logger.info("TriggerManager loaded.");
}

相关文章