You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "xtern (via GitHub)" <gi...@apache.org> on 2023/01/25 12:26:29 UTC

[GitHub] [ignite-3] xtern commented on a diff in pull request #1501: IGNITE-17951 Sql. Enlist partitions in transaction when preparing the execution plan.

xtern commented on code in PR #1501:
URL: https://github.com/apache/ignite-3/pull/1501#discussion_r1086576128


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItTableScanTest.java:
##########
@@ -768,4 +789,26 @@ private static Row createKeyRow(int id) {
 
         return new Row(SCHEMA, new ByteBufferRow(rowBuilder.toBytes()));
     }
+
+    /**
+     * Starts an RW transaction and enlists the specified partition in it.
+     *
+     * @param partId Partition ID.
+     * @return Transaction.
+     */
+    private InternalTransaction startTxWithEnlistedPartition(int partId) {
+        Ignite ignite = CLUSTER_NODES.get(0);
+
+        InternalTransaction tx = (InternalTransaction) ignite.transactions().begin();
+
+        InternalTable table = ((TableImpl) ignite.tables().table(TABLE_NAME)).internalTable();
+        TablePartitionId tblPartId = new TablePartitionId(table.tableId(), partId);
+        RaftGroupService raftSvc = table.partitionRaftGroupService(partId);
+        long term = raftSvc.refreshAndGetLeaderWithTerm().join().term();

Review Comment:
   No, since `IgniteTestUtils` should be used only in tests. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org