@@ -339,13 +339,11 @@ public static APIBlock readFrom(StreamInput input) throws IOException {
339339 static final String KEY_ROLLOVER_INFOS = "rollover_info" ;
340340 static final String KEY_SYSTEM = "system" ;
341341 static final String KEY_TIMESTAMP_RANGE = "timestamp_range" ;
342- static final String KEY_DATASTREAM_INDEX = "datastream_index" ;
343342 public static final String KEY_PRIMARY_TERMS = "primary_terms" ;
344343
345344 public static final String INDEX_STATE_FILE_PREFIX = "state-" ;
346345
347346 static final Version SYSTEM_INDEX_FLAG_ADDED = Version .V_7_10_0 ;
348- static final Version DATASTREAM_INDEX_FLAG_ADDED = Version .CURRENT ; //TODO: correct to 7.15
349347
350348 private final int routingNumShards ;
351349 private final int routingFactor ;
@@ -389,7 +387,6 @@ public static APIBlock readFrom(StreamInput input) throws IOException {
389387 private final ActiveShardCount waitForActiveShards ;
390388 private final ImmutableOpenMap <String , RolloverInfo > rolloverInfos ;
391389 private final boolean isSystem ;
392- private final boolean isDataStreamIndex ;
393390
394391 private final IndexLongFieldRange timestampRange ;
395392
@@ -418,8 +415,7 @@ private IndexMetadata(
418415 final ActiveShardCount waitForActiveShards ,
419416 final ImmutableOpenMap <String , RolloverInfo > rolloverInfos ,
420417 final boolean isSystem ,
421- final IndexLongFieldRange timestampRange ,
422- final boolean isDataStreamIndex ) {
418+ final IndexLongFieldRange timestampRange ) {
423419
424420 this .index = index ;
425421 this .version = version ;
@@ -452,7 +448,6 @@ private IndexMetadata(
452448 this .rolloverInfos = rolloverInfos ;
453449 this .isSystem = isSystem ;
454450 this .timestampRange = timestampRange ;
455- this .isDataStreamIndex = isDataStreamIndex ;
456451 assert numberOfShards * routingFactor == routingNumShards : routingNumShards + " must be a multiple of " + numberOfShards ;
457452 }
458453
@@ -679,9 +674,6 @@ public boolean equals(Object o) {
679674 if (isSystem != that .isSystem ) {
680675 return false ;
681676 }
682- if (isDataStreamIndex != that .isDataStreamIndex ) {
683- return false ;
684- }
685677 return true ;
686678 }
687679
@@ -700,7 +692,6 @@ public int hashCode() {
700692 result = 31 * result + inSyncAllocationIds .hashCode ();
701693 result = 31 * result + rolloverInfos .hashCode ();
702694 result = 31 * result + Boolean .hashCode (isSystem );
703- result = 31 * result + Boolean .hashCode (isDataStreamIndex );
704695 return result ;
705696 }
706697
@@ -742,7 +733,6 @@ private static class IndexMetadataDiff implements Diff<IndexMetadata> {
742733 private final Diff <ImmutableOpenMap <String , RolloverInfo >> rolloverInfos ;
743734 private final boolean isSystem ;
744735 private final IndexLongFieldRange timestampRange ;
745- private final boolean isDataStreamIndex ;
746736
747737 IndexMetadataDiff (IndexMetadata before , IndexMetadata after ) {
748738 index = after .index .getName ();
@@ -761,7 +751,6 @@ private static class IndexMetadataDiff implements Diff<IndexMetadata> {
761751 DiffableUtils .getVIntKeySerializer (), DiffableUtils .StringSetValueSerializer .getInstance ());
762752 rolloverInfos = DiffableUtils .diff (before .rolloverInfos , after .rolloverInfos , DiffableUtils .getStringKeySerializer ());
763753 isSystem = after .isSystem ;
764- isDataStreamIndex = after .isDataStreamIndex ;
765754 timestampRange = after .timestampRange ;
766755 }
767756
@@ -801,11 +790,6 @@ private static class IndexMetadataDiff implements Diff<IndexMetadata> {
801790 isSystem = false ;
802791 }
803792 timestampRange = IndexLongFieldRange .readFrom (in );
804- if (in .getVersion ().onOrAfter (DATASTREAM_INDEX_FLAG_ADDED )) {
805- isDataStreamIndex = in .readBoolean ();
806- } else {
807- isDataStreamIndex = false ;
808- }
809793 }
810794
811795 @ Override
@@ -830,9 +814,6 @@ public void writeTo(StreamOutput out) throws IOException {
830814 out .writeBoolean (isSystem );
831815 }
832816 timestampRange .writeTo (out );
833- if (out .getVersion ().onOrAfter (DATASTREAM_INDEX_FLAG_ADDED )) {
834- out .writeBoolean (isDataStreamIndex );
835- }
836817 }
837818
838819 @ Override
@@ -852,7 +833,6 @@ public IndexMetadata apply(IndexMetadata part) {
852833 builder .inSyncAllocationIds .putAll (inSyncAllocationIds .apply (part .inSyncAllocationIds ));
853834 builder .rolloverInfos .putAll (rolloverInfos .apply (part .rolloverInfos ));
854835 builder .system (isSystem );
855- builder .dataStreamIndex (isDataStreamIndex );
856836 builder .timestampRange (timestampRange );
857837 return builder .build ();
858838 }
@@ -900,9 +880,6 @@ public static IndexMetadata readFrom(StreamInput in) throws IOException {
900880 builder .system (in .readBoolean ());
901881 }
902882 builder .timestampRange (IndexLongFieldRange .readFrom (in ));
903- if (in .getVersion ().onOrAfter (DATASTREAM_INDEX_FLAG_ADDED )) {
904- builder .dataStreamIndex (in .readBoolean ());
905- }
906883 return builder .build ();
907884 }
908885
@@ -945,19 +922,12 @@ public void writeTo(StreamOutput out) throws IOException {
945922 out .writeBoolean (isSystem );
946923 }
947924 timestampRange .writeTo (out );
948- if (out .getVersion ().onOrAfter (DATASTREAM_INDEX_FLAG_ADDED )) {
949- out .writeBoolean (isDataStreamIndex );
950- }
951925 }
952926
953927 public boolean isSystem () {
954928 return isSystem ;
955929 }
956930
957- public boolean isDataStreamIndex () {
958- return isDataStreamIndex ;
959- }
960-
961931 public static Builder builder (String index ) {
962932 return new Builder (index );
963933 }
@@ -984,7 +954,6 @@ public static class Builder {
984954 private Integer routingNumShards ;
985955 private boolean isSystem ;
986956 private IndexLongFieldRange timestampRange = IndexLongFieldRange .NO_SHARDS ;
987- private boolean isDataStreamIndex ;
988957
989958 public Builder (String index ) {
990959 this .index = index ;
@@ -994,7 +963,6 @@ public Builder(String index) {
994963 this .inSyncAllocationIds = ImmutableOpenIntMap .builder ();
995964 this .rolloverInfos = ImmutableOpenMap .builder ();
996965 this .isSystem = false ;
997- this .isDataStreamIndex = false ;
998966 }
999967
1000968 public Builder (IndexMetadata indexMetadata ) {
@@ -1014,7 +982,6 @@ public Builder(IndexMetadata indexMetadata) {
1014982 this .rolloverInfos = ImmutableOpenMap .builder (indexMetadata .rolloverInfos );
1015983 this .isSystem = indexMetadata .isSystem ;
1016984 this .timestampRange = indexMetadata .timestampRange ;
1017- this .isDataStreamIndex = indexMetadata .isDataStreamIndex ;
1018985 }
1019986
1020987 public Builder index (String index ) {
@@ -1236,16 +1203,6 @@ public IndexLongFieldRange getTimestampRange() {
12361203 return timestampRange ;
12371204 }
12381205
1239- // Sets if this index is a part of a datastream
1240- public Builder dataStreamIndex (boolean isDataStreamIndex ) {
1241- this .isDataStreamIndex = isDataStreamIndex ;
1242- return this ;
1243- }
1244-
1245- public boolean isDataStreamIndex () {
1246- return isDataStreamIndex ;
1247- }
1248-
12491206 public IndexMetadata build () {
12501207 ImmutableOpenMap .Builder <String , AliasMetadata > tmpAliases = aliases ;
12511208 Settings tmpSettings = settings ;
@@ -1350,8 +1307,7 @@ public IndexMetadata build() {
13501307 waitForActiveShards ,
13511308 rolloverInfos .build (),
13521309 isSystem ,
1353- timestampRange ,
1354- isDataStreamIndex );
1310+ timestampRange );
13551311 }
13561312
13571313 public static void toXContent (IndexMetadata indexMetadata , XContentBuilder builder , ToXContent .Params params ) throws IOException {
@@ -1452,10 +1408,11 @@ public static void toXContent(IndexMetadata indexMetadata, XContentBuilder build
14521408 }
14531409 builder .endObject ();
14541410 builder .field (KEY_SYSTEM , indexMetadata .isSystem );
1411+
14551412 builder .startObject (KEY_TIMESTAMP_RANGE );
14561413 indexMetadata .timestampRange .toXContent (builder , params );
14571414 builder .endObject ();
1458- builder . field ( KEY_DATASTREAM_INDEX , indexMetadata . isDataStreamIndex );
1415+
14591416 builder .endObject ();
14601417 }
14611418
@@ -1579,8 +1536,6 @@ public static IndexMetadata fromXContent(XContentParser parser) throws IOExcepti
15791536 builder .setRoutingNumShards (parser .intValue ());
15801537 } else if (KEY_SYSTEM .equals (currentFieldName )) {
15811538 builder .system (parser .booleanValue ());
1582- } else if (KEY_DATASTREAM_INDEX .equals (currentFieldName )) {
1583- builder .dataStreamIndex (parser .booleanValue ());
15841539 } else {
15851540 throw new IllegalArgumentException ("Unexpected field [" + currentFieldName + "]" );
15861541 }
0 commit comments