@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UpdateSettingsRequest that = (UpdateSettingsRequest) o; return masterNodeTimeout.equals(that.masterNodeTimeout) && timeout.equals(that.timeout) && Objects.equals(settings, that.settings) && Objects.equals(indicesOptions, that.indicesOptions) && Objects.equals(preserveExisting, that.preserveExisting) && Arrays.equals(indices, that.indices); }
if (refreshTask.getInterval().equals(indexSettings.getRefreshInterval()) == false) { rescheduleRefreshTasks();
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UpdateSettingsRequest that = (UpdateSettingsRequest) o; return masterNodeTimeout.equals(that.masterNodeTimeout) && timeout.equals(that.timeout) && Objects.equals(settings, that.settings) && Objects.equals(indicesOptions, that.indicesOptions) && Objects.equals(preserveExisting, that.preserveExisting) && Arrays.equals(indices, that.indices); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UpdateSettingsRequest that = (UpdateSettingsRequest) o; return masterNodeTimeout.equals(that.masterNodeTimeout) && timeout.equals(that.timeout) && Objects.equals(settings, that.settings) && Objects.equals(indicesOptions, that.indicesOptions) && Objects.equals(preserveExisting, that.preserveExisting) && Arrays.equals(indices, that.indices); }
if (timeout != null && !timeout.equals(TimeValue.MINUS_ONE)) { builder.field(TIMEOUT_FIELD.getPreferredName(), timeout.getStringRep());
searchContext.timeout().equals(SearchService.NO_TIMEOUT) == false;
private TimeValue maybeUpdate(final TimeValue currentValue, final Settings settings, final String key) { final TimeValue value = settings.getAsTime(key, currentValue); if (value.equals(currentValue)) { return currentValue; } logger.info("updating [] from [{}] to [{}]", key, currentValue, value); return value; } }
@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; } } }
@Override public void onRefreshSettings(Settings settings) { TimeValue current = MappingUpdatedAction.this.dynamicMappingUpdateTimeout; TimeValue newValue = settings.getAsTime(INDICES_MAPPING_DYNAMIC_TIMEOUT, current); if (!current.equals(newValue)) { logger.info("updating " + INDICES_MAPPING_DYNAMIC_TIMEOUT + " from [{}] to [{}]", current, newValue); MappingUpdatedAction.this.dynamicMappingUpdateTimeout = newValue; } } }
@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); } } }
@Override public synchronized void updateMetaData(final IndexMetaData metadata) { final Translog.Durability oldTranslogDurability = indexSettings.getTranslogDurability(); if (indexSettings.updateIndexMetaData(metadata)) { for (final IndexShard shard : this.shards.values()) { try { shard.onSettingsChanged(); } catch (Exception e) { logger.warn( () -> new ParameterizedMessage( "[{}] failed to notify shard about setting change", shard.shardId().id()), e); } } if (refreshTask.getInterval().equals(indexSettings.getRefreshInterval()) == false) { rescheduleRefreshTasks(); } final Translog.Durability durability = indexSettings.getTranslogDurability(); if (durability != oldTranslogDurability) { rescheduleFsyncTask(durability); } } }
@Override public void onRefreshSettings(Settings settings) { int flushThresholdOperations = settings.getAsInt(INDEX_TRANSLOG_FLUSH_THRESHOLD_OPS, TranslogService.this.flushThresholdOperations); if (flushThresholdOperations != TranslogService.this.flushThresholdOperations) { logger.info("updating flush_threshold_ops from [{}] to [{}]", TranslogService.this.flushThresholdOperations, flushThresholdOperations); TranslogService.this.flushThresholdOperations = flushThresholdOperations; } ByteSizeValue flushThresholdSize = settings.getAsBytesSize(INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE, TranslogService.this.flushThresholdSize); if (!flushThresholdSize.equals(TranslogService.this.flushThresholdSize)) { logger.info("updating flush_threshold_size from [{}] to [{}]", TranslogService.this.flushThresholdSize, flushThresholdSize); TranslogService.this.flushThresholdSize = flushThresholdSize; } TimeValue flushThresholdPeriod = settings.getAsTime(INDEX_TRANSLOG_FLUSH_THRESHOLD_PERIOD, TranslogService.this.flushThresholdPeriod); if (!flushThresholdPeriod.equals(TranslogService.this.flushThresholdPeriod)) { logger.info("updating flush_threshold_period from [{}] to [{}]", TranslogService.this.flushThresholdPeriod, flushThresholdPeriod); TranslogService.this.flushThresholdPeriod = flushThresholdPeriod; } TimeValue interval = settings.getAsTime(INDEX_TRANSLOG_FLUSH_INTERVAL, TranslogService.this.interval); if (!interval.equals(TranslogService.this.interval)) { logger.info("updating interval from [{}] to [{}]", TranslogService.this.interval, interval); TranslogService.this.interval = interval; } boolean disableFlush = settings.getAsBoolean(INDEX_TRANSLOG_DISABLE_FLUSH, TranslogService.this.disableFlush); if (disableFlush != TranslogService.this.disableFlush) { logger.info("updating disable_flush from [{}] to [{}]", TranslogService.this.disableFlush, disableFlush); TranslogService.this.disableFlush = disableFlush; } } }
@Override public synchronized void updateMetaData(final IndexMetaData metadata) { final Translog.Durability oldTranslogDurability = indexSettings.getTranslogDurability(); if (indexSettings.updateIndexMetaData(metadata)) { for (final IndexShard shard : this.shards.values()) { try { shard.onSettingsChanged(); } catch (Exception e) { logger.warn( (Supplier<?>) () -> new ParameterizedMessage( "[{}] failed to notify shard about setting change", shard.shardId().id()), e); } } if (refreshTask.getInterval().equals(indexSettings.getRefreshInterval()) == false) { rescheduleRefreshTasks(); } final Translog.Durability durability = indexSettings.getTranslogDurability(); if (durability != oldTranslogDurability) { rescheduleFsyncTask(durability); } } // update primary terms for (final IndexShard shard : this.shards.values()) { shard.updatePrimaryTerm(metadata.primaryTerm(shard.shardId().id())); } }
final ClientBootstrap clientBootstrap; final TimeValue defaultConnectTimeout = defaultConnectionProfile.getConnectTimeout(); if (profile.getConnectTimeout() != null && profile.getConnectTimeout().equals(defaultConnectTimeout) == false) { clientBootstrap = new ClientBootstrap(this.clientBootstrap.getFactory()); clientBootstrap.setPipelineFactory(this.clientBootstrap.getPipelineFactory());
if (refreshTask.getInterval().equals(indexSettings.getRefreshInterval()) == false) { rescheduleRefreshTasks();
if (timeout != null && !timeout.equals(TimeValue.MINUS_ONE)) { builder.field(TIMEOUT_FIELD.getPreferredName(), timeout.getStringRep());
if (timeout != null && !timeout.equals(TimeValue.MINUS_ONE)) { builder.field(TIMEOUT_FIELD.getPreferredName(), timeout.getStringRep());
if (timeout != null && !timeout.equals(TimeValue.MINUS_ONE)) { builder.field(TIMEOUT_FIELD.getPreferredName(), timeout.getStringRep());
searchContext.timeout().equals(SearchService.NO_TIMEOUT) == false;
if (!refreshInterval.equals(IndexShard.this.refreshInterval)) { logger.info("updating refresh_interval from [{}] to [{}]", IndexShard.this.refreshInterval, refreshInterval); if (refreshScheduledFuture != null) {