@@ -67,9 +67,8 @@ public abstract class MetaDataStateFormat<T> {
6767 public static final String STATE_FILE_EXTENSION = ".st" ;
6868
6969 private static final String STATE_FILE_CODEC = "state" ;
70- private static final int MIN_COMPATIBLE_STATE_FILE_VERSION = 0 ;
70+ private static final int MIN_COMPATIBLE_STATE_FILE_VERSION = 1 ;
7171 private static final int STATE_FILE_VERSION = 1 ;
72- private static final int STATE_FILE_VERSION_ES_2X_AND_BELOW = 0 ;
7372 private static final int BUFFER_SIZE = 4096 ;
7473 private final String prefix ;
7574 private final Pattern stateFilePattern ;
@@ -183,16 +182,11 @@ public final T read(NamedXContentRegistry namedXContentRegistry, Path file) thro
183182 try (IndexInput indexInput = dir .openInput (file .getFileName ().toString (), IOContext .DEFAULT )) {
184183 // We checksum the entire file before we even go and parse it. If it's corrupted we barf right here.
185184 CodecUtil .checksumEntireFile (indexInput );
186- final int fileVersion = CodecUtil .checkHeader (indexInput , STATE_FILE_CODEC , MIN_COMPATIBLE_STATE_FILE_VERSION ,
187- STATE_FILE_VERSION );
185+ CodecUtil .checkHeader (indexInput , STATE_FILE_CODEC , MIN_COMPATIBLE_STATE_FILE_VERSION , STATE_FILE_VERSION );
188186 final XContentType xContentType = XContentType .values ()[indexInput .readInt ()];
189187 if (xContentType != FORMAT ) {
190188 throw new IllegalStateException ("expected state in " + file + " to be " + FORMAT + " format but was " + xContentType );
191189 }
192- if (fileVersion == STATE_FILE_VERSION_ES_2X_AND_BELOW ) {
193- // format version 0, wrote a version that always came from the content state file and was never used
194- indexInput .readLong (); // version currently unused
195- }
196190 long filePointer = indexInput .getFilePointer ();
197191 long contentSize = indexInput .length () - CodecUtil .footerLength () - filePointer ;
198192 try (IndexInput slice = indexInput .slice ("state_xcontent" , filePointer , contentSize )) {
0 commit comments