/** * Return the addressForRead and length as a BytesStore * * @param address for the start * @param length of data * @return as a BytesStore */ @NotNull static PointerBytesStore wrap(long address, long length) { @NotNull PointerBytesStore pbs = nativePointer(); pbs.set(address, length); return pbs; }
/** * @return a PointerBytesStore which can be set to any addressForRead */ @NotNull static PointerBytesStore nativePointer() { return new PointerBytesStore(); }
@Override public boolean entryDeleted() { return s.segmentBS.readBoolean(entryDeletedOffset()); }
public void writeEntryPresent() { s.segmentBS.writeBoolean(entryDeletedOffset(), false); }
public long timestamp() { return s.segmentBS.readLong(replicationBytesOffset); }
byte identifier() { return s.segmentBS.readByte(identifierOffset()); }
@Override public int storedChecksum() { return s.segmentBS.readInt(e.entryEnd()); }
public void set(long address, long capacity) { isPresent = true; setAddress(address); this.maximumLimit = capacity; }
@Override public void computeAndStoreChecksum() { int checksum = computeChecksum(); s.segmentBS.writeInt(e.entryEnd(), checksum); }
public void writeEntryDeleted() { s.segmentBS.writeBoolean(entryDeletedOffset(), true); }
public long timestamp() { return this.segmentBS().readLong(replicationBytesOffset()); }
byte identifier() { return this.segmentBS().readByte(identifierOffset()); }
@Override public long hash(LongHashFunction f) { checkOnEachPublicOperation.checkOnEachPublicOperation(); if (f == LongHashFunction.xx_r39() && entry.keySize == 4 && hh.h().keyDataAccess instanceof IntegerDataAccess) { return WrongXxHash.hashInt(s.segmentBS.readInt(entry.keyOffset)); } else { return super.hash(f); } }
@NotNull private PointerBytesStore toKey(final @NotNull net.openhft.lang.io.Bytes key, @NotNull final PointerBytesStore pbs) { pbs.set(key.address(), key.capacity()); return pbs; }
public CompiledMapIterationContext(VanillaChronicleMap map) { contextChain = new ArrayList<>(); contextChain.add(this); indexInContextChain = 0; rootContextInThisThread = this; initMap(map); this.entryValue = new EntryValueBytesData(); this.valueReader = net.openhft.chronicle.hash.serialization.StatefulCopyable.copyIfNeeded(this.m().valueReader); this.wrappedValueInstanceDataHolder = new WrappedValueInstanceDataHolder(); this.innerReadLock = new ReadLock(); this.keyReader = net.openhft.chronicle.hash.serialization.StatefulCopyable.copyIfNeeded(this.h().keyReader); this.owner = Thread.currentThread(); this.innerWriteLock = new WriteLock(); this.wrappedValueBytesData = new WrappedValueBytesData(); this.entryKey = new EntryKeyBytesData(); this.segmentBS = new PointerBytesStore(); this.segmentBytes = new VanillaBytes(segmentBS); this.hashEntryChecksumStrategy = new HashEntryChecksumStrategy(); this.checksumStrategy = this.h().checksumEntries ? this.hashEntryChecksumStrategy : NoChecksumStrategy.INSTANCE; this.freeList = new ReusableBitSet(new SingleThreadedFlatBitSetFrame(MemoryUnit.LONGS.align(this.h().actualChunksPerSegmentTier, MemoryUnit.BITS)) , Access.nativeAccess() , null , 0); this.innerUpdateLock = new UpdateLock(); }
public void writeEntryDeleted() { this.segmentBS().writeBoolean(entryDeletedOffset(), true); }
public boolean entryDeleted() { return this.segmentBS().readBoolean(entryDeletedOffset()); }
public long timestamp() { return this.segmentBS().readLong(replicationBytesOffset()); }
byte identifier() { return this.segmentBS().readByte(identifierOffset()); }
@Nullable private BytesStore toValue(final @Nullable net.openhft.lang.io.Bytes value, @NotNull final PointerBytesStore pbs) { if (value == null) return null; pbs.set(value.address(), value.capacity()); return pbs; }