Skip to content

Commit cdb302c

Browse files
csouliostalevy
andauthored
[RollupV2] Move rollup metadata to field mappings (#69921)
This PR moves field related rollup metadata from the index metadata to the field mapping metadata. - date_histogram fields is moved to the timestamp field (fields are fixed_interval or calendar_interval, time_zone) - histogram fields are moved to the numeric field on which the the histogram is computed (the field is named interval) Also, the index uuid has been added to the index rollup settings as index.rollup.source.uuid and index.rollup.source.name The rest of the RollupMetadata has been removed and no rollup metadata exists in the global cluster state. Co-authored-by: Tal Levy <[email protected]>
1 parent 699a9c7 commit cdb302c

File tree

11 files changed

+297
-587
lines changed

11 files changed

+297
-587
lines changed

server/src/main/java/org/elasticsearch/cluster/ClusterModule.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.elasticsearch.cluster.metadata.MetadataMappingService;
2424
import org.elasticsearch.cluster.metadata.MetadataUpdateSettingsService;
2525
import org.elasticsearch.cluster.metadata.RepositoriesMetadata;
26-
import org.elasticsearch.cluster.metadata.RollupMetadata;
2726
import org.elasticsearch.cluster.routing.DelayedAllocationService;
2827
import org.elasticsearch.cluster.routing.allocation.AllocationService;
2928
import org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator;
@@ -65,7 +64,6 @@
6564
import org.elasticsearch.persistent.PersistentTasksCustomMetadata;
6665
import org.elasticsearch.persistent.PersistentTasksNodeService;
6766
import org.elasticsearch.plugins.ClusterPlugin;
68-
import org.elasticsearch.rollup.RollupV2;
6967
import org.elasticsearch.script.ScriptMetadata;
7068
import org.elasticsearch.snapshots.SnapshotsInfoService;
7169
import org.elasticsearch.tasks.Task;
@@ -135,9 +133,6 @@ public static List<Entry> getNamedWriteables() {
135133
ComposableIndexTemplateMetadata::readDiffFrom);
136134
registerMetadataCustom(entries, DataStreamMetadata.TYPE, DataStreamMetadata::new, DataStreamMetadata::readDiffFrom);
137135

138-
if (RollupV2.isEnabled()) {
139-
registerMetadataCustom(entries, RollupMetadata.TYPE, RollupMetadata::new, RollupMetadata::readDiffFrom);
140-
}
141136
// Task Status (not Diffable)
142137
entries.add(new Entry(Task.Status.class, PersistentTasksNodeService.Status.NAME, PersistentTasksNodeService.Status::new));
143138
return entries;
@@ -162,10 +157,6 @@ public static List<NamedXContentRegistry.Entry> getNamedXWriteables() {
162157
ComposableIndexTemplateMetadata::fromXContent));
163158
entries.add(new NamedXContentRegistry.Entry(Metadata.Custom.class, new ParseField(DataStreamMetadata.TYPE),
164159
DataStreamMetadata::fromXContent));
165-
if (RollupV2.isEnabled()) {
166-
entries.add(new NamedXContentRegistry.Entry(Metadata.Custom.class, new ParseField(RollupMetadata.TYPE),
167-
RollupMetadata::fromXContent));
168-
}
169160
return entries;
170161
}
171162

server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,13 @@ public Index getResizeSourceIndex() {
570570
INDEX_RESIZE_SOURCE_UUID.get(settings)) : null;
571571
}
572572

573+
public static final String INDEX_ROLLUP_SOURCE_UUID_KEY = "index.rollup.source.uuid";
574+
public static final String INDEX_ROLLUP_SOURCE_NAME_KEY = "index.rollup.source.name";
575+
public static final Setting<String> INDEX_ROLLUP_SOURCE_UUID = Setting.simpleString(INDEX_ROLLUP_SOURCE_UUID_KEY,
576+
Property.IndexScope, Property.PrivateIndex);
577+
public static final Setting<String> INDEX_ROLLUP_SOURCE_NAME = Setting.simpleString(INDEX_ROLLUP_SOURCE_NAME_KEY,
578+
Property.IndexScope, Property.PrivateIndex);
579+
573580
ImmutableOpenMap<String, DiffableStringMap> getCustomData() {
574581
return this.customData;
575582
}

server/src/main/java/org/elasticsearch/cluster/metadata/RollupGroup.java

Lines changed: 0 additions & 178 deletions
This file was deleted.

0 commit comments

Comments
 (0)