Make value and value size configuration obligatory in ChronicleMapBuilder

This commit is contained in:
leventov
2015-10-14 17:47:22 +03:00
parent 7d35346022
commit a13bf449d0
32 changed files with 172 additions and 81 deletions
@@ -210,8 +210,10 @@ public class CHMUseCasesTest {
.entriesPerSegment(vanillaMap.entriesPerSegment)
.actualSegments(vanillaMap.actualSegments)
.actualChunksPerSegment(vanillaMap.actualChunksPerSegment);
if (!vanillaMap.constantlySizedEntry)
if (!vanillaMap.constantlySizedEntry) {
builder.actualChunkSize((int) vanillaMap.chunkSize);
builder.worstAlignment(vanillaMap.worstAlignment);
}
try (ChronicleMap<Integer, Double> actual = builder.create()) {
actual.putAll(file);
@@ -236,6 +238,10 @@ public class CHMUseCasesTest {
private <X, Y> ChronicleMap<X, Y> newInstance(ChronicleMapBuilder<X, Y> builder) throws
IOException {
if (!builder.constantlySizedKeys())
builder.averageKeySize(20);
if (!builder.constantlySizedValues())
builder.averageValueSize(20);
switch (typeOfMap) {
case SIMPLE: