public class TransactionSessionAlias extends TransactionSession
TransactionSession
class to include Alias. In RocksDb a TransactionDB
instance contains the transaction classes and methods to provide atomicity.
Transactions are linked to a TransactionDb, a subclass of RocksDB. Each transaction may be named,
and the name must be unique. To enforce uniqueness considering these constraints, the name
formed will be a concatenation of Transaction Id, which is a UUID, the class name, which is also
a column family or the default column family, and the Alias, or none, which is the default database path.
From the TransactionManager
we link the transaction Id's to an instance of this, and associated transaction.
This class handles the aliased instances of TransactionSessions.Modifier and Type | Method and Description |
---|---|
Alias |
getAlias() |
org.rocksdb.Transaction |
getTransaction(TransactionId transactionId,
java.lang.String clazz,
boolean create)
Get the Transaction object formed from id and class.
|
boolean |
isTransactionLinked(TransactionId xid,
TransactionalMap tm,
java.util.concurrent.ConcurrentHashMap<java.lang.String,com.neocoretechs.rocksack.session.TransactionManager.SessionAndTransaction> tLink)
Check the mangled name identifier of transaction id, classname, and optionally the alias,
to identify this entry in the mapping of mangled name to SessionAndTransaction
instances from the passed map.
|
boolean |
linkSessionAndTransaction(TransactionId xid,
TransactionalMap tm,
java.util.concurrent.ConcurrentHashMap<java.lang.String,com.neocoretechs.rocksack.session.TransactionManager.SessionAndTransaction> tLink)
Called from associateSession and setTransaction to link a new mangled name to a new SessionAndTransaction instance
to populate the passed tLink map .
|
java.lang.String |
toString() |
BeginTransaction, BeginTransaction, getKVStore
public Alias getAlias()
public boolean linkSessionAndTransaction(TransactionId xid, TransactionalMap tm, java.util.concurrent.ConcurrentHashMap<java.lang.String,com.neocoretechs.rocksack.session.TransactionManager.SessionAndTransaction> tLink) throws java.io.IOException
linkSessionAndTransaction
in class TransactionSession
xid
- the TransactionIdtm
- the TransactionalMap we want to use for classname and sesssiontLink
- The map entry from TransactionManager idToNameToSessionAndTransaction from key xidjava.io.IOException
public boolean isTransactionLinked(TransactionId xid, TransactionalMap tm, java.util.concurrent.ConcurrentHashMap<java.lang.String,com.neocoretechs.rocksack.session.TransactionManager.SessionAndTransaction> tLink) throws java.io.IOException
isTransactionLinked
in class TransactionSession
xid
- the TransactionIdtm
- the TransactionalMap we want to use for classname and sesssiontLink
- The map entry from TransactionManager idToNameToSessionAndTransaction from key xidjava.io.IOException
public org.rocksdb.Transaction getTransaction(TransactionId transactionId, java.lang.String clazz, boolean create)
getTransaction
in class TransactionSession
transactionId
- clazz
- create
- true to create if not existingpublic java.lang.String toString()
toString
in class TransactionSession