Class RemoteReadOnlyTransaction

java.lang.Object
org.apache.ignite.client.handler.requests.tx.RemoteReadOnlyTransaction
All Implemented Interfaces:
org.apache.ignite.internal.tx.InternalTransaction, org.apache.ignite.table.InternalTransactionBase, org.apache.ignite.tx.Transaction

public class RemoteReadOnlyTransaction extends Object implements org.apache.ignite.internal.tx.InternalTransaction
Read-only transaction view reconstructed from the attributes a request carried (see ClientTxUtils.TX_ID_RO_ATTRIBUTES): id, coordinator id, and read timestamp. The transaction itself is coordinated on another node; this view lets the local node serve reads at the transaction's snapshot - locking the node-local low watermark under the real transaction's id, exactly as a read routed through the coordinator would - without owning the transaction's lifecycle. Every lifecycle operation therefore throws.
  • Constructor Details

    • RemoteReadOnlyTransaction

      public RemoteReadOnlyTransaction(UUID txId, UUID coordinatorId, org.apache.ignite.internal.hlc.HybridTimestamp readTimestamp)
      Constructor.
      Parameters:
      txId - Transaction id.
      coordinatorId - Id of the node coordinating the transaction.
      readTimestamp - Timestamp the transaction reads at.
  • Method Details

    • id

      public UUID id()
      Specified by:
      id in interface org.apache.ignite.internal.tx.InternalTransaction
    • coordinatorId

      public UUID coordinatorId()
      Specified by:
      coordinatorId in interface org.apache.ignite.internal.tx.InternalTransaction
    • readTimestamp

      public org.apache.ignite.internal.hlc.HybridTimestamp readTimestamp()
      Specified by:
      readTimestamp in interface org.apache.ignite.table.InternalTransactionBase
    • schemaTimestamp

      public org.apache.ignite.internal.hlc.HybridTimestamp schemaTimestamp()
      Specified by:
      schemaTimestamp in interface org.apache.ignite.internal.tx.InternalTransaction
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface org.apache.ignite.tx.Transaction
    • implicit

      public boolean implicit()
      Specified by:
      implicit in interface org.apache.ignite.internal.tx.InternalTransaction
    • remote

      public boolean remote()
      Specified by:
      remote in interface org.apache.ignite.internal.tx.InternalTransaction
    • external

      public boolean external()
      Specified by:
      external in interface org.apache.ignite.internal.tx.InternalTransaction
    • external

      public void external(boolean external)
      Specified by:
      external in interface org.apache.ignite.internal.tx.InternalTransaction
    • state

      @Nullable public @Nullable org.apache.ignite.internal.tx.TxState state()
      Specified by:
      state in interface org.apache.ignite.internal.tx.InternalTransaction
    • getTimeout

      public long getTimeout()
      Specified by:
      getTimeout in interface org.apache.ignite.internal.tx.InternalTransaction
    • isRolledBackWithTimeoutExceeded

      public boolean isRolledBackWithTimeoutExceeded()
      Specified by:
      isRolledBackWithTimeoutExceeded in interface org.apache.ignite.internal.tx.InternalTransaction
    • isFinishingOrFinished

      public boolean isFinishingOrFinished()
      Specified by:
      isFinishingOrFinished in interface org.apache.ignite.internal.tx.InternalTransaction
    • processDelayedAck

      public void processDelayedAck(Object val, @Nullable @Nullable Throwable err)
      Specified by:
      processDelayedAck in interface org.apache.ignite.internal.tx.InternalTransaction
    • enlist

      public void enlist(org.apache.ignite.internal.replicator.ZonePartitionId replicationGroupId, int tableId, String primaryNodeConsistentId, long consistencyToken)
      Specified by:
      enlist in interface org.apache.ignite.internal.tx.InternalTransaction
    • enlistedPartition

      public org.apache.ignite.internal.tx.PendingTxPartitionEnlistment enlistedPartition(org.apache.ignite.internal.replicator.ZonePartitionId replicationGroupId)
      Specified by:
      enlistedPartition in interface org.apache.ignite.internal.tx.InternalTransaction
    • assignCommitPartition

      public boolean assignCommitPartition(org.apache.ignite.internal.replicator.ZonePartitionId commitPartitionId)
      Specified by:
      assignCommitPartition in interface org.apache.ignite.internal.tx.InternalTransaction
    • commitPartition

      public org.apache.ignite.internal.replicator.ZonePartitionId commitPartition()
      Specified by:
      commitPartition in interface org.apache.ignite.internal.tx.InternalTransaction
    • commitAsync

      public CompletableFuture<Void> commitAsync()
      Specified by:
      commitAsync in interface org.apache.ignite.tx.Transaction
    • rollbackAsync

      public CompletableFuture<Void> rollbackAsync()
      Specified by:
      rollbackAsync in interface org.apache.ignite.tx.Transaction
    • rollbackWithExceptionAsync

      public CompletableFuture<Void> rollbackWithExceptionAsync(Throwable throwable)
      Specified by:
      rollbackWithExceptionAsync in interface org.apache.ignite.internal.tx.InternalTransaction
    • finish

      public CompletableFuture<Void> finish(boolean commitIntent, org.apache.ignite.internal.hlc.HybridTimestamp executionTimestamp, boolean full, @Nullable @Nullable Throwable finishReason)
      Specified by:
      finish in interface org.apache.ignite.internal.tx.InternalTransaction
    • kill

      public CompletableFuture<Void> kill()
      Specified by:
      kill in interface org.apache.ignite.internal.tx.InternalTransaction
    • commit

      public void commit() throws org.apache.ignite.tx.TransactionException
      Specified by:
      commit in interface org.apache.ignite.tx.Transaction
      Throws:
      org.apache.ignite.tx.TransactionException
    • rollback

      public void rollback() throws org.apache.ignite.tx.TransactionException
      Specified by:
      rollback in interface org.apache.ignite.tx.Transaction
      Throws:
      org.apache.ignite.tx.TransactionException
    • enlistStore

      public <K, V> Map<K,Optional<V>> enlistStore(org.apache.ignite.cache.CacheStore<?,?> store)
      Specified by:
      enlistStore in interface org.apache.ignite.internal.tx.InternalTransaction