Fix bugs with key/value average/constant size computation in ChronicleMapBuilder

This commit is contained in:
leventov
2015-08-02 01:24:04 +03:00
parent 0811f98e4c
commit 4a9e2c1095
2 changed files with 24 additions and 11 deletions
@@ -244,19 +244,22 @@ public final class SerializationBuilder<E> implements Cloneable, Serializable {
}
public SerializationBuilder<E> maxSize(long maxSize) {
this.maxSize = maxSize;
if (copyingInterop == CopyingInterop.FROM_MARSHALLER) {
this.maxSize = maxSize;
metaInteropProvider(CopyingMetaBytesInterop
.<E, BytesMarshaller<E>>providerForBytesMarshaller(
instancesAreMutable, maxSize));
} else if (copyingInterop == CopyingInterop.FROM_WRITER) {
this.maxSize = maxSize;
metaInteropProvider(CopyingMetaBytesInterop
.<E, BytesWriter<E>>providerForBytesWriter(instancesAreMutable));
}
return this;
}
public long maxSize() {
return maxSize;
}
public long serializationSize(E sampleObject) {
Object originalInterop = this.interop;
Provider interopProvider = Provider.of(originalInterop.getClass());