Return 0 instead of -1 for unknown/non-exposed ramBytesUsed()
The accountable interface specifies that such values are illegal Fixes #8239
This commit is contained in:
parent
8aff3b6273
commit
a6d7742cb5
|
@ -63,7 +63,7 @@ public class BinaryDVAtomicFieldData implements AtomicFieldData {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long ramBytesUsed() {
|
public long ramBytesUsed() {
|
||||||
return -1; // unknown
|
return 0; // unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class BinaryDVNumericIndexFieldData extends DocValuesIndexFieldData imple
|
||||||
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return new AtomicLongFieldData(-1) {
|
return new AtomicLongFieldData(0) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortedNumericDocValues getLongValues() {
|
public SortedNumericDocValues getLongValues() {
|
||||||
|
|
|
@ -42,7 +42,7 @@ final class BytesBinaryDVAtomicFieldData implements AtomicFieldData {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long ramBytesUsed() {
|
public long ramBytesUsed() {
|
||||||
return -1; // not exposed by Lucene
|
return 0; // not exposed by Lucene
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -43,7 +43,7 @@ final class GeoPointBinaryDVAtomicFieldData extends AbstractAtomicGeoPointFieldD
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long ramBytesUsed() {
|
public long ramBytesUsed() {
|
||||||
return -1; // not exposed by Lucene
|
return 0; // not exposed by Lucene
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class NumericDVIndexFieldData extends DocValuesIndexFieldData implements
|
||||||
public AtomicLongFieldData load(AtomicReaderContext context) {
|
public AtomicLongFieldData load(AtomicReaderContext context) {
|
||||||
final AtomicReader reader = context.reader();
|
final AtomicReader reader = context.reader();
|
||||||
final String field = fieldNames.indexName();
|
final String field = fieldNames.indexName();
|
||||||
return new AtomicLongFieldData(-1) {
|
return new AtomicLongFieldData(0) {
|
||||||
@Override
|
@Override
|
||||||
public SortedNumericDocValues getLongValues() {
|
public SortedNumericDocValues getLongValues() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class SortedNumericDVIndexFieldData extends DocValuesIndexFieldData imple
|
||||||
final String field;
|
final String field;
|
||||||
|
|
||||||
SortedNumericLongFieldData(AtomicReader reader, String field) {
|
SortedNumericLongFieldData(AtomicReader reader, String field) {
|
||||||
super(-1L);
|
super(0L);
|
||||||
this.reader = reader;
|
this.reader = reader;
|
||||||
this.field = field;
|
this.field = field;
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ public class SortedNumericDVIndexFieldData extends DocValuesIndexFieldData imple
|
||||||
final String field;
|
final String field;
|
||||||
|
|
||||||
SortedNumericFloatFieldData(AtomicReader reader, String field) {
|
SortedNumericFloatFieldData(AtomicReader reader, String field) {
|
||||||
super(-1L);
|
super(0L);
|
||||||
this.reader = reader;
|
this.reader = reader;
|
||||||
this.field = field;
|
this.field = field;
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ public class SortedNumericDVIndexFieldData extends DocValuesIndexFieldData imple
|
||||||
final String field;
|
final String field;
|
||||||
|
|
||||||
SortedNumericDoubleFieldData(AtomicReader reader, String field) {
|
SortedNumericDoubleFieldData(AtomicReader reader, String field) {
|
||||||
super(-1L);
|
super(0L);
|
||||||
this.reader = reader;
|
this.reader = reader;
|
||||||
this.field = field;
|
this.field = field;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public final class SortedSetDVBytesAtomicFieldData extends AbstractAtomicOrdinal
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long ramBytesUsed() {
|
public long ramBytesUsed() {
|
||||||
return -1; // unknown
|
return 0; // unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue