Skip to content

Commit

Permalink
Complete backport of #60522 (#61615)
Browse files Browse the repository at this point in the history
Adjusts versions for wire format and re-enables BWC tests
  • Loading branch information
DaveCTurner authored Aug 27, 2020
1 parent 648ac53 commit fee2d06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/61595" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = true
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
package org.elasticsearch.xpack.core.searchablesnapshots;

import org.elasticsearch.Version;
import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -180,21 +179,12 @@ public CacheIndexInputStats(String fileName, long fileLength, long openCount, lo
this.contiguousReads = new Counter(in);
this.nonContiguousReads = new Counter(in);
this.cachedBytesRead = new Counter(in);
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
this.indexCacheBytesRead = new Counter(in);
} else {
this.indexCacheBytesRead = new Counter(0, 0, 0, 0);
}
this.indexCacheBytesRead = new Counter(in);
this.cachedBytesWritten = new TimedCounter(in);
this.directBytesRead = new TimedCounter(in);
this.optimizedBytesRead = new TimedCounter(in);
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
this.blobStoreBytesRequested = new Counter(in);
this.currentIndexCacheFills = in.readVLong();
} else {
this.blobStoreBytesRequested = new Counter(0, 0, 0, 0);
this.currentIndexCacheFills = 0;
}
this.blobStoreBytesRequested = new Counter(in);
this.currentIndexCacheFills = in.readVLong();
}

@Override
Expand All @@ -211,16 +201,12 @@ public void writeTo(StreamOutput out) throws IOException {
contiguousReads.writeTo(out);
nonContiguousReads.writeTo(out);
cachedBytesRead.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
indexCacheBytesRead.writeTo(out);
}
indexCacheBytesRead.writeTo(out);
cachedBytesWritten.writeTo(out);
directBytesRead.writeTo(out);
optimizedBytesRead.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
blobStoreBytesRequested.writeTo(out);
out.writeVLong(currentIndexCacheFills);
}
blobStoreBytesRequested.writeTo(out);
out.writeVLong(currentIndexCacheFills);
}

public String getFileName() {
Expand Down

0 comments on commit fee2d06

Please sign in to comment.