Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-17260

Enrich IgniteTransactions and Transaction interfaces with RO related methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-beta1
    • None
    • Hide
      Generally speaking, added an ability to run read-only transactions using KV API.

      Particularly following methods were added to IgniteTransactions and Transaction interfaces:
      - IgniteTransactoins#readOnly method is added to IgniteTransactoins. This one returns a decorated {@code IgniteTransactions} instance that will start read-only transactions.
      - Transaction#isReadOnly in order to check whether given transaction is read-only.
      - Transaction#readTimestamp - returns read timestamp for the given transaction if it is a read-only one or {code null} otherwise.
      Show
      Generally speaking, added an ability to run read-only transactions using KV API. Particularly following methods were added to IgniteTransactions and Transaction interfaces: - IgniteTransactoins#readOnly method is added to IgniteTransactoins. This one returns a decorated {@code IgniteTransactions} instance that will start read-only transactions. - Transaction#isReadOnly in order to check whether given transaction is read-only. - Transaction#readTimestamp - returns read timestamp for the given transaction if it is a read-only one or {code null} otherwise.

    Description

      It's required to explicitly register an intent of starting readOnly transaction, so following decorator producer is expected in IgniteTransactions

      /**
       * Decorated {@code IgniteTransactions} instance that will start read-only transactions.
       *
       * @return Decorated {@code IgniteTransactions} instance that will start read-only transactions.
       */
      IgniteTransactions readOnly(); 

      Besides that Transaction interface should be extended with

      boolean isReadOnly();

      and

      HybridTimestamp readTimestamp();

      methods.

      And finally three more overloaded methods will be added to the InternalTable

          CompletableFuture<BinaryRow> get(
                  BinaryRowEx keyRow,
                  @NotNull HybridTimestamp readTimestamp,
                  @NotNull ClusterNode recipientNode
          );
       
          CompletableFuture<Collection<BinaryRow>> getAll(
                  Collection<BinaryRowEx> keyRows,
                  @NotNull HybridTimestamp readTimestamp,
                  @NotNull ClusterNode recipientNode
          );
       
          Publisher<BinaryRow> scan(
                  int p,
                  @NotNull HybridTimestamp readTimestamp,
                  @NotNull ClusterNode recipientNode
          );
      

      Please, pay attention, that new parameter  @NotNull ClusterNode recipientNode is added.

      Attachments

        Issue Links

          Activity

            People

              alapin Alexander Lapin
              alapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h