|
@@ -115,7 +115,6 @@ public class TransportDownsampleAction extends AcknowledgedTransportMasterNodeAc
|
|
|
private final IndexScopedSettings indexScopedSettings;
|
|
|
private final ThreadContext threadContext;
|
|
|
private final PersistentTasksService persistentTasksService;
|
|
|
- private String downsamplingInterval;
|
|
|
|
|
|
private static final Set<String> FORBIDDEN_SETTINGS = Set.of(
|
|
|
IndexSettings.DEFAULT_PIPELINE.getKey(),
|
|
@@ -184,7 +183,6 @@ public class TransportDownsampleAction extends AcknowledgedTransportMasterNodeAc
|
|
|
ActionListener<AcknowledgedResponse> listener
|
|
|
) {
|
|
|
String sourceIndexName = request.getSourceIndex();
|
|
|
- downsamplingInterval = request.getDownsampleConfig().getInterval().toString();
|
|
|
|
|
|
final IndicesAccessControl indicesAccessControl = threadContext.getTransient(AuthorizationServiceField.INDICES_PERMISSIONS_KEY);
|
|
|
if (indicesAccessControl != null) {
|
|
@@ -775,12 +773,14 @@ public class TransportDownsampleAction extends AcknowledgedTransportMasterNodeAc
|
|
|
* case downsample will fail.
|
|
|
*/
|
|
|
int numberOfReplicas = settings.getAsInt(Downsample.DOWNSAMPLE_MIN_NUMBER_OF_REPLICAS_NAME, 0);
|
|
|
+ var downsampleInterval = request.getDownsampleConfig().getInterval().toString();
|
|
|
Settings.Builder builder = Settings.builder()
|
|
|
.put(IndexMetadata.SETTING_INDEX_HIDDEN, true)
|
|
|
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, sourceIndexMetadata.getNumberOfShards())
|
|
|
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, String.valueOf(numberOfReplicas))
|
|
|
.put(IndexSettings.INDEX_REFRESH_INTERVAL_SETTING.getKey(), "-1")
|
|
|
- .put(IndexMetadata.INDEX_DOWNSAMPLE_STATUS.getKey(), DownsampleTaskStatus.STARTED);
|
|
|
+ .put(IndexMetadata.INDEX_DOWNSAMPLE_STATUS.getKey(), DownsampleTaskStatus.STARTED)
|
|
|
+ .put(IndexMetadata.INDEX_DOWNSAMPLE_INTERVAL.getKey(), downsampleInterval);
|
|
|
if (sourceIndexMetadata.getSettings().hasValue(MapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING.getKey())) {
|
|
|
builder.put(
|
|
|
MapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING.getKey(),
|
|
@@ -910,7 +910,6 @@ public class TransportDownsampleAction extends AcknowledgedTransportMasterNodeAc
|
|
|
Settings.builder()
|
|
|
.put(downsampleIndex.getSettings())
|
|
|
.put(IndexMetadata.INDEX_DOWNSAMPLE_STATUS.getKey(), DownsampleTaskStatus.SUCCESS)
|
|
|
- .put(IndexMetadata.INDEX_DOWNSAMPLE_INTERVAL.getKey(), downsamplingInterval)
|
|
|
.build(),
|
|
|
downsampleIndexName
|
|
|
);
|