public class SingleTableStore<T extends Metadata> extends Object implements TableStore<T>
| Modifier and Type | Method and Description |
|---|---|
net.openhft.chronicle.core.values.LongValue |
acquireValueFor(CharSequence key,
long defaultValue) |
net.openhft.chronicle.bytes.MappedBytes |
bytes() |
void |
close() |
static <T,R> R |
doWithExclusiveLock(File file,
Function<T,? extends R> code,
Supplier<T> target) |
<R> R |
doWithExclusiveLock(Function<TableStore<T>,? extends R> code)
Acquires file-system level lock on the underlying file, to prevent concurrent access from multiple processes.
|
static <T,R> R |
doWithSharedLock(File file,
Function<T,? extends R> code,
Supplier<T> target) |
String |
dump() |
File |
file() |
boolean |
isClosed() |
T |
metadata() |
long |
refCount() |
void |
release() |
void |
reserve() |
String |
shortDump() |
String |
toString() |
boolean |
tryReserve() |
void |
writeMarshallable(net.openhft.chronicle.wire.WireOut wire) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacquireValueFor, readOnlypublic static final String SUFFIX
public static <T,R> R doWithSharedLock(File file, Function<T,? extends R> code, Supplier<T> target)
public static <T,R> R doWithExclusiveLock(File file, Function<T,? extends R> code, Supplier<T> target)
public boolean isClosed()
@NotNull public File file()
file in interface CommonStore@NotNull public String dump()
dump in interface CommonStore@NotNull public String shortDump()
shortDump in interface CommonStorepublic void reserve()
throws IllegalStateException
reserve in interface net.openhft.chronicle.core.ReferenceCountedIllegalStateExceptionpublic void release()
throws IllegalStateException
release in interface net.openhft.chronicle.core.ReferenceCountedIllegalStateExceptionpublic long refCount()
refCount in interface net.openhft.chronicle.core.ReferenceCountedpublic boolean tryReserve()
tryReserve in interface net.openhft.chronicle.core.ReferenceCountedpublic void close()
close in interface Closeableclose in interface AutoCloseable@NotNull public net.openhft.chronicle.bytes.MappedBytes bytes()
bytes in interface CommonStorepublic void writeMarshallable(@NotNull
net.openhft.chronicle.wire.WireOut wire)
writeMarshallable in interface net.openhft.chronicle.wire.WriteMarshallablepublic net.openhft.chronicle.core.values.LongValue acquireValueFor(CharSequence key, long defaultValue)
acquireValueFor in interface TableStore<T extends Metadata>public <R> R doWithExclusiveLock(Function<TableStore<T>,? extends R> code)
TableStore.acquireValueFor(CharSequence) calls, to atomically acquire
multiple values.doWithExclusiveLock in interface TableStore<T extends Metadata>R - result typecode - code block to execute using locked table storepublic T metadata()
metadata in interface TableStore<T extends Metadata>Copyright © 2019. All rights reserved.