mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Update stage-compiler version removing limitation that stage names shouldn't be prefixes of each other
This commit is contained in:
@@ -23,5 +23,5 @@ public interface IterationContextInterface<K, V, R> extends MapEntry<K, V>,
|
||||
MapSegmentContext<K, V, R> {
|
||||
long pos();
|
||||
|
||||
void initTheSegmentIndex(int segmentIndex);
|
||||
void initSegmentIndex(int segmentIndex);
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ public interface QueryContextInterface<K, V, R> extends ExternalMapQueryContext<
|
||||
|
||||
Closeable acquireHandle();
|
||||
|
||||
void initTheSegmentIndex(int segmentIndex);
|
||||
void initSegmentIndex(int segmentIndex);
|
||||
|
||||
boolean theSegmentIndexInit();
|
||||
boolean segmentIndexInit();
|
||||
|
||||
void clear();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,6 @@ package net.openhft.chronicle.map.impl.stage.entry;
|
||||
import net.openhft.chronicle.hash.Data;
|
||||
import net.openhft.chronicle.hash.impl.stage.entry.AllocatedChunks;
|
||||
import net.openhft.chronicle.hash.impl.stage.entry.HashEntryStages;
|
||||
import net.openhft.chronicle.hash.impl.stage.query.HashLookupSearch;
|
||||
import net.openhft.chronicle.hash.impl.stage.query.KeySearch;
|
||||
import net.openhft.chronicle.map.MapEntry;
|
||||
import net.openhft.chronicle.map.VanillaChronicleMap;
|
||||
import net.openhft.chronicle.map.impl.VanillaChronicleMapHolder;
|
||||
@@ -47,36 +45,36 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
valueSizeOffset = countValueSizeOffset();
|
||||
}
|
||||
|
||||
@Stage("ValSize") public long valueSize = -1;
|
||||
@Stage("ValSize") public long valueOffset;
|
||||
@Stage("ValueSize") public long valueSize = -1;
|
||||
@Stage("ValueSize") public long valueOffset;
|
||||
|
||||
@Stage("ValSize")
|
||||
@Stage("ValueSize")
|
||||
private void countValueOffset() {
|
||||
mh.m().alignment.alignPositionAddr(entryBytes);
|
||||
valueOffset = entryBytes.position();
|
||||
}
|
||||
|
||||
void initValSize(long valueSize) {
|
||||
void initValueSize(long valueSize) {
|
||||
this.valueSize = valueSize;
|
||||
entryBytes.position(valueSizeOffset);
|
||||
mh.m().valueSizeMarshaller.writeSize(entryBytes, valueSize);
|
||||
countValueOffset();
|
||||
}
|
||||
|
||||
void initValSize() {
|
||||
void initValueSize() {
|
||||
entryBytes.position(valueSizeOffset);
|
||||
valueSize = mh.m().readValueSize(entryBytes);
|
||||
countValueOffset();
|
||||
}
|
||||
|
||||
void initValSizeEqualToOld(long oldValueSizeOffset, long oldValueSize, long oldValueOffset) {
|
||||
void initValueSize_EqualToOld(long oldValueSizeOffset, long oldValueSize, long oldValueOffset) {
|
||||
valueSize = oldValueSize;
|
||||
valueOffset = valueSizeOffset + (oldValueOffset - oldValueSizeOffset);
|
||||
}
|
||||
|
||||
public void initValue(Data<?> value) {
|
||||
entryBytes.position(valueSizeOffset);
|
||||
initValSize(value.size());
|
||||
initValueSize(value.size());
|
||||
writeValue(value);
|
||||
}
|
||||
|
||||
@@ -84,10 +82,10 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
value.writeTo(entryBS, valueOffset);
|
||||
}
|
||||
|
||||
public void initValueWithoutSize(
|
||||
public void initValue_WithoutSize(
|
||||
Data<?> value, long oldValueSizeOffset, long oldValueSize, long oldValueOffset) {
|
||||
assert oldValueSize == value.size();
|
||||
initValSizeEqualToOld(oldValueSizeOffset, oldValueSize, oldValueOffset);
|
||||
initValueSize_EqualToOld(oldValueSizeOffset, oldValueSize, oldValueOffset);
|
||||
writeValue(value);
|
||||
}
|
||||
|
||||
@@ -221,7 +219,7 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
entrySizeInChunks < allocatedChunks.allocatedChunks) {
|
||||
s.free(pos + entrySizeInChunks, allocatedChunks.allocatedChunks - entrySizeInChunks);
|
||||
} else {
|
||||
initTheEntrySizeInChunks(allocatedChunks.allocatedChunks);
|
||||
initEntrySizeInChunks(allocatedChunks.allocatedChunks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public abstract class ReplicatedInput<K, V, R>
|
||||
replicatedInputStore.setBytes(replicatedInputBytes);
|
||||
}
|
||||
|
||||
// ri for "replication input"
|
||||
@Stage("ReplicationInput") public long bootstrapTimestamp;
|
||||
@Stage("ReplicationInput") public long riKeySize = -1;
|
||||
@Stage("ReplicationInput") public long riValueSize;
|
||||
|
||||
@@ -70,7 +70,7 @@ public abstract class QueryMapEntryStages<K, V> extends MapEntryStages<K, V> {
|
||||
long oldValueSize = valueSize;
|
||||
long oldValueOffset = valueOffset;
|
||||
allocatedChunks.initEntryAndKeyCopying(entrySize, valueOffset - entryStartOffset);
|
||||
initValueWithoutSize(newValue, oldValueSizeOffset, oldValueSize, oldValueOffset);
|
||||
initValue_WithoutSize(newValue, oldValueSizeOffset, oldValueSize, oldValueOffset);
|
||||
}
|
||||
freeExtraAllocatedChunks();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user