As ChronicleMapBuilder always cloned before Map creation, make 'replicated' an 'instance' field instead of a parameter of almost all methods

This commit is contained in:
leventov
2015-09-26 22:04:28 +03:00
parent 4c75dfd937
commit 01d24b0ee0
7 changed files with 108 additions and 95 deletions
@@ -96,9 +96,8 @@ public class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super
transient ThreadLocal<?> iterCxt;
public VanillaChronicleMap(ChronicleMapBuilder<K, V> builder, boolean replicated)
throws IOException {
super(builder, replicated);
public VanillaChronicleMap(ChronicleMapBuilder<K, V> builder) throws IOException {
super(builder);
SerializationBuilder<V> valueBuilder = builder.valueBuilder;
vClass = valueBuilder.eClass;
if (vClass.getName().endsWith("$$Native")) {
@@ -133,7 +132,7 @@ public class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super
// Concurrency (number of segments), memory management and dependent fields
alignment = builder.valueAlignment();
worstAlignment = builder.worstAlignment(replicated);
worstAlignment = builder.worstAlignment();
int alignment = this.alignment.alignment();
couldNotDetermineAlignmentBeforeAllocation =
greatestCommonDivisor((int) chunkSize, alignment) != alignment;