public class TSOClient extends Object implements TSOProtocol, org.apache.curator.framework.recipes.cache.NodeCacheListener
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ZK_CLUSTER |
| Modifier and Type | Method and Description |
|---|---|
TSOFuture<Void> |
close()
Closes the communication with the TSO server
|
TSOFuture<Long> |
commit(long transactionId,
Set<? extends CellId> cells)
Returns the result of the conflict detection made on the server-side for the specified transaction
|
TSOFuture<Long> |
commit(long transactionId,
Set<? extends CellId> cells,
Set<? extends CellId> conflictFreeWriteSet)
Returns the result of the conflict detection made on the server-side for the specified transaction
|
OmidClientConfiguration.ConflictDetectionLevel |
getConflictDetectionLevel()
Used for family deletion
|
long |
getEpoch()
Returns the epoch of the current TSO server.
|
TSOFuture<Long> |
getFence(long tableId)
Returns a new fence timestamp assigned by on the server-side
|
TSOFuture<Long> |
getNewStartTimestamp()
Returns a new timestamp assigned by on the server-side
|
boolean |
isLowLatency()
checks if tso is low latency protocol
|
static TSOClient |
newInstance(OmidClientConfiguration tsoClientConf) |
void |
nodeChanged() |
void |
setConflictDetectionLevel(OmidClientConfiguration.ConflictDetectionLevel conflictDetectionLevel)
Used for family deletion testing
|
public static final String DEFAULT_ZK_CLUSTER
public static TSOClient newInstance(OmidClientConfiguration tsoClientConf) throws IOException
IOExceptionpublic TSOFuture<Long> getNewStartTimestamp()
TSOProtocolgetNewStartTimestamp in interface TSOProtocolTSOProtocol.getNewStartTimestamp()public TSOFuture<Long> commit(long transactionId, Set<? extends CellId> cells)
TSOProtocolcommit in interface TSOProtocoltransactionId - the transaction to check for conflictscells - the writeSet of the transaction, which includes all the modified cellsTSOProtocol.commit(long, Set)public TSOFuture<Long> commit(long transactionId, Set<? extends CellId> cells, Set<? extends CellId> conflictFreeWriteSet)
TSOProtocolcommit in interface TSOProtocoltransactionId - the transaction to check for conflictscells - the writeSet of the transaction, which includes all the modified cellsconflictFreeWriteSet - the conflict free writeSet of the transaction, needed only for table access information.TSOProtocol.commit(long, Set, Set)public TSOFuture<Long> getFence(long tableId)
TSOProtocolgetFence in interface TSOProtocoltableId - the table to create fence for.TSOProtocol.getFence(long)public TSOFuture<Void> close()
TSOProtocolclose in interface TSOProtocolTSOProtocol.close()public long getEpoch()
TSOProtocolgetEpoch in interface TSOProtocolTSOProtocol.getEpoch()public OmidClientConfiguration.ConflictDetectionLevel getConflictDetectionLevel()
getConflictDetectionLevel in interface TSOProtocolpublic void setConflictDetectionLevel(OmidClientConfiguration.ConflictDetectionLevel conflictDetectionLevel)
setConflictDetectionLevel in interface TSOProtocolpublic void nodeChanged()
throws Exception
nodeChanged in interface org.apache.curator.framework.recipes.cache.NodeCacheListenerExceptionpublic boolean isLowLatency()
TSOProtocolisLowLatency in interface TSOProtocolCopyright © 2011–2020 Apache Software Foundation. All rights reserved.