public interface TableStore<T extends Metadata> extends CommonStore
Modifier and Type | Method and Description |
---|---|
net.openhft.chronicle.core.values.LongValue |
acquireValueFor(CharSequence key)
Acquire
LongValue mapped to underlying file, providing atomic operations on the value that is shared
across threads and/or JVMs. |
<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.
|
T |
metadata() |
bytes, dump, file
refCount, release, release, releaseAll, reserve, tryReserve
net.openhft.chronicle.core.values.LongValue acquireValueFor(CharSequence key)
LongValue
mapped to underlying file, providing atomic operations on the value that is shared
across threads and/or JVMs.
Note: The implementation of this method is not required to guarantee that if the value does not exist in the file,
it will create one and only one value in the file in case of concurrent access. On the contrary, it's possible
that different threads or processes acquire LongValue
s pointing to different fields in the underlying
file. To prevent this, it is advised to use doWithExclusiveLock(Function)
to wrap calls to this method,
which will ensure exclusive access to file while initially acquiring values.key
- the key of the valueLongValue
object pointing to particular location in mapped underlying file<R> R doWithExclusiveLock(Function<TableStore<T>,? extends R> code)
acquireValueFor(CharSequence)
calls, to atomically acquire
multiple values.R
- result typecode
- code block to execute using locked table storeT metadata()
Copyright © 2018. All rights reserved.