Fix the prev commit e78e070

This commit is contained in:
leventov
2015-12-17 18:16:51 +03:00
parent e78e070558
commit 27c8148007
9 changed files with 27 additions and 24 deletions
@@ -159,7 +159,7 @@ public abstract class HashEntryStages<K> implements HashEntry<K>, ChecksumEntry
return checksumStrategy.extraEntryBytes() + entryEnd() - keySizeOffset;
}
@StageRef EntryKeyBytesData<K> entryKey;
@StageRef public EntryKeyBytesData<K> entryKey;
@NotNull
@Override
@@ -37,7 +37,7 @@ public abstract class KeySearch<K> {
public Data<K> inputKey = null;
abstract boolean inputKeyInit();
public abstract boolean inputKeyInit();
public void initInputKey(Data<K> inputKey) {
this.inputKey = inputKey;
@@ -418,7 +418,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
isDeleted = true;
MapAbsentEntry mapAbsentEntry = (MapAbsentEntry) entry;
key = mapAbsentEntry.absentKey();
value = ((MapRemoteQueryContext) mapAbsentEntry.context()).dummyZeroValue();
value = ((CompiledReplicatedMapIterationContext) mapAbsentEntry.context()).dummyValue();
}
destination.writeLong(bootstrapTime);
@@ -31,7 +31,7 @@ import static net.openhft.chronicle.map.ReplicatedChronicleMap.ADDITIONAL_ENTRY_
@Staged
public abstract class ReplicatedMapEntryStages<K, V> extends MapEntryStages<K, V>
implements MapReplicableEntry<K, V>, MapAbsentEntry<K, V> {
implements MapReplicableEntry<K, V> {
@StageRef ReplicatedChronicleMapHolder<?, ?, ?> mh;
@StageRef ReplicationUpdate ru;
@@ -159,11 +159,4 @@ public abstract class ReplicatedMapEntryStages<K, V> extends MapEntryStages<K, V
long sizeOfEverythingBeforeValue(long keySize, long valueSize) {
return super.sizeOfEverythingBeforeValue(keySize, valueSize) + ADDITIONAL_ENTRY_BYTES;
}
@NotNull
@Override
public Data<K> absentKey() {
checkOnEachPublicOperation.checkOnEachPublicOperation();
return ks.inputKey;
}
}
@@ -17,10 +17,12 @@
package net.openhft.chronicle.map.impl.stage.iter;
import net.openhft.chronicle.hash.Data;
import net.openhft.chronicle.hash.impl.stage.hash.CheckOnEachPublicOperation;
import net.openhft.chronicle.hash.impl.stage.replication.ReplicableEntryDelegating;
import net.openhft.chronicle.hash.replication.ReplicableEntry;
import net.openhft.chronicle.map.MapAbsentEntry;
import net.openhft.chronicle.map.impl.stage.entry.ReplicatedMapEntryStages;
import net.openhft.chronicle.map.impl.stage.map.DefaultValue;
import net.openhft.chronicle.map.impl.stage.map.WrappedValueInstanceValueHolder;
import net.openhft.chronicle.set.SetAbsentEntry;
import net.openhft.sg.StageRef;
@@ -31,8 +33,10 @@ import org.jetbrains.annotations.NotNull;
public class ReplicatedMapAbsentDelegatingForIteration<K, V>
implements MapAbsentEntry<K, V>, SetAbsentEntry<K>, ReplicableEntryDelegating {
@StageRef CheckOnEachPublicOperation checkOnEachPublicOperation;
@StageRef ReplicatedMapSegmentIteration<K, V, ?> delegate;
@StageRef ReplicatedMapEntryStages<K, V> e;
@StageRef DefaultValue<V> defaultValue;
@NotNull
@Override
@@ -53,13 +57,14 @@ public class ReplicatedMapAbsentDelegatingForIteration<K, V>
@NotNull
@Override
public Data<V> defaultValue() {
return delegate.defaultValue();
return defaultValue.defaultValue();
}
@NotNull
@Override
public Data<K> absentKey() {
return delegate.absentKey();
checkOnEachPublicOperation.checkOnEachPublicOperation();
return e.entryKey;
}
@Override
@@ -19,7 +19,6 @@ package net.openhft.chronicle.map.impl.stage.iter;
import net.openhft.chronicle.hash.Data;
import net.openhft.chronicle.hash.ReplicatedHashSegmentContext;
import net.openhft.chronicle.hash.replication.ReplicableEntry;
import net.openhft.chronicle.map.MapAbsentEntry;
import net.openhft.chronicle.map.MapEntry;
import net.openhft.chronicle.map.impl.ReplicatedIterationContext;
import net.openhft.chronicle.map.impl.VanillaChronicleMapHolder;
@@ -27,7 +26,6 @@ import net.openhft.chronicle.map.impl.stage.data.DummyValueZeroData;
import net.openhft.chronicle.map.impl.stage.entry.ReplicatedMapEntryStages;
import net.openhft.chronicle.map.impl.stage.replication.ReplicationUpdate;
import net.openhft.chronicle.set.DummyValueData;
import net.openhft.chronicle.set.SetAbsentEntry;
import net.openhft.sg.StageRef;
import net.openhft.sg.Staged;
@@ -40,7 +38,7 @@ import static net.openhft.chronicle.map.impl.stage.iter.ReplicatedMapSegmentIter
@Staged
public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentIteration<K, V, R>
implements ReplicatedIterationContext<K, V, R>, ReplicableEntry,
ReplicatedHashSegmentContext<K, MapEntry<K, V>>, MapAbsentEntry<K, V>, SetAbsentEntry<K> {
ReplicatedHashSegmentContext<K, MapEntry<K, V>> {
@StageRef VanillaChronicleMapHolder<K, V, R> mh;
@StageRef ReplicatedMapEntryStages<K, V> e;
@@ -132,7 +130,6 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
s.tierDeleted(s.tierDeleted() - 1);
}
@Override
public void doInsert(Data<V> value) {
checkOnEachPublicOperation.checkOnEachPublicOperation();
if (e.entryDeleted()) {
@@ -152,7 +149,6 @@ public abstract class ReplicatedMapSegmentIteration<K, V, R> extends MapSegmentI
}
}
@Override
public void doInsert() {
if (mh.set() == null)
throw new IllegalStateException("Called SetAbsentEntry.doInsert() from Map context");
@@ -18,22 +18,18 @@ package net.openhft.chronicle.map.impl.stage.map;
import net.openhft.chronicle.hash.Data;
import net.openhft.chronicle.hash.impl.stage.hash.CheckOnEachPublicOperation;
import net.openhft.chronicle.map.MapAbsentEntry;
import net.openhft.chronicle.map.impl.VanillaChronicleMapHolder;
import net.openhft.chronicle.map.impl.stage.data.DummyValueZeroData;
import net.openhft.sg.StageRef;
import net.openhft.sg.Staged;
import org.jetbrains.annotations.NotNull;
@Staged
public abstract class DefaultValue<K, V> implements MapAbsentEntry<K, V> {
public abstract class DefaultValue<V> {
@StageRef CheckOnEachPublicOperation checkOnEachPublicOperation;
@StageRef VanillaChronicleMapHolder<K, V, ?> mh;
@StageRef DummyValueZeroData<V> zeroValueData;
@NotNull
@Override
public Data<V> defaultValue() {
checkOnEachPublicOperation.checkOnEachPublicOperation();
return zeroValueData;
@@ -22,6 +22,7 @@ import net.openhft.chronicle.map.impl.stage.entry.ReplicatedMapEntryStages;
import net.openhft.chronicle.map.impl.stage.replication.ReplicationUpdate;
import net.openhft.sg.StageRef;
import net.openhft.sg.Staged;
import org.jetbrains.annotations.NotNull;
import static net.openhft.chronicle.hash.impl.stage.query.KeySearch.SearchState.PRESENT;
@@ -32,6 +33,13 @@ public abstract class ReplicatedMapAbsent<K, V> extends MapAbsent<K, V> {
@StageRef ReplicatedMapEntryStages<K, V> e;
@StageRef ReplicationUpdate<K> ru;
@NotNull
@Override
public Data<K> absentKey() {
checkOnEachPublicOperation.checkOnEachPublicOperation();
return e.entryKey;
}
@Override
public void doInsert(Data<V> value) {
q.putPrefix();
@@ -17,6 +17,8 @@
package net.openhft.chronicle.map.impl.stage.query;
import net.openhft.chronicle.hash.Data;
import net.openhft.chronicle.hash.impl.stage.hash.CheckOnEachPublicOperation;
import net.openhft.chronicle.hash.impl.stage.query.KeySearch;
import net.openhft.sg.StageRef;
import net.openhft.sg.Staged;
import org.jetbrains.annotations.NotNull;
@@ -24,6 +26,8 @@ import org.jetbrains.annotations.NotNull;
@Staged
public class ReplicatedMapAbsentDelegating<K, V> implements Absent<K, V> {
@StageRef CheckOnEachPublicOperation checkOnEachPublicOperation;
@StageRef KeySearch<K> ks;
@StageRef ReplicatedMapAbsent<K, V> delegate;
@NotNull
@@ -51,6 +55,7 @@ public class ReplicatedMapAbsentDelegating<K, V> implements Absent<K, V> {
@NotNull
@Override
public Data<K> absentKey() {
return delegate.absentKey();
checkOnEachPublicOperation.checkOnEachPublicOperation();
return ks.inputKey;
}
}