Removed ChronicleMapBuilder.alignedEntrySize() in favor of simply entrySize()

This commit is contained in:
leventov
2014-10-07 03:26:38 +04:00
parent fdd5988d6f
commit 0cf883eade
2 changed files with 3 additions and 7 deletions
@@ -126,7 +126,7 @@ public class ChronicleMapBuilder<K, V> implements Cloneable {
private int tryMinSegments(int min, int max) {
for (int i = min; i < max; i <<= 1) {
if (i * i * i >= alignedEntrySize() * 2)
if (i * i * i >= entrySize() * 2)
return i;
}
return max;
@@ -292,7 +292,7 @@ public class ChronicleMapBuilder<K, V> implements Cloneable {
*/
public int entrySize() {
if (entrySize > 0)
return entrySize;
return entryAndValueAlignment().alignSize(entrySize);
int size = metaDataBytes;
int keySize = keySize();
size += keyBuilder.sizeMarshaller().sizeEncodingSize(keySize);
@@ -318,10 +318,6 @@ public class ChronicleMapBuilder<K, V> implements Cloneable {
return entryAndValueAlignment().alignSize(size);
}
int alignedEntrySize() {
return entryAndValueAlignment().alignSize(entrySize());
}
/**
* Configures alignment strategy of address in memory of entries and independently of address
* in memory of values within entries in ChronicleMaps, created by this builder.
@@ -124,7 +124,7 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, KI>,
lockTimeOutNS = builder.lockTimeOut(TimeUnit.NANOSECONDS);
// this.replicas = builder.replicas();
this.entrySize = builder.alignedEntrySize();
this.entrySize = builder.entrySize();
this.alignment = builder.entryAndValueAlignment();
this.errorListener = builder.errorListener();