public class SnapshotFilterImpl extends Object implements SnapshotFilter
| Constructor and Description |
|---|
SnapshotFilterImpl(VersionedCache versionedCache) |
| Modifier and Type | Method and Description |
|---|---|
io.kcache.KeyValueIterator<Comparable[],List<VersionedValue>> |
all(KarelDbTransaction transaction) |
List<VersionedValue> |
filterCellsForSnapshot(KarelDbTransaction transaction,
Comparable[] key,
List<VersionedValue> rawCells)
Filters the raw results and returns only those belonging to the current snapshot, as defined
by the transaction object.
|
List<VersionedValue> |
get(KarelDbTransaction transaction,
Comparable[] key) |
com.google.common.base.Optional<Long> |
getTSIfInSnapshot(KarelDbTransaction transaction,
io.kcache.KeyValue<Comparable[],VersionedValue> kv,
Map<Long,Long> commitCache) |
com.google.common.base.Optional<Long> |
getTSIfInTransaction(KarelDbTransaction transaction,
io.kcache.KeyValue<Comparable[],VersionedValue> kv) |
VersionedCache |
getVersionedCache() |
boolean |
isCommitted(KarelDbTransaction transaction,
KarelDbCellId cellId) |
org.apache.omid.committable.CommitTable.CommitTimestamp |
locateCellCommitTimestamp(KarelDbTransaction transaction,
long cellStartTimestamp,
org.apache.omid.transaction.CommitTimestampLocator locator)
This function returns the commit timestamp for a particular cell if the transaction was already committed in
the system.
|
io.kcache.KeyValueIterator<Comparable[],List<VersionedValue>> |
range(KarelDbTransaction transaction,
Comparable[] from,
boolean fromInclusive,
Comparable[] to,
boolean toInclusive) |
com.google.common.base.Optional<org.apache.omid.committable.CommitTable.CommitTimestamp> |
readCommitTimestampFromShadowCell(long cellStartTimestamp,
org.apache.omid.transaction.CommitTimestampLocator locator)
Check if the transaction commit data is in the shadow cell
|
com.google.common.base.Optional<Long> |
tryToLocateCellCommitTimestamp(KarelDbTransaction transaction,
io.kcache.KeyValue<Comparable[],VersionedValue> cell,
Map<Long,Long> commitCache) |
public SnapshotFilterImpl(VersionedCache versionedCache)
public VersionedCache getVersionedCache()
public com.google.common.base.Optional<org.apache.omid.committable.CommitTable.CommitTimestamp> readCommitTimestampFromShadowCell(long cellStartTimestamp,
org.apache.omid.transaction.CommitTimestampLocator locator)
throws IOException
cellStartTimestamp - the transaction start timestamp
locator
the timestamp locatorIOExceptionpublic org.apache.omid.committable.CommitTable.CommitTimestamp locateCellCommitTimestamp(KarelDbTransaction transaction, long cellStartTimestamp, org.apache.omid.transaction.CommitTimestampLocator locator) throws IOException
cellStartTimestamp - start timestamp of the cell to locate the commit timestamp for.locator - a locator to find the commit timestamp in the system.IOException - in case of any I/O issuespublic com.google.common.base.Optional<Long> tryToLocateCellCommitTimestamp(KarelDbTransaction transaction, io.kcache.KeyValue<Comparable[],VersionedValue> cell, Map<Long,Long> commitCache) throws IOException
IOExceptionpublic com.google.common.base.Optional<Long> getTSIfInTransaction(KarelDbTransaction transaction, io.kcache.KeyValue<Comparable[],VersionedValue> kv)
public com.google.common.base.Optional<Long> getTSIfInSnapshot(KarelDbTransaction transaction, io.kcache.KeyValue<Comparable[],VersionedValue> kv, Map<Long,Long> commitCache) throws IOException
IOExceptionpublic List<VersionedValue> filterCellsForSnapshot(KarelDbTransaction transaction, Comparable[] key, List<VersionedValue> rawCells) throws IOException
transaction - Defines the current snapshotrawCells - Raw cells that we are going to filterIOExceptionpublic List<VersionedValue> get(KarelDbTransaction transaction, Comparable[] key)
get in interface SnapshotFilterpublic io.kcache.KeyValueIterator<Comparable[],List<VersionedValue>> range(KarelDbTransaction transaction, Comparable[] from, boolean fromInclusive, Comparable[] to, boolean toInclusive)
range in interface SnapshotFilterpublic io.kcache.KeyValueIterator<Comparable[],List<VersionedValue>> all(KarelDbTransaction transaction)
all in interface SnapshotFilterpublic boolean isCommitted(KarelDbTransaction transaction, KarelDbCellId cellId) throws org.apache.omid.transaction.TransactionException
org.apache.omid.transaction.TransactionExceptionCopyright © 2020. All rights reserved.