mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Fix delete op serialization format constant
The delete op serizliation format constant for 5.x was off by one. This commit fixes this, and cleans up the handling of these formats.
This commit is contained in:
parent
4fba1c562f
commit
6deb5283db
@ -55,7 +55,6 @@ import java.nio.file.StandardCopyOption;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@ -826,10 +825,11 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
|
||||
|
||||
public static class Index implements Operation {
|
||||
|
||||
public static final int FORMAT_2x = 6; // since 2.0-beta1 and 1.1
|
||||
public static final int FORMAT_AUTO_GENERATED_IDS = 7; // since 5.0.0-beta1
|
||||
public static final int FORMAT_2_X = 6; // since 2.0-beta1 and 1.1
|
||||
public static final int FORMAT_AUTO_GENERATED_IDS = FORMAT_2_X + 1; // since 5.0.0-beta1
|
||||
public static final int FORMAT_SEQ_NO = FORMAT_AUTO_GENERATED_IDS + 1; // since 6.0.0
|
||||
public static final int SERIALIZATION_FORMAT = FORMAT_SEQ_NO;
|
||||
|
||||
private final String id;
|
||||
private final long autoGeneratedIdTimestamp;
|
||||
private final String type;
|
||||
@ -843,7 +843,7 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
|
||||
|
||||
public Index(StreamInput in) throws IOException {
|
||||
final int format = in.readVInt(); // SERIALIZATION_FORMAT
|
||||
assert format >= FORMAT_2x : "format was: " + format;
|
||||
assert format >= FORMAT_2_X : "format was: " + format;
|
||||
id = in.readString();
|
||||
type = in.readString();
|
||||
source = in.readBytesReference();
|
||||
@ -1018,7 +1018,7 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
|
||||
|
||||
public static class Delete implements Operation {
|
||||
|
||||
private static final int FORMAT_5_X = 3;
|
||||
private static final int FORMAT_5_X = 2;
|
||||
private static final int FORMAT_SEQ_NO = FORMAT_5_X + 1;
|
||||
public static final int SERIALIZATION_FORMAT = FORMAT_SEQ_NO;
|
||||
|
||||
@ -1030,7 +1030,7 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
|
||||
|
||||
public Delete(StreamInput in) throws IOException {
|
||||
final int format = in.readVInt();// SERIALIZATION_FORMAT
|
||||
assert format >= SERIALIZATION_FORMAT - 1: "format was: " + format;
|
||||
assert format >= FORMAT_5_X : "format was: " + format;
|
||||
uid = new Term(in.readString(), in.readString());
|
||||
this.version = in.readLong();
|
||||
this.versionType = VersionType.fromValue(in.readByte());
|
||||
|
Loading…
x
Reference in New Issue
Block a user