SOLR-9310: The variable name is confusing. maxInHash is not a hash

This commit is contained in:
Noble Paul 2016-07-25 12:10:49 +05:30
parent 9b85f68278
commit 830228602d
1 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ public class IndexFingerprint {
private long maxVersionSpecified;
private long maxVersionEncountered;
private long maxInHash;
private long maxVersionsUsedInHash;
private long versionsHash;
private long numVersions;
private long numDocs;
@ -56,8 +56,8 @@ public class IndexFingerprint {
return maxVersionEncountered;
}
public long getMaxInHash() {
return maxInHash;
public long getMaxVersionsUsedInHash() {
return maxVersionsUsedInHash;
}
public long getVersionsHash() {
@ -113,7 +113,7 @@ public class IndexFingerprint {
long v = fv.longVal(doc);
f.maxVersionEncountered = Math.max(v, f.maxVersionEncountered);
if (v <= f.maxVersionSpecified) {
f.maxInHash = Math.max(v, f.maxInHash);
f.maxVersionsUsedInHash = Math.max(v, f.maxVersionsUsedInHash);
f.versionsHash += Hash.fmix64(v);
f.numVersions++;
}
@ -139,7 +139,7 @@ public class IndexFingerprint {
}
// Go by the highest version under the requested max.
cmp = Long.compare(f1.maxInHash, f2.maxInHash);
cmp = Long.compare(f1.maxVersionsUsedInHash, f2.maxVersionsUsedInHash);
if (cmp != 0) return cmp;
// go by who has the most documents in the index
@ -158,7 +158,7 @@ public class IndexFingerprint {
Map<String,Object> map = new LinkedHashMap<>();
map.put("maxVersionSpecified", maxVersionSpecified);
map.put("maxVersionEncountered", maxVersionEncountered);
map.put("maxInHash", maxInHash);
map.put("maxVersionsUsedInHash", maxVersionsUsedInHash);
map.put("versionsHash", versionsHash);
map.put("numVersions", numVersions);
map.put("numDocs", numDocs);
@ -186,7 +186,7 @@ public class IndexFingerprint {
IndexFingerprint f = new IndexFingerprint();
f.maxVersionSpecified = getLong(o, "maxVersionSpecified", Long.MAX_VALUE);
f.maxVersionEncountered = getLong(o, "maxVersionEncountered", -1);
f.maxInHash = getLong(o, "maxInHash", -1);
f.maxVersionsUsedInHash = getLong(o, "maxVersionsUsedInHash", -1);
f.versionsHash = getLong(o, "versionsHash", -1);
f.numVersions = getLong(o, "numVersions", -1);
f.numDocs = getLong(o, "numDocs", -1);