private static TimeValue getValidThreshold(Settings settings, String key, String level) { TimeValue threshold = settings.getAsTime(level, null); if (threshold == null) { throw new IllegalArgumentException("missing gc_threshold for [" + getThresholdName(key, level) + "]"); } if (threshold.nanos() <= 0) { throw new IllegalArgumentException("invalid gc_threshold [" + threshold + "] for [" + getThresholdName(key, level) + "]"); } return threshold; }
AsyncTrimTranslogTask(IndexService indexService) { super(indexService, indexService.getIndexSettings() .getSettings().getAsTime(INDEX_TRANSLOG_RETENTION_CHECK_INTERVAL_SETTING, TimeValue.timeValueMinutes(10))); }
this.nodeEnv = nodeEnv; this.xContentRegistry = xContentRegistry; this.shardsClosedTimeout = settings.getAsTime(INDICES_SHARDS_CLOSED_TIMEOUT, new TimeValue(1, TimeUnit.DAYS)); this.analysisRegistry = analysisRegistry; this.indexNameExpressionResolver = indexNameExpressionResolver;
@Override public void onRefreshSettings(Settings settings) { final TimeValue slowTaskLoggingThreshold = settings.getAsTime(SETTING_CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD, InternalClusterService.this.slowTaskLoggingThreshold); InternalClusterService.this.slowTaskLoggingThreshold = slowTaskLoggingThreshold; } }
/** * The allocation delay value in nano seconds associated with the index (defaulting to node settings if not set). */ public long getAllocationDelayTimeoutSettingNanos(Settings settings, Settings indexSettings) { if (reason != Reason.NODE_LEFT) { return 0; } TimeValue delayTimeout = indexSettings.getAsTime(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING, settings.getAsTime(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING, DEFAULT_DELAYED_NODE_LEFT_TIMEOUT)); return Math.max(0l, delayTimeout.nanos()); }
@Inject public StoreRecoveryService(ShardId shardId, IndexSettingsService indexSettingsService, ThreadPool threadPool, MappingUpdatedAction mappingUpdatedAction, ClusterService clusterService, RepositoriesService repositoriesService, RestoreService restoreService) { super(shardId, indexSettingsService.getSettings()); this.threadPool = threadPool; this.mappingUpdatedAction = mappingUpdatedAction; this.restoreService = restoreService; this.repositoriesService = repositoriesService; this.clusterService = clusterService; this.waitForMappingUpdatePostRecovery = indexSettings.getAsTime(SETTING_MAPPING_UPDATE_WAIT, indexSettings.getAsTime(SETTING_MAPPING_UPDATE_WAIT_LEGACY, TimeValue.timeValueSeconds(15))); }
private static TimeValue getValidThreshold(Settings settings, String key, String level) { TimeValue threshold = settings.getAsTime(level, null); if (threshold == null) { throw new IllegalArgumentException("missing gc_threshold for [" + getThresholdName(key, level) + "]"); } if (threshold.nanos() <= 0) { throw new IllegalArgumentException("invalid gc_threshold [" + threshold + "] for [" + getThresholdName(key, level) + "]"); } return threshold; }
private static TimeValue getValidThreshold(Settings settings, String key, String level) { TimeValue threshold = settings.getAsTime(level, null); if (threshold == null) { throw new IllegalArgumentException("missing gc_threshold for [" + getThresholdName(key, level) + "]"); } if (threshold.nanos() <= 0) { throw new IllegalArgumentException("invalid gc_threshold [" + threshold + "] for [" + getThresholdName(key, level) + "]"); } return threshold; }
@Inject public DiscoveryService(Settings settings, DiscoverySettings discoverySettings, Discovery discovery) { super(settings); this.discoverySettings = discoverySettings; this.discovery = discovery; this.initialStateTimeout = settings.getAsTime(SETTING_INITIAL_STATE_TIMEOUT, TimeValue.timeValueSeconds(30)); }
private static TimeValue getValidThreshold(Settings settings, String key, String level) { TimeValue threshold = settings.getAsTime(level, null); if (threshold == null) { throw new IllegalArgumentException("missing gc_threshold for [" + getThresholdName(key, level) + "]"); } if (threshold.nanos() <= 0) { throw new IllegalArgumentException("invalid gc_threshold [" + threshold + "] for [" + getThresholdName(key, level) + "]"); } return threshold; }
@Override public void onRefreshSettings(Settings settings) { final TimeValue maybeNewDefaultSearchTimeout = settings.getAsTime(SearchService.DEFAULT_SEARCH_TIMEOUT, SearchService.this.defaultSearchTimeout); if (!maybeNewDefaultSearchTimeout.equals(SearchService.this.defaultSearchTimeout)) { logger.info("updating [{}] from [{}] to [{}]", SearchService.DEFAULT_SEARCH_TIMEOUT, SearchService.this.defaultSearchTimeout, maybeNewDefaultSearchTimeout); SearchService.this.defaultSearchTimeout = maybeNewDefaultSearchTimeout; } } }
public ReloadableKeywordMarkerFilterFactory(final IndexSettings indexSettings, final Environment environment, final String name, final Settings settings) { super(indexSettings, name, settings); final String path = settings.get("keywords_path"); if (path != null) { keywordPath = environment.configFile().resolve(path); } else { keywordPath = null; } reloadInterval = settings.getAsTime("reload_interval", TimeValue.timeValueMinutes(1)).getMillis(); }
@Inject public SuggestService(Settings settings, TransportSuggestRefreshAction suggestRefreshAction, ClusterService clusterService, IndicesService indicesService) { super(settings); this.suggestRefreshAction = suggestRefreshAction; this.clusterService = clusterService; this.indicesService = indicesService; suggestRefreshDisabled = settings.getAsBoolean("suggest.refresh_disabled", false); suggestRefreshInterval = settings.getAsTime("suggest.refresh_interval", TimeValue.timeValueMinutes(10)); }
@Override public void onRefreshSettings(Settings settings) { final TimeValue currentInterval = IndicesTTLService.this.purgerThread.getInterval(); final TimeValue interval = settings.getAsTime(INDICES_TTL_INTERVAL, currentInterval); if (!interval.equals(currentInterval)) { logger.info("updating indices.ttl.interval from [{}] to [{}]",currentInterval, interval); IndicesTTLService.this.purgerThread.resetInterval(interval); } } }
@Inject public JvmService(Settings settings) { super(settings); this.jvmInfo = JvmInfo.jvmInfo(); this.jvmStats = JvmStats.jvmStats(); this.refreshInterval = this.settings.getAsTime("refresh_interval", TimeValue.timeValueSeconds(1)); logger.debug("Using refresh_interval [{}]", refreshInterval); }
@Inject public FsService(Settings settings, FsProbe probe) throws IOException { super(settings); this.probe = probe; TimeValue refreshInterval = settings.getAsTime("monitor.fs.refresh_interval", TimeValue.timeValueSeconds(1)); fsStatsCache = new FsInfoCache(refreshInterval, probe.stats()); logger.debug("Using probe [{}] with refresh_interval [{}]", probe, refreshInterval); }
@Inject public DiscoverySettings(Settings settings, NodeSettingsService nodeSettingsService) { super(settings); nodeSettingsService.addListener(new ApplySettings()); this.noMasterBlock = parseNoMasterBlock(settings.get(NO_MASTER_BLOCK, DEFAULT_NO_MASTER_BLOCK)); this.publishTimeout = settings.getAsTime(PUBLISH_TIMEOUT, publishTimeout); this.publishDiff = settings.getAsBoolean(PUBLISH_DIFF_ENABLE, DEFAULT_PUBLISH_DIFF_ENABLE); }
@Inject public ProcessService(Settings settings, ProcessProbe probe) { super(settings); this.probe = probe; final TimeValue refreshInterval = settings.getAsTime("monitor.process.refresh_interval", TimeValue.timeValueSeconds(1)); processStatsCache = new ProcessStatsCache(refreshInterval, probe.processStats()); this.info = probe.processInfo(); this.info.refreshInterval = refreshInterval.millis(); logger.debug("Using probe [{}] with refresh_interval [{}]", probe, refreshInterval); }
@Inject public IndicesTTLService(Settings settings, ClusterService clusterService, IndicesService indicesService, NodeSettingsService nodeSettingsService, TransportBulkAction bulkAction) { super(settings); this.clusterService = clusterService; this.indicesService = indicesService; TimeValue interval = this.settings.getAsTime("indices.ttl.interval", TimeValue.timeValueSeconds(60)); this.bulkAction = bulkAction; this.bulkSize = this.settings.getAsInt("indices.ttl.bulk_size", 10000); this.purgerThread = new PurgerThread(EsExecutors.threadName(settings, "[ttl_expire]"), interval); nodeSettingsService.addListener(new ApplySettings()); }
public Store(ShardId shardId, Settings indexSettings, DirectoryService directoryService, ShardLock shardLock, OnClose onClose) throws IOException { super(shardId, indexSettings); this.directory = new StoreDirectory(directoryService.newDirectory(), Loggers.getLogger("index.store.deletes", indexSettings, shardId)); this.shardLock = shardLock; this.onClose = onClose; final TimeValue refreshInterval = indexSettings.getAsTime(INDEX_STORE_STATS_REFRESH_INTERVAL, TimeValue.timeValueSeconds(10)); this.statsCache = new StoreStatsCache(refreshInterval, directory, directoryService); logger.debug("store stats are refreshed with refresh_interval [{}]", refreshInterval); assert onClose != null; assert shardLock != null; assert shardLock.getShardId().equals(shardId); }