Translog: remove unneeded Versions.readVersion & Versions.writeVersion

These calls were introduced in pr #6149 as a backward compatibility layer for the previous value of `Versions.MATCH_ANY`. This is not needed as the translog never contains these values. On top of that, the calls are not effective as the stream the translog used is effectively not versioned (versioining is done on an item by item basis)
This commit is contained in:
Boaz Leskes 2014-05-18 09:22:51 +02:00
parent 682acfcacd
commit 1e5138889e
1 changed files with 6 additions and 6 deletions

View File

@ -351,7 +351,7 @@ public interface Translog extends IndexShardComponent, CloseableIndexComponent {
}
}
if (version >= 3) {
this.version = Versions.readVersion(in);
this.version = in.readLong();
}
if (version >= 4) {
this.timestamp = in.readLong();
@ -384,7 +384,7 @@ public interface Translog extends IndexShardComponent, CloseableIndexComponent {
out.writeBoolean(true);
out.writeString(parent);
}
Versions.writeVersion(version, out);
out.writeLong(version);
out.writeLong(timestamp);
out.writeLong(ttl);
out.writeByte(versionType.getValue());
@ -494,7 +494,7 @@ public interface Translog extends IndexShardComponent, CloseableIndexComponent {
}
}
if (version >= 3) {
this.version = Versions.readVersion(in);
this.version = in.readLong();
}
if (version >= 4) {
this.timestamp = in.readLong();
@ -527,7 +527,7 @@ public interface Translog extends IndexShardComponent, CloseableIndexComponent {
out.writeBoolean(true);
out.writeString(parent);
}
Versions.writeVersion(version, out);
out.writeLong(version);
out.writeLong(timestamp);
out.writeLong(ttl);
out.writeByte(versionType.getValue());
@ -586,7 +586,7 @@ public interface Translog extends IndexShardComponent, CloseableIndexComponent {
int version = in.readVInt(); // version
uid = new Term(in.readString(), in.readString());
if (version >= 1) {
this.version = Versions.readVersion(in);
this.version = in.readLong();
}
if (version >= 2) {
this.versionType = VersionType.fromValue(in.readByte());
@ -600,7 +600,7 @@ public interface Translog extends IndexShardComponent, CloseableIndexComponent {
out.writeVInt(SERIALIZATION_FORMAT);
out.writeString(uid.field());
out.writeString(uid.text());
Versions.writeVersion(version, out);
out.writeLong(version);
out.writeByte(versionType.getValue());
}
}