public class BackendTransaction extends Object implements LoggableTransaction
| Modifier and Type | Field and Description |
|---|---|
static StaticBuffer |
EDGESTORE_MAX_KEY |
static StaticBuffer |
EDGESTORE_MIN_KEY |
static int |
MIN_TASKS_TO_PARALLELIZE |
| Constructor and Description |
|---|
BackendTransaction(CacheTransaction storeTx,
BaseTransactionConfig txConfig,
StoreFeatures features,
KCVSCache edgeStore,
KCVSCache indexStore,
KCVSCache txLogStore,
java.time.Duration maxReadTime,
Map<String,IndexTransaction> indexTx,
Executor threadPool) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireEdgeLock(StaticBuffer key,
Entry entry) |
void |
acquireEdgeLock(StaticBuffer key,
StaticBuffer column)
Acquires a lock for the key-column pair on the edge store which ensures that nobody else can take a lock on that
respective entry for the duration of this lock (but somebody could potentially still overwrite
the key-value entry without taking a lock).
|
void |
acquireIndexLock(StaticBuffer key,
Entry entry) |
void |
acquireIndexLock(StaticBuffer key,
StaticBuffer column)
Acquires a lock for the key-column pair on the property index which ensures that nobody else can take a lock on that
respective entry for the duration of this lock (but somebody could potentially still overwrite
the key-value entry without taking a lock).
|
void |
commit()
Commits the transaction and persists all modifications to the backend.
|
Map<String,Throwable> |
commitIndexes() |
void |
commitStorage() |
void |
disableCache() |
KeyIterator |
edgeStoreKeys(KeyRangeQuery range) |
KeyIterator |
edgeStoreKeys(SliceQuery sliceQuery) |
Map<StaticBuffer,EntryList> |
edgeStoreMultiQuery(List<StaticBuffer> keys,
SliceQuery query) |
EntryList |
edgeStoreQuery(KeySliceQuery query) |
void |
enableCache() |
BaseTransactionConfig |
getBaseTransactionConfig() |
IndexTransaction |
getIndexTransaction(String index) |
StoreTransaction |
getStoreTransaction() |
ExternalCachePersistor |
getTxLogPersistor() |
boolean |
hasAcquiredLock() |
EntryList |
indexQuery(KeySliceQuery query) |
List<String> |
indexQuery(String index,
IndexQuery query) |
void |
logMutations(DataOutput out) |
void |
mutateEdges(StaticBuffer key,
List<Entry> additions,
List<Entry> deletions)
Applies the specified insertion and deletion mutations on the edge store to the provided key.
|
void |
mutateIndex(StaticBuffer key,
List<Entry> additions,
List<Entry> deletions)
Applies the specified insertion and deletion mutations on the property index to the provided key.
|
Iterable<RawQuery.Result<String>> |
rawQuery(String index,
RawQuery query) |
void |
rollback()
Rolls back all transactions and makes sure that this does not get cut short
by exceptions.
|
public static final int MIN_TASKS_TO_PARALLELIZE
public static final StaticBuffer EDGESTORE_MIN_KEY
public static final StaticBuffer EDGESTORE_MAX_KEY
public BackendTransaction(CacheTransaction storeTx, BaseTransactionConfig txConfig, StoreFeatures features, KCVSCache edgeStore, KCVSCache indexStore, KCVSCache txLogStore, java.time.Duration maxReadTime, Map<String,IndexTransaction> indexTx, Executor threadPool)
public boolean hasAcquiredLock()
public StoreTransaction getStoreTransaction()
public ExternalCachePersistor getTxLogPersistor()
public BaseTransactionConfig getBaseTransactionConfig()
public IndexTransaction getIndexTransaction(String index)
public void disableCache()
public void enableCache()
public void commitStorage()
throws BackendException
BackendExceptionpublic void commit()
throws BackendException
BaseTransactionBaseTransaction.rollback() at most once per instance.commit in interface BaseTransactionBackendExceptionpublic void rollback()
throws BackendException
rollback in interface BaseTransactionBackendExceptionpublic void logMutations(DataOutput out)
logMutations in interface LoggableTransactionpublic void mutateEdges(StaticBuffer key, List<Entry> additions, List<Entry> deletions) throws BackendException
key - Keyadditions - List of entries (column + value) to be addeddeletions - List of columns to be removedBackendExceptionpublic void mutateIndex(StaticBuffer key, List<Entry> additions, List<Entry> deletions) throws BackendException
key - Keyadditions - List of entries (column + value) to be addeddeletions - List of columns to be removedBackendExceptionpublic void acquireEdgeLock(StaticBuffer key, StaticBuffer column) throws BackendException
key - Key on which to lockcolumn - Column the column on which to lockBackendExceptionpublic void acquireEdgeLock(StaticBuffer key, Entry entry) throws BackendException
BackendExceptionpublic void acquireIndexLock(StaticBuffer key, StaticBuffer column) throws BackendException
key - Key on which to lockcolumn - Column the column on which to lockBackendExceptionpublic void acquireIndexLock(StaticBuffer key, Entry entry) throws BackendException
BackendExceptionpublic EntryList edgeStoreQuery(KeySliceQuery query)
public Map<StaticBuffer,EntryList> edgeStoreMultiQuery(List<StaticBuffer> keys, SliceQuery query)
public KeyIterator edgeStoreKeys(SliceQuery sliceQuery)
public KeyIterator edgeStoreKeys(KeyRangeQuery range)
public EntryList indexQuery(KeySliceQuery query)
public List<String> indexQuery(String index, IndexQuery query)
public Iterable<RawQuery.Result<String>> rawQuery(String index, RawQuery query)
Copyright © 2012–2015. All rights reserved.