Fixed- PackedArrayIndexFieldData.chooseStorageFormat compared to Long.MAX_VALUE instead of Long.MIN_VALUE
Also made the LongFieldDataTests.SINGLE_VALUED_SPARSE_RANDOM & LongFieldDataTests.MULTI_VALUED_SPARSE_RANDOM more sparse
This commit is contained in:
parent
1d1ca3befc
commit
f549472fea
|
@ -261,7 +261,7 @@ public class PackedArrayIndexFieldData extends AbstractIndexFieldData<AtomicNume
|
||||||
}
|
}
|
||||||
if (pageIndex == pageSize - 1) {
|
if (pageIndex == pageSize - 1) {
|
||||||
// end of page, we now know enough to estimate memory usage
|
// end of page, we now know enough to estimate memory usage
|
||||||
if (pageMaxOrdinal == Long.MAX_VALUE) {
|
if (pageMaxOrdinal == Long.MIN_VALUE) {
|
||||||
// empty page - will use the null reader which just stores size
|
// empty page - will use the null reader which just stores size
|
||||||
pagedSingleValuesSize += RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT);
|
pagedSingleValuesSize += RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT);
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ public class PackedArrayIndexFieldData extends AbstractIndexFieldData<AtomicNume
|
||||||
if (pageIndex > 0) {
|
if (pageIndex > 0) {
|
||||||
// last page estimation
|
// last page estimation
|
||||||
pageIndex++;
|
pageIndex++;
|
||||||
if (pageMaxOrdinal == Long.MAX_VALUE) {
|
if (pageMaxOrdinal == Long.MIN_VALUE) {
|
||||||
// empty page - will use the null reader which just stores size
|
// empty page - will use the null reader which just stores size
|
||||||
pagedSingleValuesSize += RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT);
|
pagedSingleValuesSize += RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT);
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ public class LongFieldDataTests extends AbstractNumericFieldDataTests {
|
||||||
},
|
},
|
||||||
SINGLE_VALUED_SPARSE_RANDOM {
|
SINGLE_VALUED_SPARSE_RANDOM {
|
||||||
public int numValues(Random r) {
|
public int numValues(Random r) {
|
||||||
return r.nextFloat() < 0.1f ? 1 : 0;
|
return r.nextFloat() < 0.01 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -291,7 +291,7 @@ public class LongFieldDataTests extends AbstractNumericFieldDataTests {
|
||||||
},
|
},
|
||||||
MULTI_VALUED_SPARSE_RANDOM {
|
MULTI_VALUED_SPARSE_RANDOM {
|
||||||
public int numValues(Random r) {
|
public int numValues(Random r) {
|
||||||
return r.nextFloat() < 0.1f ? 1 + r.nextInt(5) : 0;
|
return r.nextFloat() < 0.01f ? 1 + r.nextInt(5) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue