Cody tidy and optimise the tracing code.

This commit is contained in:
Peter Lawrey
2020-06-18 13:17:58 +01:00
parent b167ec59eb
commit 8dfc91b1eb
15 changed files with 260 additions and 145 deletions
@@ -330,8 +330,7 @@ public final class ChronicleMapBuilder<K, V> implements
return valueBuilder.sizeIsStaticallyKnown;
}
private static void checkSegments(long segments) {
private static void checkSegments(long segments) {
if (segments <= 0) {
throw new IllegalArgumentException("segments should be positive, " +
segments + " given");
@@ -115,7 +115,8 @@ class OldDeletedEntriesCleanupThread extends Thread
@Override
public void run() {
throwExceptionIfClosed();
if (System.currentTimeMillis() - startTime < 1_000)
if (System.currentTimeMillis() - startTime < 1_000)
return;
while (!shutdown) {
@@ -177,7 +178,8 @@ class OldDeletedEntriesCleanupThread extends Thread
@Override
public boolean test(ReplicableEntry e) {
throwExceptionIfClosed();
if (shutdown)
if (shutdown)
return false;
if (e instanceof MapAbsentEntry) {
long deleteTimeout = systemTimeIntervalBetween(
@@ -173,13 +173,15 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public ReplicatedGlobalMutableState globalMutableState() {
throwExceptionIfClosed();
return (ReplicatedGlobalMutableState) super.globalMutableState();
return (ReplicatedGlobalMutableState) super.globalMutableState();
}
@Override
public void initTransients() {
throwExceptionIfClosed();
super.initTransients();
super.initTransients();
initOwnTransients();
}
@@ -236,25 +238,29 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public long mapHeaderInnerSize() {
throwExceptionIfClosed();
return super.mapHeaderInnerSize() + (segmentModIterBitSetsForIdentifierOuterSize * 128);
return super.mapHeaderInnerSize() + (segmentModIterBitSetsForIdentifierOuterSize * 128);
}
@Override
public void setRemoteNodeCouldBootstrapFrom(byte remoteIdentifier, long bootstrapTimestamp) {
throwExceptionIfClosed();
remoteNodeCouldBootstrapFrom[remoteIdentifier] = bootstrapTimestamp;
remoteNodeCouldBootstrapFrom[remoteIdentifier] = bootstrapTimestamp;
}
@Override
public long remoteNodeCouldBootstrapFrom(byte remoteIdentifier) {
throwExceptionIfClosed();
return remoteNodeCouldBootstrapFrom[remoteIdentifier];
return remoteNodeCouldBootstrapFrom[remoteIdentifier];
}
@Override
public void onHeaderCreated() {
throwExceptionIfClosed();
// Pad modification iterators at 3 cache lines from the end of the map header,
// Pad modification iterators at 3 cache lines from the end of the map header,
// to avoid false sharing with the header of the first segment
startOfModificationIterators = super.mapHeaderInnerSize() +
RESERVED_GLOBAL_MUTABLE_STATE_BYTES - BYTES.convert(3, CACHE_LINES);
@@ -269,7 +275,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public byte identifier() {
throwExceptionIfClosed();
byte id = localIdentifier;
byte id = localIdentifier;
if (id == 0) {
throw new IllegalStateException("Replication identifier is not set for this\n" +
"replicated Chronicle Map. This should only be possible if persisted\n" +
@@ -291,7 +298,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public ModificationIterator acquireModificationIterator(byte remoteIdentifier) {
throwExceptionIfClosed();
ModificationIterator modificationIterator = modificationIterators.get(remoteIdentifier);
ModificationIterator modificationIterator = modificationIterators.get(remoteIdentifier);
if (modificationIterator != null)
return modificationIterator;
@@ -334,7 +342,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
public ModificationIterator[] acquireAllModificationIterators() {
throwExceptionIfClosed();
for (int remoteIdentifier = 0; remoteIdentifier < 128; remoteIdentifier++) {
for (int remoteIdentifier = 0; remoteIdentifier < 128; remoteIdentifier++) {
if (globalMutableState().getModificationIteratorInitAt(remoteIdentifier)) {
acquireModificationIterator((byte) remoteIdentifier);
}
@@ -351,24 +360,28 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
public long changeCount() {
throwExceptionIfClosed();
return changeCount.get();
return changeCount.get();
}
public void raiseChange(long tierIndex, long pos) {
throwExceptionIfClosed();
// -1 is invalid remoteIdentifier => raise change for all
// -1 is invalid remoteIdentifier => raise change for all
changeCount.incrementAndGet();
raiseChangeForAllExcept(tierIndex, pos, (byte) -1);
}
public void raiseChangeFor(long tierIndex, long pos, byte remoteIdentifier) {
throwExceptionIfClosed();
acquireModificationIterator(remoteIdentifier).raiseChange0(tierIndex, pos);
acquireModificationIterator(remoteIdentifier).raiseChange0(tierIndex, pos);
}
public void raiseChangeForAllExcept(long tierIndex, long pos, byte remoteIdentifier) {
throwExceptionIfClosed();
updateModificationIteratorsArray();
updateModificationIteratorsArray();
if (tierIndex <= actualSegments) {
long segmentIndex = tierIndex - 1;
long offsetToTierBitSet = segmentIndex * tierModIterBitSetOuterSize;
@@ -390,7 +403,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
public void dropChange(long tierIndex, long pos) {
throwExceptionIfClosed();
updateModificationIteratorsArray();
updateModificationIteratorsArray();
if (tierIndex <= actualSegments) {
long segmentIndex = tierIndex - 1;
long offsetToTierBitSet = segmentIndex * tierModIterBitSetOuterSize;
@@ -410,12 +424,14 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
public void dropChangeFor(long tierIndex, long pos, byte remoteIdentifier) {
throwExceptionIfClosed();
acquireModificationIterator(remoteIdentifier).dropChange0(tierIndex, pos);
acquireModificationIterator(remoteIdentifier).dropChange0(tierIndex, pos);
}
public void moveChange(long oldTierIndex, long oldPos, long newTierIndex, long newPos) {
throwExceptionIfClosed();
updateModificationIteratorsArray();
updateModificationIteratorsArray();
if (oldTierIndex <= actualSegments) {
long oldSegmentIndex = oldTierIndex - 1;
long oldOffsetToTierBitSet = oldSegmentIndex * tierModIterBitSetOuterSize;
@@ -470,7 +486,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
public boolean isChanged(long tierIndex, long pos) {
throwExceptionIfClosed();
updateModificationIteratorsArray();
updateModificationIteratorsArray();
if (tierIndex <= actualSegments) {
long segmentIndex = tierIndex - 1;
long offsetToTierBitSet = segmentIndex * tierModIterBitSetOuterSize;
@@ -494,14 +511,16 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public boolean identifierCheck(@NotNull ReplicableEntry entry, int chronicleId) {
throwExceptionIfClosed();
return entry.originIdentifier() == identifier();
return entry.originIdentifier() == identifier();
}
@Override
public void writeExternalEntry(
ReplicableEntry entry, Bytes payload, @NotNull Bytes destination, int chronicleId, ArrayList<String> keys) {
throwExceptionIfClosed();
if (payload != null)
if (payload != null)
writePayload(payload, destination);
if (entry != null)
writeExternalEntry0(entry, destination, keys);
@@ -594,7 +613,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public void readExternalEntry(@NotNull Bytes source, byte remoteNodeIdentifier) {
throwExceptionIfClosed();
byte hunk = source.readByte();
byte hunk = source.readByte();
if (hunk == BOOTSTRAP_TIME_HUNK) {
setRemoteNodeCouldBootstrapFrom(remoteNodeIdentifier, source.readLong());
} else {
@@ -619,8 +639,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
CompiledReplicatedMapIterationContext::new, this);
}
@Override
@Override
public final V get(Object key) {
return defaultGet(key);
}
@@ -630,8 +649,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
return defaultGetUsing(key, usingValue);
}
/**
/**
* <p>
* Once a change occurs to a map, map replication requires that these changes are picked up
* by another thread, this class provides an iterator like interface to poll for such changes.
@@ -705,7 +723,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
public void setModificationNotifier(@NotNull ModificationNotifier modificationNotifier) {
throwExceptionIfClosed();
this.modificationNotifier = modificationNotifier;
this.modificationNotifier = modificationNotifier;
}
void raiseChangeInSegment(long offsetToTierBitSet, long pos) {
@@ -760,7 +779,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public boolean hasNext() {
throwExceptionIfClosed();
return nextEntryPos(null, 0) != NOT_FOUND;
return nextEntryPos(null, 0) != NOT_FOUND;
}
private long nextEntryPos(Callback callback, int chronicleId) {
@@ -849,7 +869,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public boolean nextEntry(@NotNull Callback callback, int chronicleId) {
throwExceptionIfClosed();
while (true) {
while (true) {
long nextEntryPos = nextEntryPos(callback, chronicleId);
if (nextEntryPos == NOT_FOUND)
return false;
@@ -900,7 +921,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
@Override
public void dirtyEntries(long fromTimeStamp) {
throwExceptionIfClosed();
try (CompiledReplicatedMapIterationContext<K, V, R> c = iterationContext()) {
try (CompiledReplicatedMapIterationContext<K, V, R> c = iterationContext()) {
// iterate over all the segments and mark bit in the modification iterator
// that correspond to entries with an older timestamp
boolean debugEnabled = LOG.isDebugEnabled();
@@ -962,7 +984,8 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
public void clearRange0(long tierIndex, long pos, long endPosExclusive) {
throwExceptionIfClosed();
if (tierIndex <= actualSegments) {
if (tierIndex <= actualSegments) {
long segmentIndex = tierIndex - 1;
long offsetToTierBitSet = segmentIndex * tierModIterBitSetOuterSize;
tierModIterFrame.clearRange(nativeAccess(), null,
@@ -163,7 +163,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public void initTransients() {
throwExceptionIfClosed();
super.initTransients();
super.initTransients();
initOwnTransients();
}
@@ -171,7 +172,8 @@ public class VanillaChronicleMap<K, V, R>
ChronicleHashResources resources, ChronicleHashCorruption.Listener corruptionListener,
ChronicleHashCorruptionImpl corruption) throws IOException {
throwExceptionIfClosed();
basicRecover(resources, corruptionListener, corruption);
basicRecover(resources, corruptionListener, corruption);
try (IterationContext<K, V, ?> iterationContext = iterationContext()) {
iterationContext.recoverSegments(corruptionListener, corruption);
}
@@ -216,25 +218,29 @@ public class VanillaChronicleMap<K, V, R>
@Override
public Class<K> keyClass() {
throwExceptionIfClosed();
return (Class<K>) keyClass;
return (Class<K>) keyClass;
}
@Override
public Type keyType() {
throwExceptionIfClosed();
return keyClass;
return keyClass;
}
@Override
public Class<V> valueClass() {
throwExceptionIfClosed();
return (Class<V>) valueClass;
return (Class<V>) valueClass;
}
@Override
public Type valueType() {
throwExceptionIfClosed();
return valueClass;
return valueClass;
}
private long tiersUsed() {
@@ -248,14 +254,15 @@ public class VanillaChronicleMap<K, V, R>
@Override
public int remainingAutoResizes() {
throwExceptionIfClosed();
return (int) (maxTiers() - tiersUsed());
return (int) (maxTiers() - tiersUsed());
}
@Override
public short percentageFreeSpace() {
throwExceptionIfClosed();
double totalUsed = 0;
double totalUsed = 0;
double totalSize = 0;
try (IterationContext<K, V, ?> c = iterationContext()) {
@@ -320,13 +327,15 @@ public class VanillaChronicleMap<K, V, R>
@Override
public int hashCode() {
throwExceptionIfClosed();
return mapHashCode();
return mapHashCode();
}
@Override
public boolean equals(Object obj) {
throwExceptionIfClosed();
return mapEquals(obj);
return mapEquals(obj);
}
@Override
@@ -342,7 +351,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public String toIdentityString() {
throwExceptionIfClosed();
if (identityString == null)
if (identityString == null)
identityString = makeIdentityString();
return identityString;
}
@@ -360,7 +370,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public void clear() {
throwExceptionIfClosed();
forEachEntry(c -> c.context().remove(c));
forEachEntry(c -> c.context().remove(c));
}
public final long readValueSize(Bytes entry) {
@@ -371,7 +382,8 @@ public class VanillaChronicleMap<K, V, R>
public void alignReadPosition(Bytes entry) {
throwExceptionIfClosed();
long positionAddr = entry.addressForRead(entry.readPosition());
long positionAddr = entry.addressForRead(entry.readPosition());
long skip = alignAddr(positionAddr, alignment) - positionAddr;
if (skip > 0)
entry.readSkip(skip);
@@ -535,7 +547,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V get(Object key) {
throwExceptionIfClosed();
return defaultEntryOperationsAndMethods ? optimizedGet(key, null) : defaultGet(key);
return defaultEntryOperationsAndMethods ? optimizedGet(key, null) : defaultGet(key);
}
final V defaultGet(Object key) {
@@ -709,7 +722,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V getUsing(K key, V usingValue) {
throwExceptionIfClosed();
return defaultEntryOperationsAndMethods ? optimizedGet(key, usingValue) :
return defaultEntryOperationsAndMethods ? optimizedGet(key, usingValue) :
defaultGetUsing(key, usingValue);
}
@@ -724,7 +738,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V acquireUsing(K key, V usingValue) {
throwExceptionIfClosed();
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
return acquireUsingBody(q, usingValue);
}
}
@@ -738,7 +753,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V putIfAbsent(K key, V value) {
throwExceptionIfClosed();
checkValue(value);
checkValue(value);
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
methods.putIfAbsent(q, q.inputValueDataAccess().getData(value), q.defaultReturnValue());
return q.defaultReturnValue().returnValue();
@@ -748,7 +764,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public boolean remove(Object key, Object value) {
throwExceptionIfClosed();
if (value == null)
if (value == null)
return false; // ConcurrentHashMap compatibility
V v = checkValue(value);
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
@@ -759,7 +776,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public boolean replace(K key, V oldValue, V newValue) {
throwExceptionIfClosed();
checkValue(oldValue);
checkValue(oldValue);
checkValue(newValue);
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
return methods.replace(
@@ -770,7 +788,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V replace(K key, V value) {
throwExceptionIfClosed();
checkValue(value);
checkValue(value);
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
methods.replace(q, q.inputValueDataAccess().getData(value), q.defaultReturnValue());
return q.defaultReturnValue().returnValue();
@@ -780,7 +799,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public boolean containsKey(Object key) {
throwExceptionIfClosed();
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
return methods.containsKey(q);
}
}
@@ -788,7 +808,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V put(K key, V value) {
throwExceptionIfClosed();
checkValue(value);
checkValue(value);
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
Data<V> valueData = q.inputValueDataAccess().getData(value);
InstanceReturnValue<V> returnValue =
@@ -801,7 +822,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V remove(Object key) {
throwExceptionIfClosed();
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
InstanceReturnValue<V> returnValue =
removeReturnsNull ? NullReturnValue.get() : q.defaultReturnValue();
methods.remove(q, returnValue);
@@ -813,7 +835,8 @@ public class VanillaChronicleMap<K, V, R>
public V merge(K key, V value,
BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
throwExceptionIfClosed();
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
methods.merge(q, q.inputValueDataAccess().getData(value), remappingFunction,
q.defaultReturnValue());
return q.defaultReturnValue().returnValue();
@@ -823,7 +846,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
throwExceptionIfClosed();
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
methods.compute(q, remappingFunction, q.defaultReturnValue());
return q.defaultReturnValue().returnValue();
}
@@ -832,7 +856,8 @@ public class VanillaChronicleMap<K, V, R>
@Override
public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
throwExceptionIfClosed();
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
methods.computeIfAbsent(q, mappingFunction, q.defaultReturnValue());
return q.defaultReturnValue().returnValue();
}
@@ -842,7 +867,8 @@ public class VanillaChronicleMap<K, V, R>
public V computeIfPresent(K key,
BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
throwExceptionIfClosed();
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
try (QueryContextInterface<K, V, R> q = queryContext(key)) {
methods.computeIfPresent(q, remappingFunction, q.defaultReturnValue());
return q.defaultReturnValue().returnValue();
}
@@ -850,7 +876,8 @@ public class VanillaChronicleMap<K, V, R>
public void verifyTierCountersAreaData() {
throwExceptionIfClosed();
for (int i = 0; i < actualSegments; i++) {
for (int i = 0; i < actualSegments; i++) {
try (MapSegmentContext<K, V, ?> c = segmentContext(i)) {
Method verifyTierCountersAreaData =
c.getClass().getMethod("verifyTierCountersAreaData");
@@ -38,8 +38,7 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
throw new UnsupportedOperationException("Cannot get the address of nothing");
}
@Override
@Override
public int peekUnsignedByte(long offset) {
return 0;
}
@@ -157,8 +156,7 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
return true;
}
@Override
@Override
public void reserve(ReferenceOwner id) throws IllegalStateException {
}
@@ -41,13 +41,15 @@ public abstract class MapSegmentIteration<K, V, R> extends HashSegmentIteration<
@Override
public void hookAfterEachIteration() {
throwExceptionIfClosed();
wrappedValueInstanceDataHolder.closeValue();
wrappedValueInstanceDataHolder.closeValue();
}
@Override
public void doReplaceValue(Data<V> newValue) {
throwExceptionIfClosed();
checkOnEachPublicOperation.checkOnEachPublicOperation();
checkOnEachPublicOperation.checkOnEachPublicOperation();
try {
entry.innerDefaultReplaceValue(newValue);
} finally {
@@ -61,25 +61,29 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
@Override
public boolean shouldTestEntry() {
throwExceptionIfClosed();
return entriesToTest == ALL || !e.entryDeleted();
return entriesToTest == ALL || !e.entryDeleted();
}
@Override
public Object entryForIteration() {
throwExceptionIfClosed();
return !e.entryDeleted() ? entryDelegating : absentEntryDelegating;
return !e.entryDeleted() ? entryDelegating : absentEntryDelegating;
}
@Override
public long tierEntriesForIteration() {
throwExceptionIfClosed();
return entriesToTest == ALL ? s.tierEntries() : s.tierEntries() - s.tierDeleted();
return entriesToTest == ALL ? s.tierEntries() : s.tierEntries() - s.tierDeleted();
}
@Override
public void doReplaceValue(Data<V> newValue) {
throwExceptionIfClosed();
checkOnEachPublicOperation.checkOnEachPublicOperation();
checkOnEachPublicOperation.checkOnEachPublicOperation();
try {
entry.innerDefaultReplaceValue(newValue);
e.updatedReplicationStateOnPresentEntry();
@@ -92,7 +96,8 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
@Override
public boolean forEachSegmentEntryWhile(Predicate<? super MapEntry<K, V>> predicate) {
throwExceptionIfClosed();
checkOnEachPublicOperation.checkOnEachPublicOperation();
checkOnEachPublicOperation.checkOnEachPublicOperation();
initEntriesToTest(PRESENT);
s.innerUpdateLock.lock();
return innerForEachSegmentEntryWhile(predicate);
@@ -102,7 +107,8 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
public boolean forEachSegmentReplicableEntryWhile(
Predicate<? super ReplicableEntry> predicate) {
throwExceptionIfClosed();
checkOnEachPublicOperation.checkOnEachPublicOperation();
checkOnEachPublicOperation.checkOnEachPublicOperation();
initEntriesToTest(ALL);
s.innerUpdateLock.lock();
return innerForEachSegmentEntryWhile(predicate);
@@ -111,7 +117,8 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
@Override
public void forEachSegmentReplicableEntry(Consumer<? super ReplicableEntry> action) {
throwExceptionIfClosed();
forEachSegmentReplicableEntryWhile(e -> {
forEachSegmentReplicableEntryWhile(e -> {
action.accept(e);
return true;
});
@@ -120,7 +127,8 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
@Override
public void doRemove() {
throwExceptionIfClosed();
checkOnEachPublicOperation.checkOnEachPublicOperation();
checkOnEachPublicOperation.checkOnEachPublicOperation();
try {
if (e.valueSize > dummyValue.size())
e.innerDefaultReplaceValue(dummyValue);
@@ -137,7 +145,8 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
@Override
public void doRemoveCompletely() {
throwExceptionIfClosed();
boolean wasDeleted = e.entryDeleted();
boolean wasDeleted = e.entryDeleted();
super.doRemove();
ru.dropChange();
if (wasDeleted)
@@ -146,7 +155,8 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
public void doInsert(Data<V> value) {
throwExceptionIfClosed();
checkOnEachPublicOperation.checkOnEachPublicOperation();
checkOnEachPublicOperation.checkOnEachPublicOperation();
if (e.entryDeleted()) {
try {
s.tierDeleted(s.tierDeleted() - 1);
@@ -166,7 +176,8 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
public void doInsert() {
throwExceptionIfClosed();
if (mh.set() == null)
if (mh.set() == null)
throw new IllegalStateException(mh.h().toIdentityString() +
": Called SetAbsentEntry.doInsert() from Map context");
doInsert((Data<V>) DummyValueData.INSTANCE);