|
@@ -75,12 +75,6 @@ public class RecoverySettings extends AbstractComponent implements Closeable {
|
|
|
|
|
|
public static final long SMALL_FILE_CUTOFF_BYTES = ByteSizeValue.parseBytesSizeValue("5mb", "SMALL_FILE_CUTOFF_BYTES").bytes();
|
|
|
|
|
|
- /**
|
|
|
- * Use {@link #INDICES_RECOVERY_MAX_BYTES_PER_SEC} instead
|
|
|
- */
|
|
|
- @Deprecated
|
|
|
- public static final String INDICES_RECOVERY_MAX_SIZE_PER_SEC = "indices.recovery.max_size_per_sec";
|
|
|
-
|
|
|
private volatile ByteSizeValue fileChunkSize;
|
|
|
|
|
|
private volatile boolean compress;
|
|
@@ -105,9 +99,9 @@ public class RecoverySettings extends AbstractComponent implements Closeable {
|
|
|
public RecoverySettings(Settings settings, NodeSettingsService nodeSettingsService) {
|
|
|
super(settings);
|
|
|
|
|
|
- this.fileChunkSize = settings.getAsBytesSize(INDICES_RECOVERY_FILE_CHUNK_SIZE, settings.getAsBytesSize("index.shard.recovery.file_chunk_size", new ByteSizeValue(512, ByteSizeUnit.KB)));
|
|
|
- this.translogOps = settings.getAsInt(INDICES_RECOVERY_TRANSLOG_OPS, settings.getAsInt("index.shard.recovery.translog_ops", 1000));
|
|
|
- this.translogSize = settings.getAsBytesSize(INDICES_RECOVERY_TRANSLOG_SIZE, settings.getAsBytesSize("index.shard.recovery.translog_size", new ByteSizeValue(512, ByteSizeUnit.KB)));
|
|
|
+ this.fileChunkSize = settings.getAsBytesSize(INDICES_RECOVERY_FILE_CHUNK_SIZE, new ByteSizeValue(512, ByteSizeUnit.KB));
|
|
|
+ this.translogOps = settings.getAsInt(INDICES_RECOVERY_TRANSLOG_OPS, 1000);
|
|
|
+ this.translogSize = settings.getAsBytesSize(INDICES_RECOVERY_TRANSLOG_SIZE, new ByteSizeValue(512, ByteSizeUnit.KB));
|
|
|
this.compress = settings.getAsBoolean(INDICES_RECOVERY_COMPRESS, true);
|
|
|
|
|
|
this.retryDelayStateSync = settings.getAsTime(INDICES_RECOVERY_RETRY_DELAY_STATE_SYNC, TimeValue.timeValueMillis(500));
|
|
@@ -124,14 +118,14 @@ public class RecoverySettings extends AbstractComponent implements Closeable {
|
|
|
);
|
|
|
|
|
|
|
|
|
- this.concurrentStreams = settings.getAsInt("indices.recovery.concurrent_streams", settings.getAsInt("index.shard.recovery.concurrent_streams", 3));
|
|
|
+ this.concurrentStreams = settings.getAsInt(INDICES_RECOVERY_CONCURRENT_STREAMS, 3);
|
|
|
this.concurrentStreamPool = EsExecutors.newScaling("recovery_stream", 0, concurrentStreams, 60, TimeUnit.SECONDS,
|
|
|
EsExecutors.daemonThreadFactory(settings, "[recovery_stream]"));
|
|
|
- this.concurrentSmallFileStreams = settings.getAsInt("indices.recovery.concurrent_small_file_streams", settings.getAsInt("index.shard.recovery.concurrent_small_file_streams", 2));
|
|
|
+ this.concurrentSmallFileStreams = settings.getAsInt(INDICES_RECOVERY_CONCURRENT_SMALL_FILE_STREAMS, 2);
|
|
|
this.concurrentSmallFileStreamPool = EsExecutors.newScaling("small_file_recovery_stream", 0, concurrentSmallFileStreams, 60,
|
|
|
TimeUnit.SECONDS, EsExecutors.daemonThreadFactory(settings, "[small_file_recovery_stream]"));
|
|
|
|
|
|
- this.maxBytesPerSec = settings.getAsBytesSize("indices.recovery.max_bytes_per_sec", settings.getAsBytesSize("indices.recovery.max_size_per_sec", new ByteSizeValue(40, ByteSizeUnit.MB)));
|
|
|
+ this.maxBytesPerSec = settings.getAsBytesSize(INDICES_RECOVERY_MAX_BYTES_PER_SEC, new ByteSizeValue(40, ByteSizeUnit.MB));
|
|
|
if (maxBytesPerSec.bytes() <= 0) {
|
|
|
rateLimiter = null;
|
|
|
} else {
|
|
@@ -206,7 +200,7 @@ public class RecoverySettings extends AbstractComponent implements Closeable {
|
|
|
class ApplySettings implements NodeSettingsService.Listener {
|
|
|
@Override
|
|
|
public void onRefreshSettings(Settings settings) {
|
|
|
- ByteSizeValue maxSizePerSec = settings.getAsBytesSize(INDICES_RECOVERY_MAX_BYTES_PER_SEC, settings.getAsBytesSize(INDICES_RECOVERY_MAX_SIZE_PER_SEC, RecoverySettings.this.maxBytesPerSec));
|
|
|
+ ByteSizeValue maxSizePerSec = settings.getAsBytesSize(INDICES_RECOVERY_MAX_BYTES_PER_SEC, RecoverySettings.this.maxBytesPerSec);
|
|
|
if (!Objects.equals(maxSizePerSec, RecoverySettings.this.maxBytesPerSec)) {
|
|
|
logger.info("updating [{}] from [{}] to [{}]", INDICES_RECOVERY_MAX_BYTES_PER_SEC, RecoverySettings.this.maxBytesPerSec, maxSizePerSec);
|
|
|
RecoverySettings.this.maxBytesPerSec = maxSizePerSec;
|