public class MappedBytesStore extends NativeBytesStore<Void>
address, limit, maximumLimit, memory
WARN_COUNT, WARN_NS
charToString
Modifier | Constructor and Description |
---|---|
protected |
MappedBytesStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
MappedFile mappedFile,
long start,
long address,
long capacity,
long safeCapacity) |
Modifier and Type | Method and Description |
---|---|
default long |
addressForRead(long offset,
int buffer) |
default ByteOrder |
byteOrder() |
@NotNull Bytes<Void> |
bytesForRead() |
@NotNull VanillaBytes<Void> |
bytesForWrite() |
default boolean |
compareAndSwapDouble(long offset,
double expected,
double value)
Perform a 64-bit double CAS at a given offset.
|
default boolean |
compareAndSwapFloat(long offset,
float expected,
float value)
Perform a 32-bit float CAS at a given offset.
|
boolean |
inside(long offset)
Use this test to determine if an offset is considered safe.
|
boolean |
inside(long offset,
long buffer) |
byte |
readByte(long offset)
Read byte at an offset
|
default long |
readLimit() |
long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
long |
safeLimit() |
long |
start() |
protected long |
translate(long offset) |
long |
underlyingCapacity()
Fetch the capacity of the underlying file
This can differ from the exposed capacity() of this bytes store (which has been page aligned)
|
default long |
writeLimit() |
@NotNull NativeBytesStore<Void> |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
addAndGetInt, addAndGetLong, addressForRead, addressForWrite, addressForWritePosition, appendUTF, appendUtf8, byteCheckSum, byteCheckSum, canReadDirect, capacity, compareAndSwapInt, compareAndSwapLong, copy, copyTo, copyToDirect, elasticByteBuffer, elasticByteBuffer, equals, fastHash, from, from, init, isDirectMemory, lazyNativeBytesStoreWithFixedCapacity, move, nativeRead, nativeStore, nativeStoreWithFixedCapacity, nativeWrite, peekUnsignedByte, performRelease, read, readDouble, readFloat, readIncompleteLong, readInt, readLong, readShort, readUnsignedByte, readVolatileByte, readVolatileInt, readVolatileLong, readVolatileShort, realCapacity, setAddress, sharedMemory, testAndSetInt, toString, toTemporaryDirectByteBuffer, underlyingObject, uninit, uninitialized, wrap, write, write, write, write0, writeByte, writeDouble, writeFloat, writeInt, writeLong, writeOrderedLong, writeShort, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShort, zeroOut
hashCode, performReleaseInBackground, readRemaining, writeRemaining
assertReferencesReleased, createdHere, disableReferenceTracing, enableReferenceTracing, refCount, referenceId, release, releaseLast, reserve, reservedBy, reserveTransfer, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, bytesStore, charAt, cipher, cipher, contentEquals, copyTo, empty, endsWith, equalBytes, from, isClear, isEmpty, isPresent, isPresent, length, longCheckSum, nativePointer, readWrite, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, writeMaxInt, writeMaxLong
addAndGetDouble, addAndGetFloat, compareUtf8, copyTo, copyTo, createCharToString, findByte, parseLong, peekVolatileInt, printable, readBoolean, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray
append, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
refCount, release, releaseLast, releaseLast, reserve, reservedBy, reserveTransfer, tryReserve
referenceId, referenceName, temporary
chars, codePoints
protected MappedBytesStore(net.openhft.chronicle.core.io.ReferenceOwner owner, MappedFile mappedFile, long start, long address, long capacity, long safeCapacity) throws IllegalStateException
IllegalStateException
public long underlyingCapacity()
@NotNull public @NotNull Bytes<Void> bytesForRead() throws IllegalStateException
IllegalStateException
- if this Bytes has been released.@NotNull public @NotNull VanillaBytes<Void> bytesForWrite() throws IllegalStateException
bytesForWrite
in interface BytesStore<NativeBytesStore<Void>,Void>
bytesForWrite
in class NativeBytesStore<Void>
IllegalStateException
public boolean inside(long offset)
BytesStore
public boolean inside(long offset, long buffer)
public long safeLimit()
safeLimit
in interface BytesStore<NativeBytesStore<Void>,Void>
safeLimit
in class NativeBytesStore<Void>
public byte readByte(long offset)
RandomDataInput
readByte
in interface RandomDataInput
readByte
in class NativeBytesStore<Void>
offset
- to read@NotNull public @NotNull NativeBytesStore<Void> writeOrderedInt(long offset, int i)
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<NativeBytesStore<Void>>
writeOrderedInt
in class NativeBytesStore<Void>
offset
- to write toi
- value to writeprotected long translate(long offset)
translate
in class NativeBytesStore<Void>
public long start()
start
in class AbstractBytesStore<NativeBytesStore<Void>,Void>
public long readPosition()
readPosition
in class AbstractBytesStore<NativeBytesStore<Void>,Void>
public long writePosition()
public long readLimit()
public long writeLimit()
public long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
public boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
Copyright © 2020. All rights reserved.