Class IgniteTxStateImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalStateAdapter
-
- org.apache.ignite.internal.processors.cache.transactions.IgniteTxStateImpl
-
- All Implemented Interfaces:
IgniteTxLocalState,IgniteTxState
public class IgniteTxStateImpl extends IgniteTxLocalStateAdapter
-
-
Constructor Summary
Constructors Constructor Description IgniteTxStateImpl()
-
Method Summary
-
Methods inherited from class org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalStateAdapter
onTxEnd
-
-
-
-
Method Detail
-
implicitSingle
public boolean implicitSingle()
- Returns:
- Flag indicating whether transaction is implicit with only one key.
-
firstCacheId
@Nullable public @Nullable Integer firstCacheId()
- Returns:
- First tx cache id.
-
cacheIds
@Nullable public @Nullable GridIntList cacheIds()
Gets caches ids affected with current tx.- Returns:
- tx cache ids.
-
unwindEvicts
public void unwindEvicts(GridCacheSharedContext cctx)
Unwind evicts for caches involved in this transaction.- Parameters:
cctx- Grid cache shared context.
-
awaitLastFuture
public void awaitLastFuture()
Awaits for previous async operations on active caches to be completed.
-
lastAsyncFuture
public GridCacheAdapter.FutureHolder lastAsyncFuture()
Previous async operations on caches.
-
validateTopology
public IgniteCheckedException validateTopology(GridCacheSharedContext cctx, boolean read, GridDhtTopologyFuture topFut)
- Parameters:
cctx- Context.read-Trueif validating for a read operation,falsefor write.topFut- Topology future.- Returns:
- Error if validation failed.
-
recovery
public boolean recovery()
- Returns:
- Recovery mode flag.
-
syncMode
public CacheWriteSynchronizationMode syncMode(GridCacheSharedContext cctx)
- Parameters:
cctx- Context.- Returns:
- Write synchronization mode.
-
addActiveCache
public void addActiveCache(GridCacheContext cacheCtx, boolean recovery, IgniteTxAdapter tx) throws IgniteCheckedException
- Parameters:
cacheCtx- Context.tx- Transaction.- Throws:
IgniteCheckedException- If cache check failed.
-
topologyReadLock
public GridDhtTopologyFuture topologyReadLock(GridCacheSharedContext cctx, GridFutureAdapter<?> fut)
- Parameters:
cctx- Context.fut- Future to finish with error if some cache is stopping.- Returns:
- Topology future.
-
topologyReadUnlock
public void topologyReadUnlock(GridCacheSharedContext cctx)
- Parameters:
cctx- Context.
-
storeWriteThrough
public boolean storeWriteThrough(GridCacheSharedContext sctx)
- Parameters:
sctx- Context.- Returns:
Trueif transaction is allowed to use store and transactions spans one or more caches with store enabled.
-
hasInterceptor
public boolean hasInterceptor(GridCacheSharedContext cctx)
- Parameters:
cctx- Context.- Returns:
Trueif transaction spans one or more caches with configured interceptor.
-
stores
public Collection<CacheStoreManager> stores(GridCacheSharedContext cctx)
- Parameters:
cctx- Context.- Returns:
- Configured stores for active caches.
-
onTxEnd
public void onTxEnd(GridCacheSharedContext cctx, IgniteInternalTx tx, boolean commit)
- Parameters:
cctx- Context.tx- Transaction.commit- Commit flag.
-
init
public boolean init(int txSize)
- Parameters:
txSize- Transaction size.- Returns:
Trueif transaction was successfully started.
-
initialized
public boolean initialized()
- Returns:
Trueif init method was called.
-
allEntries
public Collection<IgniteTxEntry> allEntries()
- Returns:
- All entries.
-
allEntriesCopy
public Collection<IgniteTxEntry> allEntriesCopy()
- Returns:
- All entries. Returned collection is copy of internal collection.
-
entry
public IgniteTxEntry entry(IgniteTxKey key)
- Parameters:
key- Key.- Returns:
- Entry.
-
hasWriteKey
public boolean hasWriteKey(IgniteTxKey key)
- Parameters:
key- Key.- Returns:
Trueif tx has write key.
-
readSet
public Set<IgniteTxKey> readSet()
- Returns:
- Read entries keys.
-
writeSet
public Set<IgniteTxKey> writeSet()
- Returns:
- Write entries keys.
-
writeEntries
public Collection<IgniteTxEntry> writeEntries()
- Returns:
- Write entries.
-
readEntries
public Collection<IgniteTxEntry> readEntries()
- Returns:
- Read entries.
-
writeMap
public Map<IgniteTxKey,IgniteTxEntry> writeMap()
- Returns:
- Write entries map.
-
readMap
public Map<IgniteTxKey,IgniteTxEntry> readMap()
- Returns:
- Read entries map.
-
empty
public boolean empty()
- Returns:
Trueif transaction is empty.
-
addEntry
public void addEntry(IgniteTxEntry entry)
- Parameters:
entry- Entry.
-
removeEntry
public void removeEntry(IgniteTxKey key)
- Parameters:
key- Key.
-
seal
public void seal()
-
singleWrite
public IgniteTxEntry singleWrite()
- Returns:
- Non-null entry if tx has only one write entry.
-
-