[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072415322


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##
@@ -405,42 +373,148 @@ private IndexMetaTree createIndexMetaTree(
 }
 
 @Override
-public CompletableFuture startRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
+// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+mvPartitionStorage.close();
 
-@Override
-public CompletableFuture abortRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
+return 
destroyPartitionPhysically(createGroupPartitionId(mvPartitionStorage.partitionId()));
 }
 
 @Override
-public CompletableFuture finishRebalancePartition(int partitionId, 
long lastAppliedIndex, long lastAppliedTerm) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
clearStorageAndUpdateDataStructures(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+GroupPartitionId groupPartitionId = 
createGroupPartitionId(mvPartitionStorage.partitionId());
 
-@Override
-CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
-int partitionId = mvPartitionStorage.partitionId();
+return destroyPartitionPhysically(groupPartitionId).thenAccept(unused 
-> {
+TableView tableView = tableConfig.value();
 
-// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
-// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+PersistentPageMemory pageMemory = dataRegion.pageMemory();
 
-mvPartitionStorage.close();
+int partitionId = groupPartitionId.getPartitionId();
+
+PartitionMeta meta = getOrCreatePartitionMeta(groupPartitionId, 
ensurePartitionFilePageStore(tableView, groupPartitionId));
+
+inCheckpointLock(() -> {
+RowVersionFreeList rowVersionFreeList = 
createRowVersionFreeList(tableView, partitionId, pageMemory, meta);
 
-int tableId = tableCfg.tableId().value();
+IndexColumnsFreeList indexColumnsFreeList
+= createIndexColumnsFreeList(tableView, partitionId, 
rowVersionFreeList, pageMemory, meta);
 
-GroupPartitionId groupPartitionId = new GroupPartitionId(tableId, 
partitionId);
+VersionChainTree versionChainTree = 
createVersionChainTree(tableView, partitionId, rowVersionFreeList, pageMemory, 
meta);
 
+IndexMetaTree indexMetaTree = createIndexMetaTree(tableView, 
partitionId, rowVersionFreeList, pageMemory, meta);
+
+((PersistentPageMemoryMvPartitionStorage) 
mvPartitionStorage).updateDataStructuresOnRebalance(
+meta,
+rowVersionFreeList,
+indexColumnsFreeList,
+versionChainTree,
+indexMetaTree
+);
+
+return null;
+});
+});
+}
+
+private CompletableFuture 
destroyPartitionPhysically(GroupPartitionId groupPartitionId) {
 
dataRegion.filePageStoreManager().getStore(groupPartitionId).markToDestroy();
 
-dataRegion.pageMemory().invalidate(tableId, partitionId);
+dataRegion.pageMemory().invalidate(groupPartitionId.getGroupId(), 
groupPartitionId.getPartitionId());
 
 return 
dataRegion.checkpointManager().onPartitionDestruction(groupPartitionId)
 .thenAccept(unused -> 
dataRegion.partitionMetaManager().removeMeta(groupPartitionId))
 .thenCompose(unused -> 
dataRegion.filePageStoreManager().destroyPartition(groupPartitionId));
 }
+
+private GroupPartitionId createGroupPartitionId(int partitionId) {
+return new GroupPartitionId(tableConfig.tableId().value(), 
partitionId);
+}
+
+private  V inCheckpointLock(Supplier supplier) {
+CheckpointTimeoutLock checkpointTimeoutLock = 
dataRegion.checkpointManager().checkpointTimeoutLock();
+
+checkpointTimeoutLock.checkpointReadLock();
+
+try {
+return supplier.get();
+} finally {
+checkpointTimeoutLock.checkpointReadUnlock();
+}
+}
+
+private PartitionM

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072414034


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##
@@ -405,42 +373,148 @@ private IndexMetaTree createIndexMetaTree(
 }
 
 @Override
-public CompletableFuture startRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
+// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+mvPartitionStorage.close();
 
-@Override
-public CompletableFuture abortRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
+return 
destroyPartitionPhysically(createGroupPartitionId(mvPartitionStorage.partitionId()));
 }
 
 @Override
-public CompletableFuture finishRebalancePartition(int partitionId, 
long lastAppliedIndex, long lastAppliedTerm) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
clearStorageAndUpdateDataStructures(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+GroupPartitionId groupPartitionId = 
createGroupPartitionId(mvPartitionStorage.partitionId());
 
-@Override
-CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
-int partitionId = mvPartitionStorage.partitionId();
+return destroyPartitionPhysically(groupPartitionId).thenAccept(unused 
-> {
+TableView tableView = tableConfig.value();
 
-// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
-// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+PersistentPageMemory pageMemory = dataRegion.pageMemory();
 
-mvPartitionStorage.close();
+int partitionId = groupPartitionId.getPartitionId();
+
+PartitionMeta meta = getOrCreatePartitionMeta(groupPartitionId, 
ensurePartitionFilePageStore(tableView, groupPartitionId));
+
+inCheckpointLock(() -> {
+RowVersionFreeList rowVersionFreeList = 
createRowVersionFreeList(tableView, partitionId, pageMemory, meta);
 
-int tableId = tableCfg.tableId().value();
+IndexColumnsFreeList indexColumnsFreeList
+= createIndexColumnsFreeList(tableView, partitionId, 
rowVersionFreeList, pageMemory, meta);
 
-GroupPartitionId groupPartitionId = new GroupPartitionId(tableId, 
partitionId);
+VersionChainTree versionChainTree = 
createVersionChainTree(tableView, partitionId, rowVersionFreeList, pageMemory, 
meta);
 
+IndexMetaTree indexMetaTree = createIndexMetaTree(tableView, 
partitionId, rowVersionFreeList, pageMemory, meta);
+
+((PersistentPageMemoryMvPartitionStorage) 
mvPartitionStorage).updateDataStructuresOnRebalance(
+meta,
+rowVersionFreeList,
+indexColumnsFreeList,
+versionChainTree,
+indexMetaTree
+);
+
+return null;
+});
+});
+}
+
+private CompletableFuture 
destroyPartitionPhysically(GroupPartitionId groupPartitionId) {
 
dataRegion.filePageStoreManager().getStore(groupPartitionId).markToDestroy();
 
-dataRegion.pageMemory().invalidate(tableId, partitionId);
+dataRegion.pageMemory().invalidate(groupPartitionId.getGroupId(), 
groupPartitionId.getPartitionId());
 
 return 
dataRegion.checkpointManager().onPartitionDestruction(groupPartitionId)
 .thenAccept(unused -> 
dataRegion.partitionMetaManager().removeMeta(groupPartitionId))
 .thenCompose(unused -> 
dataRegion.filePageStoreManager().destroyPartition(groupPartitionId));
 }
+
+private GroupPartitionId createGroupPartitionId(int partitionId) {
+return new GroupPartitionId(tableConfig.tableId().value(), 
partitionId);
+}
+
+private  V inCheckpointLock(Supplier supplier) {
+CheckpointTimeoutLock checkpointTimeoutLock = 
dataRegion.checkpointManager().checkpointTimeoutLock();
+
+checkpointTimeoutLock.checkpointReadLock();
+
+try {
+return supplier.get();
+} finally {
+checkpointTimeoutLock.checkpointReadUnlock();
+}
+}
+
+private PartitionM

[GitHub] [ignite-3] Flaugh24 commented on a diff in pull request #1502: IGNITE-18491: Add tests for completers

2023-01-17 Thread GitBox


Flaugh24 commented on code in PR #1502:
URL: https://github.com/apache/ignite-3/pull/1502#discussion_r1072407243


##
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
 await().until(() -> complete(givenParsedLine), 
containsInAnyOrder(allNodeNames().toArray()));
 }
 
+@Test
+@DisplayName("jdbc url suggested after --jdbc-url option")
+void suggestedJdbcUrl() {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+// Then
+List completions = complete(words("sql", "--jdbc-url", ""));
+assertThat(completions, 
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+}
+
+private Stream clusterUrlSource() {
+return Stream.of(
+words("cluster", "config", "show", "--cluster-endpoint-url", 
""),
+words("cluster", "config", "update", "--cluster-endpoint-url", 
""),
+words("cluster", "status", "--cluster-endpoint-url", ""),
+words("cluster", "init", "--cluster-endpoint-url", "")
+).map(this::named).map(Arguments::of);
+}
+
+@ParameterizedTest
+@MethodSource("clusterUrlSource")
+@DisplayName("cluster url suggested after --cluster-endpoint-url option")
+void suggestedClusterUrl(ParsedLine parsedLine) {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+// Then
+String[] expectedUrls = 
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+assertThat("For given parsed words: " + parsedLine.words(),
+complete(parsedLine),
+containsInAnyOrder(expectedUrls));
+}
+
+@Test
+@DisplayName("files suggested after -script-file option")
+void suggestedScriptFile() {
+
+// Given
+
+// Create temp folder
+File folder = Files.newTemporaryFolder();
+
+// Create temp files
+String script1 = folder.getPath() + File.separator + "script1.sql";
+Files.newFile(script1).deleteOnExit();
+
+String script2 = folder.getPath() + File.separator + "script2.sql";
+Files.newFile(script2).deleteOnExit();
+
+String someFile = folder.getPath() + File.separator + "someFile.sql";
+Files.newFile(someFile).deleteOnExit();
+
+// Then

Review Comment:
   done



##
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
 await().until(() -> complete(givenParsedLine), 
containsInAnyOrder(allNodeNames().toArray()));
 }
 
+@Test
+@DisplayName("jdbc url suggested after --jdbc-url option")
+void suggestedJdbcUrl() {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+// Then
+List completions = complete(words("sql", "--jdbc-url", ""));
+assertThat(completions, 
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+}
+
+private Stream clusterUrlSource() {
+return Stream.of(
+words("cluster", "config", "show", "--cluster-endpoint-url", 
""),
+words("cluster", "config", "update", "--cluster-endpoint-url", 
""),
+words("cluster", "status", "--cluster-endpoint-url", ""),
+words("cluster", "init", "--cluster-endpoint-url", "")
+).map(this::named).map(Arguments::of);
+}
+
+@ParameterizedTest
+@MethodSource("clusterUrlSource")
+@DisplayName("cluster url suggested after --cluster-endpoint-url option")
+void suggestedClusterUrl(ParsedLine parsedLine) {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+// Then
+String[] expectedUrls = 
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+assertThat("For given parsed words: " + parsedLine.words(),
+complete(parsedLine),
+containsInAnyOrder(expectedUrls));
+}
+
+@Test
+@DisplayName("files suggested after -script-file option")
+void suggestedScriptFile() {
+
+// Given
+
+// Create temp folder
+File folder = Files.newTemporaryFolder();
+
+// Create temp files
+String script1 = folder.getPath() + File.separator + "script1.sql";
+Files.newFile(script1).deleteOnExit();
+
+String script2 = folder.getPath() + File.separator + "script2.sql";
+Files.newFile(script2).del

[GitHub] [ignite-3] Flaugh24 commented on a diff in pull request #1502: IGNITE-18491: Add tests for completers

2023-01-17 Thread GitBox


Flaugh24 commented on code in PR #1502:
URL: https://github.com/apache/ignite-3/pull/1502#discussion_r1072406356


##
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
 await().until(() -> complete(givenParsedLine), 
containsInAnyOrder(allNodeNames().toArray()));
 }
 
+@Test
+@DisplayName("jdbc url suggested after --jdbc-url option")
+void suggestedJdbcUrl() {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+// Then
+List completions = complete(words("sql", "--jdbc-url", ""));
+assertThat(completions, 
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+}
+
+private Stream clusterUrlSource() {
+return Stream.of(
+words("cluster", "config", "show", "--cluster-endpoint-url", 
""),
+words("cluster", "config", "update", "--cluster-endpoint-url", 
""),
+words("cluster", "status", "--cluster-endpoint-url", ""),
+words("cluster", "init", "--cluster-endpoint-url", "")
+).map(this::named).map(Arguments::of);
+}
+
+@ParameterizedTest
+@MethodSource("clusterUrlSource")
+@DisplayName("cluster url suggested after --cluster-endpoint-url option")
+void suggestedClusterUrl(ParsedLine parsedLine) {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+// Then
+String[] expectedUrls = 
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+assertThat("For given parsed words: " + parsedLine.words(),
+complete(parsedLine),
+containsInAnyOrder(expectedUrls));
+}
+
+@Test
+@DisplayName("files suggested after -script-file option")
+void suggestedScriptFile() {
+

Review Comment:
   done



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] Flaugh24 commented on a diff in pull request #1502: IGNITE-18491: Add tests for completers

2023-01-17 Thread GitBox


Flaugh24 commented on code in PR #1502:
URL: https://github.com/apache/ignite-3/pull/1502#discussion_r1072405813


##
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
 await().until(() -> complete(givenParsedLine), 
containsInAnyOrder(allNodeNames().toArray()));
 }
 
+@Test
+@DisplayName("jdbc url suggested after --jdbc-url option")
+void suggestedJdbcUrl() {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+// Then
+List completions = complete(words("sql", "--jdbc-url", ""));
+assertThat(completions, 
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+}
+
+private Stream clusterUrlSource() {
+return Stream.of(
+words("cluster", "config", "show", "--cluster-endpoint-url", 
""),
+words("cluster", "config", "update", "--cluster-endpoint-url", 
""),
+words("cluster", "status", "--cluster-endpoint-url", ""),
+words("cluster", "init", "--cluster-endpoint-url", "")
+).map(this::named).map(Arguments::of);
+}
+
+@ParameterizedTest
+@MethodSource("clusterUrlSource")
+@DisplayName("cluster url suggested after --cluster-endpoint-url option")
+void suggestedClusterUrl(ParsedLine parsedLine) {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+// Then
+String[] expectedUrls = 
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+assertThat("For given parsed words: " + parsedLine.words(),
+complete(parsedLine),
+containsInAnyOrder(expectedUrls));
+}
+
+@Test
+@DisplayName("files suggested after -script-file option")

Review Comment:
   done



##
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
 await().until(() -> complete(givenParsedLine), 
containsInAnyOrder(allNodeNames().toArray()));
 }
 
+@Test
+@DisplayName("jdbc url suggested after --jdbc-url option")
+void suggestedJdbcUrl() {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+// Then
+List completions = complete(words("sql", "--jdbc-url", ""));
+assertThat(completions, 
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+}
+
+private Stream clusterUrlSource() {
+return Stream.of(
+words("cluster", "config", "show", "--cluster-endpoint-url", 
""),
+words("cluster", "config", "update", "--cluster-endpoint-url", 
""),
+words("cluster", "status", "--cluster-endpoint-url", ""),
+words("cluster", "init", "--cluster-endpoint-url", "")
+).map(this::named).map(Arguments::of);
+}
+
+@ParameterizedTest
+@MethodSource("clusterUrlSource")
+@DisplayName("cluster url suggested after --cluster-endpoint-url option")
+void suggestedClusterUrl(ParsedLine parsedLine) {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+// Then
+String[] expectedUrls = 
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+assertThat("For given parsed words: " + parsedLine.words(),
+complete(parsedLine),
+containsInAnyOrder(expectedUrls));
+}
+
+@Test
+@DisplayName("files suggested after -script-file option")
+void suggestedScriptFile() {
+
+// Given
+
+// Create temp folder
+File folder = Files.newTemporaryFolder();
+
+// Create temp files
+String script1 = folder.getPath() + File.separator + "script1.sql";
+Files.newFile(script1).deleteOnExit();
+
+String script2 = folder.getPath() + File.separator + "script2.sql";
+Files.newFile(script2).deleteOnExit();
+
+String someFile = folder.getPath() + File.separator + "someFile.sql";
+Files.newFile(someFile).deleteOnExit();
+
+// Then
+
+// Search in the folder
+List completions1 = complete(words("sql", "--script-file", 
folder.getPath()));
+// Contains all files
+assertThat(completions1, contains(script1, script2, someFile));
+
+// Search in the folder for files which starts with 'scrpit'
+List completions2 = complete(words("sql", "--script-file", 
folder.getPath() + File.separator + "scr

[GitHub] [ignite-3] Flaugh24 commented on a diff in pull request #1502: IGNITE-18491: Add tests for completers

2023-01-17 Thread GitBox


Flaugh24 commented on code in PR #1502:
URL: https://github.com/apache/ignite-3/pull/1502#discussion_r1072405500


##
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
 await().until(() -> complete(givenParsedLine), 
containsInAnyOrder(allNodeNames().toArray()));
 }
 
+@Test
+@DisplayName("jdbc url suggested after --jdbc-url option")
+void suggestedJdbcUrl() {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+// Then
+List completions = complete(words("sql", "--jdbc-url", ""));
+assertThat(completions, 
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+}
+
+private Stream clusterUrlSource() {
+return Stream.of(
+words("cluster", "config", "show", "--cluster-endpoint-url", 
""),
+words("cluster", "config", "update", "--cluster-endpoint-url", 
""),
+words("cluster", "status", "--cluster-endpoint-url", ""),
+words("cluster", "init", "--cluster-endpoint-url", "")
+).map(this::named).map(Arguments::of);
+}
+
+@ParameterizedTest
+@MethodSource("clusterUrlSource")
+@DisplayName("cluster url suggested after --cluster-endpoint-url option")
+void suggestedClusterUrl(ParsedLine parsedLine) {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+// Then
+String[] expectedUrls = 
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+assertThat("For given parsed words: " + parsedLine.words(),
+complete(parsedLine),
+containsInAnyOrder(expectedUrls));
+}
+
+@Test
+@DisplayName("files suggested after -script-file option")
+void suggestedScriptFile() {
+
+// Given

Review Comment:
   done



##
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
 await().until(() -> complete(givenParsedLine), 
containsInAnyOrder(allNodeNames().toArray()));
 }
 
+@Test
+@DisplayName("jdbc url suggested after --jdbc-url option")
+void suggestedJdbcUrl() {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+// Then
+List completions = complete(words("sql", "--jdbc-url", ""));
+assertThat(completions, 
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+}
+
+private Stream clusterUrlSource() {
+return Stream.of(
+words("cluster", "config", "show", "--cluster-endpoint-url", 
""),
+words("cluster", "config", "update", "--cluster-endpoint-url", 
""),
+words("cluster", "status", "--cluster-endpoint-url", ""),
+words("cluster", "init", "--cluster-endpoint-url", "")
+).map(this::named).map(Arguments::of);
+}
+
+@ParameterizedTest
+@MethodSource("clusterUrlSource")
+@DisplayName("cluster url suggested after --cluster-endpoint-url option")
+void suggestedClusterUrl(ParsedLine parsedLine) {
+// Given
+connected();
+// And the first update is fetched
+await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+// Then
+String[] expectedUrls = 
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+assertThat("For given parsed words: " + parsedLine.words(),
+complete(parsedLine),
+containsInAnyOrder(expectedUrls));
+}
+
+@Test
+@DisplayName("files suggested after -script-file option")
+void suggestedScriptFile() {
+
+// Given
+
+// Create temp folder
+File folder = Files.newTemporaryFolder();
+
+// Create temp files
+String script1 = folder.getPath() + File.separator + "script1.sql";
+Files.newFile(script1).deleteOnExit();
+
+String script2 = folder.getPath() + File.separator + "script2.sql";
+Files.newFile(script2).deleteOnExit();
+
+String someFile = folder.getPath() + File.separator + "someFile.sql";
+Files.newFile(someFile).deleteOnExit();
+
+// Then
+
+// Search in the folder
+List completions1 = complete(words("sql", "--script-file", 
folder.getPath()));
+// Contains all files
+assertThat(completions1, contains(script1, script2, someFile));
+
+// Search in the folder for files which starts with 'scrpit'
+List completions2 = complete(words("sql", "--s

[GitHub] [ignite] ivandasch opened a new pull request, #10484: IGNITE-18438 .NET: Fix marshalling of nested binarizable structures with different schemas.

2023-01-17 Thread GitBox


ivandasch opened a new pull request, #10484:
URL: https://github.com/apache/ignite/pull/10484

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE- Change summary` where 
`` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers 
list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check 
PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to 
Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation 
rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding 
Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity 
Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email d...@ignite.apache.org or ask anу advice 
on http://asf.slack.com _#ignite_ channel.
   


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-extensions] shishkovilja closed pull request #199: IGNITE-18209 Add check of a lag in a metadata topic

2023-01-17 Thread GitBox


shishkovilja closed pull request #199: IGNITE-18209 Add check of a lag in a 
metadata topic
URL: https://github.com/apache/ignite-extensions/pull/199


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072346248


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##
@@ -96,49 +98,22 @@ public boolean isVolatile() {
 
 @Override
 protected void finishDestruction() {
-dataRegion.pageMemory().onGroupDestroyed(tableCfg.tableId().value());
+
dataRegion.pageMemory().onGroupDestroyed(tableConfig.tableId().value());
 }
 
 @Override
 public PersistentPageMemoryMvPartitionStorage createMvPartitionStorage(int 
partitionId) {
-CompletableFuture partitionDestroyFuture = 
partitionIdDestroyFutureMap.get(partitionId);
+waitPartitionToBeDestroyed(partitionId);
 
-if (partitionDestroyFuture != null) {
-try {
-// Time is chosen randomly (long enough) so as not to call 
#join().
-partitionDestroyFuture.get(10, TimeUnit.SECONDS);
-} catch (Exception e) {
-throw new StorageException("Error waiting for the destruction 
of the previous version of the partition: " + partitionId, e);
-}
-}
+TableView tableView = tableConfig.value();
 
-TableView tableView = tableCfg.value();
+GroupPartitionId groupPartitionId = 
createGroupPartitionId(partitionId);
 
-GroupPartitionId groupPartitionId = new 
GroupPartitionId(tableView.tableId(), partitionId);
+PartitionMeta meta = 
getOrCreatePartitionMetaWithRecreatePartitionPageStoreIfRebalanceNotCompleted(groupPartitionId);

Review Comment:
   I didn't put it in a separate lock block, but moved it outside of it.
   This is not an error since we are reading the `PartitionMeta` directly from 
the file, not using `PageMemory`.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072334426


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##
@@ -405,42 +373,148 @@ private IndexMetaTree createIndexMetaTree(
 }
 
 @Override
-public CompletableFuture startRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
+// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+mvPartitionStorage.close();
 
-@Override
-public CompletableFuture abortRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
+return 
destroyPartitionPhysically(createGroupPartitionId(mvPartitionStorage.partitionId()));
 }
 
 @Override
-public CompletableFuture finishRebalancePartition(int partitionId, 
long lastAppliedIndex, long lastAppliedTerm) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
clearStorageAndUpdateDataStructures(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+GroupPartitionId groupPartitionId = 
createGroupPartitionId(mvPartitionStorage.partitionId());
 
-@Override
-CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
-int partitionId = mvPartitionStorage.partitionId();
+return destroyPartitionPhysically(groupPartitionId).thenAccept(unused 
-> {
+TableView tableView = tableConfig.value();
 
-// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
-// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+PersistentPageMemory pageMemory = dataRegion.pageMemory();
 
-mvPartitionStorage.close();
+int partitionId = groupPartitionId.getPartitionId();
+
+PartitionMeta meta = getOrCreatePartitionMeta(groupPartitionId, 
ensurePartitionFilePageStore(tableView, groupPartitionId));
+
+inCheckpointLock(() -> {
+RowVersionFreeList rowVersionFreeList = 
createRowVersionFreeList(tableView, partitionId, pageMemory, meta);
 
-int tableId = tableCfg.tableId().value();
+IndexColumnsFreeList indexColumnsFreeList
+= createIndexColumnsFreeList(tableView, partitionId, 
rowVersionFreeList, pageMemory, meta);
 
-GroupPartitionId groupPartitionId = new GroupPartitionId(tableId, 
partitionId);
+VersionChainTree versionChainTree = 
createVersionChainTree(tableView, partitionId, rowVersionFreeList, pageMemory, 
meta);
 
+IndexMetaTree indexMetaTree = createIndexMetaTree(tableView, 
partitionId, rowVersionFreeList, pageMemory, meta);
+
+((PersistentPageMemoryMvPartitionStorage) 
mvPartitionStorage).updateDataStructuresOnRebalance(
+meta,
+rowVersionFreeList,
+indexColumnsFreeList,
+versionChainTree,
+indexMetaTree
+);
+
+return null;
+});
+});
+}
+
+private CompletableFuture 
destroyPartitionPhysically(GroupPartitionId groupPartitionId) {
 
dataRegion.filePageStoreManager().getStore(groupPartitionId).markToDestroy();
 
-dataRegion.pageMemory().invalidate(tableId, partitionId);
+dataRegion.pageMemory().invalidate(groupPartitionId.getGroupId(), 
groupPartitionId.getPartitionId());

Review Comment:
   I think we need to fix this in the future.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072329420


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##
@@ -405,42 +373,148 @@ private IndexMetaTree createIndexMetaTree(
 }
 
 @Override
-public CompletableFuture startRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
+// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+mvPartitionStorage.close();
 
-@Override
-public CompletableFuture abortRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
+return 
destroyPartitionPhysically(createGroupPartitionId(mvPartitionStorage.partitionId()));
 }
 
 @Override
-public CompletableFuture finishRebalancePartition(int partitionId, 
long lastAppliedIndex, long lastAppliedTerm) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
clearStorageAndUpdateDataStructures(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {

Review Comment:
   It is not expected to be overridden, it overrides method 
`org.apache.ignite.internal.storage.pagememory.AbstractPageMemoryTableStorage#clearStorageAndUpdateDataStructures`.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072329420


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##
@@ -405,42 +373,148 @@ private IndexMetaTree createIndexMetaTree(
 }
 
 @Override
-public CompletableFuture startRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+// It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
+// compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+mvPartitionStorage.close();
 
-@Override
-public CompletableFuture abortRebalancePartition(int partitionId) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
+return 
destroyPartitionPhysically(createGroupPartitionId(mvPartitionStorage.partitionId()));
 }
 
 @Override
-public CompletableFuture finishRebalancePartition(int partitionId, 
long lastAppliedIndex, long lastAppliedTerm) {
-// TODO: IGNITE-18029 Implement
-throw new UnsupportedOperationException();
-}
+CompletableFuture 
clearStorageAndUpdateDataStructures(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {

Review Comment:
   It is not expected to be overridden.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072328103


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##
@@ -210,7 +177,8 @@ private FilePageStore 
ensurePartitionFilePageStore(TableView tableView, GroupPar
 /**
  * Returns id of the last started checkpoint, or {@code null} if no 
checkpoints were started yet.
  */
-public @Nullable UUID lastCheckpointId() {
+@Nullable
+private UUID lastCheckpointId() {

Review Comment:
   Fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072279893


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/PersistentPageMemoryMvPartitionStorage.java:
##
@@ -216,51 +197,41 @@ public void lastApplied(long lastAppliedIndex, long 
lastAppliedTerm) throws Stor
 
 @Override
 public long persistedIndex() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
-
-try {
-return persistedIndex;
-} finally {
-closeBusyLock.leaveBusy();
-}
+return busy(() -> persistedIndex);
 }
 
 @Override
 @Nullable
 public RaftGroupConfiguration committedGroupConfiguration() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
-
-try {
-replicationProtocolGroupConfigReadWriteLock.readLock().lock();
-
+return busy(() -> {

Review Comment:
   Tried to fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072276069


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/AbstractPageMemoryMvPartitionStorage.java:
##
@@ -800,67 +732,65 @@ public PartitionTimestampCursor scan(HybridTimestamp 
timestamp) throws StorageEx
 } else {
 return new TimestampCursor(treeCursor, timestamp);
 }
-} finally {
-closeBusyLock.leaveBusy();
-}
+});
 }
 
 @Override
 public @Nullable RowId closestRowId(RowId lowerBound) throws 
StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
this::createStorageInfo);
 
-try (Cursor cursor = versionChainTree.find(new 
VersionChainKey(lowerBound), null)) {
-return cursor.hasNext() ? cursor.next().rowId() : null;
-} catch (Exception e) {
-throw new StorageException("Error occurred while trying to read a 
row id", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+try (Cursor cursor = versionChainTree.find(new 
VersionChainKey(lowerBound), null)) {
+return cursor.hasNext() ? cursor.next().rowId() : null;
+} catch (Exception e) {
+throw new StorageException("Error occurred while trying to 
read a row id", e);
+}
+});
 }
 
 @Override
 public long rowsCount() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
this::createStorageInfo);
 
-try {
-return versionChainTree.size();
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Error occurred while fetching the 
size.", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+try {
+return versionChainTree.size();
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Error occurred while fetching the 
size", e);
+}
+});
 }
 
 private abstract class BasePartitionTimestampCursor implements 
PartitionTimestampCursor {
-protected final Cursor treeCursor;
+final Cursor treeCursor;

Review Comment:
   Fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072275714


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/AbstractPageMemoryMvPartitionStorage.java:
##
@@ -157,35 +141,31 @@ protected AbstractPageMemoryMvPartitionStorage(
  * Starts a partition by initializing its internal structures.
  */
 public void start() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+busy(() -> {

Review Comment:
   Tried to fix it.



##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/AbstractPageMemoryMvPartitionStorage.java:
##
@@ -528,20 +516,16 @@ private static byte[] rowBytes(@Nullable BinaryRow row) {
 @Override
 public @Nullable BinaryRow addWrite(RowId rowId, @Nullable BinaryRow row, 
UUID txId, UUID commitTableId, int commitPartitionId)
 throws TxIdMismatchException, StorageException {
-assert rowId.partitionId() == partitionId : rowId;
-
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+assert rowId.partitionId() == partitionId : rowId;
 
-try {
 VersionChain currentChain = findVersionChain(rowId);
 
 if (currentChain == null) {
 RowVersion newVersion = insertRowVersion(row, NULL_LINK);
 
-VersionChain versionChain = 
VersionChain.createUncommitted(rowId, txId, commitTableId, commitPartitionId, 
newVersion.link(),
-NULL_LINK);
+VersionChain versionChain = 
VersionChain.createUncommitted(rowId, txId, commitTableId, commitPartitionId,
+newVersion.link(), NULL_LINK);

Review Comment:
   Fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072257607


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -298,76 +276,74 @@ public void close() {
 
 @Override
 public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
-
-try {
-advanceIfNeeded();
+return busy(() -> {
+try {
+advanceIfNeeded();
 
-return hasNext;
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Error while advancing the cursor", 
e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+return hasNext;
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Error while advancing the 
cursor", e);
+}
+});
 }
 
 @Override
 public IndexRow next() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
-
-try {
-advanceIfNeeded();
+return busy(() -> {
+try {
+advanceIfNeeded();
 
-boolean hasNext = this.hasNext;
+boolean hasNext = this.hasNext;
 
-if (!hasNext) {
-throw new NoSuchElementException();
-}
+if (!hasNext) {
+throw new NoSuchElementException();
+}
 
-this.hasNext = null;
+this.hasNext = null;
 
-return toIndexRowImpl(treeRow);
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Error while advancing the cursor", 
e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+return toIndexRowImpl(treeRow);
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Error while advancing the 
cursor", e);
+}
+});
 }
 
 @Override
 public @Nullable IndexRow peek() {
-if (hasNext != null) {
-if (hasNext) {
-return toIndexRowImpl(treeRow);
+return busy(() -> {

Review Comment:
   Same, but why not use a generic template for this class?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072257176


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -298,76 +276,74 @@ public void close() {
 
 @Override
 public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
-
-try {
-advanceIfNeeded();
+return busy(() -> {

Review Comment:
   Same, but why not use a generic template for this class?



##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -298,76 +276,74 @@ public void close() {
 
 @Override
 public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
-
-try {
-advanceIfNeeded();
+return busy(() -> {
+try {
+advanceIfNeeded();
 
-return hasNext;
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Error while advancing the cursor", 
e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+return hasNext;
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Error while advancing the 
cursor", e);
+}
+});
 }
 
 @Override
 public IndexRow next() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
-
-try {
-advanceIfNeeded();
+return busy(() -> {

Review Comment:
   Same, but why not use a generic template for this class?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072256909


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -247,28 +233,20 @@ public void close() {
 
 @Override
 public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemorySortedIndexStorage.this::createStorageInfo);
 
-try {
 return cursor.hasNext();
-} finally {
-closeBusyLock.leaveBusy();
-}
+});
 }
 
 @Override
 public R next() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemorySortedIndexStorage.this::createStorageInfo);

Review Comment:
   Same, but why not use a generic template for this class?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072251321


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -247,28 +233,20 @@ public void close() {
 
 @Override
 public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemorySortedIndexStorage.this::createStorageInfo);
 
-try {
 return cursor.hasNext();
-} finally {
-closeBusyLock.leaveBusy();
-}
+});

Review Comment:
   Same, but why not use a generic template for this class?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072251321


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -247,28 +233,20 @@ public void close() {
 
 @Override
 public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemorySortedIndexStorage.this::createStorageInfo);
 
-try {
 return cursor.hasNext();
-} finally {
-closeBusyLock.leaveBusy();
-}
+});

Review Comment:
   Also, but why not use a generic template for this class?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072249467


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/PageMemoryHashIndexStorage.java:
##
@@ -97,100 +93,88 @@ public HashIndexDescriptor indexDescriptor() {
 
 @Override
 public Cursor get(BinaryTuple key) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
this::createStorageInfo);
 
-try {
-IndexColumns indexColumns = new IndexColumns(partitionId, 
key.byteBuffer());
+try {
+IndexColumns indexColumns = new IndexColumns(partitionId, 
key.byteBuffer());
 
-HashIndexRow lowerBound = new HashIndexRow(indexColumns, 
lowestRowId);
-HashIndexRow upperBound = new HashIndexRow(indexColumns, 
highestRowId);
+HashIndexRow lowerBound = new HashIndexRow(indexColumns, 
lowestRowId);
+HashIndexRow upperBound = new HashIndexRow(indexColumns, 
highestRowId);
 
-Cursor cursor = hashIndexTree.find(lowerBound, 
upperBound);
+Cursor cursor = hashIndexTree.find(lowerBound, 
upperBound);
 
-return new Cursor<>() {
-@Override
-public void close() {
-cursor.close();
-}
-
-@Override
-public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
+return new Cursor() {
+@Override
+public void close() {
+cursor.close();
 }
 
-try {
-return cursor.hasNext();
-} finally {
-closeBusyLock.leaveBusy();
-}
-}
+@Override
+public boolean hasNext() {
+return busy(() -> {
+
throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemoryHashIndexStorage.this::createStorageInfo);
 
-@Override
-public RowId next() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
+return cursor.hasNext();
+});
 }
 
-try {
-return cursor.next().rowId();
-} finally {
-closeBusyLock.leaveBusy();
+@Override
+public RowId next() {
+return busy(() -> {
+
throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemoryHashIndexStorage.this::createStorageInfo);
+
+return cursor.next().rowId();
+});
 }
-}
-};
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Failed to create scan cursor", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+};
+} catch (Throwable e) {
+throw new StorageException("Failed to create scan cursor", e);
+}
+});
 }
 
 @Override
 public void put(IndexRow row) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+busy(() -> {
+try {
+IndexColumns indexColumns = new IndexColumns(partitionId, 
row.indexColumns().byteBuffer());
 
-try {
-IndexColumns indexColumns = new IndexColumns(partitionId, 
row.indexColumns().byteBuffer());
+HashIndexRow hashIndexRow = new HashIndexRow(indexColumns, 
row.rowId());
 
-HashIndexRow hashIndexRow = new HashIndexRow(indexColumns, 
row.rowId());
+var insert = new InsertHashIndexRowInvokeClosure(hashIndexRow, 
freeList, hashIndexTree.inlineSize());
 
-var insert = new InsertHashIndexRowInvokeClosure(hashIndexRow, 
freeList, hashIndexTree.inlineSize());
+hashIndexTree.invoke(hashIndexRow, null, insert);
 
-hashIndexTree.invoke(hashIndexRow, null, insert);
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Failed to put value into index", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+return null;
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Failed to put value into index", 
e);
+}
+

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072249794


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -105,71 +102,65 @@ public SortedIndexDescriptor indexDescriptor() {
 
 @Override
 public Cursor get(BinaryTuple key) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {

Review Comment:
   Tried to fix it.



##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -105,71 +102,65 @@ public SortedIndexDescriptor indexDescriptor() {
 
 @Override
 public Cursor get(BinaryTuple key) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
this::createStorageInfo);
 
-try {
-SortedIndexRowKey lowerBound = toSortedIndexRow(key, lowestRowId);
+try {
+SortedIndexRowKey lowerBound = toSortedIndexRow(key, 
lowestRowId);
 
-SortedIndexRowKey upperBound = toSortedIndexRow(key, highestRowId);
+SortedIndexRowKey upperBound = toSortedIndexRow(key, 
highestRowId);
 
-return convertCursor(sortedIndexTree.find(lowerBound, upperBound), 
SortedIndexRow::rowId);
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Failed to create scan cursor", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+return convertCursor(sortedIndexTree.find(lowerBound, 
upperBound), SortedIndexRow::rowId);
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Failed to create scan cursor", e);
+}
+});
 }
 
 @Override
 public void put(IndexRow row) {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+busy(() -> {

Review Comment:
   Tried to fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072250057


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##
@@ -105,71 +102,65 @@ public SortedIndexDescriptor indexDescriptor() {
 
 @Override
 public Cursor get(BinaryTuple key) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
this::createStorageInfo);
 
-try {
-SortedIndexRowKey lowerBound = toSortedIndexRow(key, lowestRowId);
+try {
+SortedIndexRowKey lowerBound = toSortedIndexRow(key, 
lowestRowId);
 
-SortedIndexRowKey upperBound = toSortedIndexRow(key, highestRowId);
+SortedIndexRowKey upperBound = toSortedIndexRow(key, 
highestRowId);
 
-return convertCursor(sortedIndexTree.find(lowerBound, upperBound), 
SortedIndexRow::rowId);
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Failed to create scan cursor", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+return convertCursor(sortedIndexTree.find(lowerBound, 
upperBound), SortedIndexRow::rowId);
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Failed to create scan cursor", e);
+}
+});
 }
 
 @Override
 public void put(IndexRow row) {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+busy(() -> {
+try {
+SortedIndexRow sortedIndexRow = 
toSortedIndexRow(row.indexColumns(), row.rowId());
 
-try {
-SortedIndexRow sortedIndexRow = 
toSortedIndexRow(row.indexColumns(), row.rowId());
+var insert = new 
InsertSortedIndexRowInvokeClosure(sortedIndexRow, freeList, 
sortedIndexTree.inlineSize());
 
-var insert = new InsertSortedIndexRowInvokeClosure(sortedIndexRow, 
freeList, sortedIndexTree.inlineSize());
+sortedIndexTree.invoke(sortedIndexRow, null, insert);
 
-sortedIndexTree.invoke(sortedIndexRow, null, insert);
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Failed to put value into index", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+return null;
+} catch (IgniteInternalCheckedException e) {
+throw new StorageException("Failed to put value into index", 
e);
+}
+});
 }
 
 @Override
 public void remove(IndexRow row) {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+busy(() -> {

Review Comment:
   Tried to fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072249213


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/PageMemoryHashIndexStorage.java:
##
@@ -97,100 +93,88 @@ public HashIndexDescriptor indexDescriptor() {
 
 @Override
 public Cursor get(BinaryTuple key) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {

Review Comment:
   Tried to fix it.



##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/PageMemoryHashIndexStorage.java:
##
@@ -97,100 +93,88 @@ public HashIndexDescriptor indexDescriptor() {
 
 @Override
 public Cursor get(BinaryTuple key) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {
+throwExceptionIfStorageInProgressOfRebalance(state.get(), 
this::createStorageInfo);
 
-try {
-IndexColumns indexColumns = new IndexColumns(partitionId, 
key.byteBuffer());
+try {
+IndexColumns indexColumns = new IndexColumns(partitionId, 
key.byteBuffer());
 
-HashIndexRow lowerBound = new HashIndexRow(indexColumns, 
lowestRowId);
-HashIndexRow upperBound = new HashIndexRow(indexColumns, 
highestRowId);
+HashIndexRow lowerBound = new HashIndexRow(indexColumns, 
lowestRowId);
+HashIndexRow upperBound = new HashIndexRow(indexColumns, 
highestRowId);
 
-Cursor cursor = hashIndexTree.find(lowerBound, 
upperBound);
+Cursor cursor = hashIndexTree.find(lowerBound, 
upperBound);
 
-return new Cursor<>() {
-@Override
-public void close() {
-cursor.close();
-}
-
-@Override
-public boolean hasNext() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
+return new Cursor() {
+@Override
+public void close() {
+cursor.close();
 }
 
-try {
-return cursor.hasNext();
-} finally {
-closeBusyLock.leaveBusy();
-}
-}
+@Override
+public boolean hasNext() {
+return busy(() -> {
+
throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemoryHashIndexStorage.this::createStorageInfo);
 
-@Override
-public RowId next() {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
+return cursor.hasNext();
+});
 }
 
-try {
-return cursor.next().rowId();
-} finally {
-closeBusyLock.leaveBusy();
+@Override
+public RowId next() {
+return busy(() -> {
+
throwExceptionIfStorageInProgressOfRebalance(state.get(), 
PageMemoryHashIndexStorage.this::createStorageInfo);
+
+return cursor.next().rowId();
+});
 }
-}
-};
-} catch (IgniteInternalCheckedException e) {
-throw new StorageException("Failed to create scan cursor", e);
-} finally {
-closeBusyLock.leaveBusy();
-}
+};
+} catch (Throwable e) {
+throw new StorageException("Failed to create scan cursor", e);
+}
+});
 }
 
 @Override
 public void put(IndexRow row) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+busy(() -> {

Review Comment:
   Tried to fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1479: IGNITE-18360 Migrate storage to new Binary Tuple format

2023-01-17 Thread GitBox


korlov42 commented on code in PR #1479:
URL: https://github.com/apache/ignite-3/pull/1479#discussion_r1072247433


##
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/MvPartitionStorage.java:
##
@@ -151,7 +151,7 @@ public interface MvPartitionStorage extends 
ManuallyCloseable {
  * @throws TxIdMismatchException If there's another pending update 
associated with different transaction id.
  * @throws StorageException If failed to write data to the storage.
  */
-@Nullable BinaryRow addWrite(RowId rowId, @Nullable BinaryRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)
+@Nullable TableRow addWrite(RowId rowId, @Nullable TableRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)

Review Comment:
   I'm not sure that erasing the boundary between data and its metadata is a 
good idea.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ibessonov opened a new pull request, #1540: IGNITE-18516 "Change closure" semantic fixed when it comes to concurr…

2023-01-17 Thread GitBox


ibessonov opened a new pull request, #1540:
URL: https://github.com/apache/ignite-3/pull/1540

   …ent access to "external" configuration. New "change" API introduced bot in 
registry and in generated Change interfaces.
   
   https://issues.apache.org/jira/browse/IGNITE-18516


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072225481


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##
@@ -268,12 +377,52 @@ private void checkPartitionId(int partitionId) {
 int partitions = mvPartitions.length();
 
 if (partitionId < 0 || partitionId >= partitions) {
-throw new IllegalArgumentException(S.toString(
-"Unable to access partition with id outside of configured 
range",
-"table", tableCfg.value().name(), false,
-"partitionId", partitionId, false,
-"partitions", partitions, false
+throw new IllegalArgumentException(IgniteStringFormatter.format(
+"Unable to access partition with id outside of configured 
range: [table={}, partitionId={}, partitions={}]",
+getTableName(),
+partitionId,
+partitions
 ));
 }
 }
+
+/**
+ * Returns multi-versioned partition storage without using {@link 
#busyLock}.
+ *
+ * @param partitionId Partition ID.
+ * @return {@code Null} if there is no storage.
+ */
+@Nullable
+AbstractPageMemoryMvPartitionStorage 
getMvPartitionStorageWithoutBusyLock(int partitionId) {
+checkPartitionId(partitionId);
+
+return mvPartitions.get(partitionId);
+}
+
+/**
+ * Returns multi-versioned partition storage, if it doesn't exist it will 
throw an exception from the
+ * {@code missingStorageExceptionFunction}, without using {@link 
#busyLock}.
+ *
+ * @param partitionId Partition ID.
+ * @param missingStorageExceptionFunction Function to create an exception 
if the store is missing.
+ */
+AbstractPageMemoryMvPartitionStorage getMvPartitionStorageWithoutBusyLock(

Review Comment:
   Replaced with `null` check.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ptupitsyn merged pull request #1535: Rename Gradle project from ignite-parent to Apache Ignite 3

2023-01-17 Thread GitBox


ptupitsyn merged PR #1535:
URL: https://github.com/apache/ignite-3/pull/1535


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072202522


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##
@@ -268,12 +377,52 @@ private void checkPartitionId(int partitionId) {
 int partitions = mvPartitions.length();
 
 if (partitionId < 0 || partitionId >= partitions) {
-throw new IllegalArgumentException(S.toString(
-"Unable to access partition with id outside of configured 
range",
-"table", tableCfg.value().name(), false,
-"partitionId", partitionId, false,
-"partitions", partitions, false
+throw new IllegalArgumentException(IgniteStringFormatter.format(
+"Unable to access partition with id outside of configured 
range: [table={}, partitionId={}, partitions={}]",
+getTableName(),
+partitionId,
+partitions
 ));
 }
 }
+
+/**
+ * Returns multi-versioned partition storage without using {@link 
#busyLock}.
+ *
+ * @param partitionId Partition ID.
+ * @return {@code Null} if there is no storage.
+ */
+@Nullable
+AbstractPageMemoryMvPartitionStorage 
getMvPartitionStorageWithoutBusyLock(int partitionId) {
+checkPartitionId(partitionId);
+
+return mvPartitions.get(partitionId);
+}
+
+/**
+ * Returns multi-versioned partition storage, if it doesn't exist it will 
throw an exception from the
+ * {@code missingStorageExceptionFunction}, without using {@link 
#busyLock}.
+ *
+ * @param partitionId Partition ID.
+ * @param missingStorageExceptionFunction Function to create an exception 
if the store is missing.
+ */
+AbstractPageMemoryMvPartitionStorage getMvPartitionStorageWithoutBusyLock(
+int partitionId,
+Function 
missingStorageExceptionFunction
+) {
+AbstractPageMemoryMvPartitionStorage mvPartitionStorage = 
getMvPartitionStorageWithoutBusyLock(partitionId);
+
+if (mvPartitionStorage == null) {
+throw 
missingStorageExceptionFunction.apply(IgniteStringFormatter.format("Partition 
ID {} does not exist", partitionId));
+}
+
+return mvPartitionStorage;
+}
+
+/**
+ * Returns table name.
+ */
+public String getTableName() {

Review Comment:
   Agree.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072201651


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##
@@ -167,86 +203,79 @@ public CompletableFuture destroy() {
 
 @Override
 public AbstractPageMemoryMvPartitionStorage getOrCreateMvPartition(int 
partitionId) throws StorageException {
-AbstractPageMemoryMvPartitionStorage partition = 
getMvPartition(partitionId);
+return inBusyLock(busyLock, () -> {
+AbstractPageMemoryMvPartitionStorage partition = 
getMvPartitionStorageWithoutBusyLock(partitionId);
 
-if (partition != null) {
-return partition;
-}
+if (partition != null) {
+return partition;
+}
 
-partition = createMvPartitionStorage(partitionId);
+partition = createMvPartitionStorage(partitionId);
 
-partition.start();
+partition.start();
 
-mvPartitions.set(partitionId, partition);
+mvPartitions.set(partitionId, partition);
 
-return partition;
+return partition;
+});
 }
 
 @Override
 public @Nullable AbstractPageMemoryMvPartitionStorage getMvPartition(int 
partitionId) {
-assert started : "Storage has not started yet";
-
-checkPartitionId(partitionId);
-
-return mvPartitions.get(partitionId);
+return inBusyLock(busyLock, () -> 
getMvPartitionStorageWithoutBusyLock(partitionId));
 }
 
 @Override
 public CompletableFuture destroyPartition(int partitionId) {
-assert started : "Storage has not started yet";
+return inBusyLock(busyLock, () -> {

Review Comment:
   Tried to fix it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1479: IGNITE-18360 Migrate storage to new Binary Tuple format

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1479:
URL: https://github.com/apache/ignite-3/pull/1479#discussion_r1072175125


##
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/MvPartitionStorage.java:
##
@@ -151,7 +151,7 @@ public interface MvPartitionStorage extends 
ManuallyCloseable {
  * @throws TxIdMismatchException If there's another pending update 
associated with different transaction id.
  * @throws StorageException If failed to write data to the storage.
  */
-@Nullable BinaryRow addWrite(RowId rowId, @Nullable BinaryRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)
+@Nullable TableRow addWrite(RowId rowId, @Nullable TableRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)

Review Comment:
   Maybe it would be more correct to always store the version in a tuple?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r107218


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##
@@ -18,61 +18,89 @@
 package org.apache.ignite.internal.storage.pagememory;
 
 import static java.util.concurrent.CompletableFuture.completedFuture;
+import static 
org.apache.ignite.internal.storage.MvPartitionStorage.REBALANCE_IN_PROGRESS;
+import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicReferenceArray;
+import java.util.function.Function;
 import org.apache.ignite.internal.pagememory.DataRegion;
 import org.apache.ignite.internal.pagememory.PageMemory;
+import org.apache.ignite.internal.pagememory.freelist.FreeList;
+import org.apache.ignite.internal.pagememory.reuse.ReuseList;
+import org.apache.ignite.internal.pagememory.tree.BplusTree;
 import org.apache.ignite.internal.schema.configuration.TableConfiguration;
 import org.apache.ignite.internal.schema.configuration.TableView;
 import org.apache.ignite.internal.schema.configuration.TablesConfiguration;
 import org.apache.ignite.internal.storage.MvPartitionStorage;
 import org.apache.ignite.internal.storage.StorageException;
+import org.apache.ignite.internal.storage.StorageRebalanceException;
 import org.apache.ignite.internal.storage.engine.MvTableStorage;
 import org.apache.ignite.internal.storage.index.HashIndexStorage;
 import org.apache.ignite.internal.storage.index.SortedIndexStorage;
 import 
org.apache.ignite.internal.storage.pagememory.mv.AbstractPageMemoryMvPartitionStorage;
-import org.apache.ignite.internal.tostring.S;
+import org.apache.ignite.internal.util.IgniteSpinBusyLock;
 import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.lang.IgniteStringFormatter;
 import org.jetbrains.annotations.Nullable;
 
 /**
  * Abstract table storage implementation based on {@link PageMemory}.
  */
 public abstract class AbstractPageMemoryTableStorage implements MvTableStorage 
{
-protected final TableConfiguration tableCfg;
+protected static final VarHandle CLOSED;
 
-protected TablesConfiguration tablesConfiguration;
+static {
+try {
+CLOSED = 
MethodHandles.lookup().findVarHandle(AbstractPageMemoryTableStorage.class, 
"closed", boolean.class);
+} catch (ReflectiveOperationException e) {
+throw new ExceptionInInitializerError(e);
+}
+}
+
+protected final TableConfiguration tableConfig;
 
-protected volatile boolean started;
+protected final TablesConfiguration tablesConfig;
 
 protected volatile 
AtomicReferenceArray mvPartitions;
 
-protected final ConcurrentMap> 
partitionIdDestroyFutureMap = new ConcurrentHashMap<>();
+protected final ConcurrentMap> 
destroyFutureByPartitionId = new ConcurrentHashMap<>();
+
+protected final ConcurrentMap> 
rebalanceFutureByPartitionId = new ConcurrentHashMap<>();
+
+/** Busy lock to stop synchronously. */
+protected final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
+
+/** To avoid double closure. */
+@SuppressWarnings("unused")
+protected volatile boolean closed;

Review Comment:
   Returned it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072185181


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##
@@ -18,61 +18,89 @@
 package org.apache.ignite.internal.storage.pagememory;
 
 import static java.util.concurrent.CompletableFuture.completedFuture;
+import static 
org.apache.ignite.internal.storage.MvPartitionStorage.REBALANCE_IN_PROGRESS;
+import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicReferenceArray;
+import java.util.function.Function;
 import org.apache.ignite.internal.pagememory.DataRegion;
 import org.apache.ignite.internal.pagememory.PageMemory;
+import org.apache.ignite.internal.pagememory.freelist.FreeList;
+import org.apache.ignite.internal.pagememory.reuse.ReuseList;
+import org.apache.ignite.internal.pagememory.tree.BplusTree;
 import org.apache.ignite.internal.schema.configuration.TableConfiguration;
 import org.apache.ignite.internal.schema.configuration.TableView;
 import org.apache.ignite.internal.schema.configuration.TablesConfiguration;
 import org.apache.ignite.internal.storage.MvPartitionStorage;
 import org.apache.ignite.internal.storage.StorageException;
+import org.apache.ignite.internal.storage.StorageRebalanceException;
 import org.apache.ignite.internal.storage.engine.MvTableStorage;
 import org.apache.ignite.internal.storage.index.HashIndexStorage;
 import org.apache.ignite.internal.storage.index.SortedIndexStorage;
 import 
org.apache.ignite.internal.storage.pagememory.mv.AbstractPageMemoryMvPartitionStorage;
-import org.apache.ignite.internal.tostring.S;
+import org.apache.ignite.internal.util.IgniteSpinBusyLock;
 import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.lang.IgniteStringFormatter;
 import org.jetbrains.annotations.Nullable;
 
 /**
  * Abstract table storage implementation based on {@link PageMemory}.
  */
 public abstract class AbstractPageMemoryTableStorage implements MvTableStorage 
{
-protected final TableConfiguration tableCfg;
+protected static final VarHandle CLOSED;

Review Comment:
   Returned it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072184092


##
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##
@@ -811,8 +885,8 @@ private void checkForPresenceRows(
 ) {
 for (IgniteTuple3 row : rows) {
 assertThat(
-
getAll(mvPartitionStorage.scanVersions(row.get1())).stream().map(ReadResult::binaryRow).collect(toList()),
-containsInAnyOrder(row.get2())
+
toListOfByteArrays(mvPartitionStorage.scanVersions(row.get1())),
+containsInAnyOrder(row.get2().bytes())

Review Comment:
   There are no bugs, inside it is checked that if these are arrays, then it is 
checked by their lengths and elements.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072181314


##
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##
@@ -548,6 +573,51 @@ public void testDestroyTableStorage() throws Exception {
 assertThat(tableStorage.destroy(), willCompleteSuccessfully());
 }
 
+/**
+ * Checks that if we restart the storages after a crash in the middle of a 
rebalance, the storages will be empty.
+ */
+@Test
+public void testRestartStoragesAfterFailOnMiddleOfRebalance() {

Review Comment:
   Fix it



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072180599


##
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##
@@ -88,25 +92,46 @@ public abstract class AbstractMvTableStorageTest extends 
BaseMvStoragesTest {
 /** Partition id for 1 storage. */
 protected static final int PARTITION_ID_1 = 1 << 8;
 
-private MvTableStorage tableStorage;
+protected MvTableStorage tableStorage;
 
 private TableIndexView sortedIdx;
 
 private TableIndexView hashIdx;
 
+private StorageEngine storageEngine;
+
 /**
  * Initializes the internal structures needed for tests.
  *
  * This method *MUST* always be called in either subclass' constructor 
or setUp method.
  */
-protected final void initialize(MvTableStorage tableStorage, 
TablesConfiguration tablesCfg) {
-createTestTable(tableStorage.configuration());
-createTestIndexes(tablesCfg);
+protected final void initialize(StorageEngine storageEngine, 
TablesConfiguration tablesConfig) {
+createTestTable(getTableConfig(tablesConfig));
+createTestIndexes(tablesConfig);
+
+this.storageEngine = storageEngine;

Review Comment:
   Makes sense, fixed it.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ibessonov commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


ibessonov commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072141988


##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/PageMemoryHashIndexStorage.java:
##
@@ -97,100 +93,88 @@ public HashIndexDescriptor indexDescriptor() {
 
 @Override
 public Cursor get(BinaryTuple key) throws StorageException {
-if (!closeBusyLock.enterBusy()) {
-throwStorageClosedException();
-}
+return busy(() -> {

Review Comment:
   Why did you have to do this? These are changes for the sake of changes. Did 
you want to artificially inflate your PR? Well, you succeeded in that case. 
Please roll it back or at least create a new "get*" method that would reduce 
the amount of unnecessary changes.
   I feel like half of all changes in this PR are unjustified. I don't like it. 
Reviewing PRs like this one is a nightmare



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ibessonov commented on a diff in pull request #1506: IGNITE-18029 Implementation of a full rebalance for PersistentPageMemoryMvPartitionStorage on receiver

2023-01-17 Thread GitBox


ibessonov commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1071208048


##
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##
@@ -548,6 +573,51 @@ public void testDestroyTableStorage() throws Exception {
 assertThat(tableStorage.destroy(), willCompleteSuccessfully());
 }
 
+/**
+ * Checks that if we restart the storages after a crash in the middle of a 
rebalance, the storages will be empty.
+ */
+@Test
+public void testRestartStoragesAfterFailOnMiddleOfRebalance() {

Review Comment:
   ```suggestion
   public void testRestartStoragesAfterFailDuringRebalance() {
   ```



##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##
@@ -18,61 +18,89 @@
 package org.apache.ignite.internal.storage.pagememory;
 
 import static java.util.concurrent.CompletableFuture.completedFuture;
+import static 
org.apache.ignite.internal.storage.MvPartitionStorage.REBALANCE_IN_PROGRESS;
+import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicReferenceArray;
+import java.util.function.Function;
 import org.apache.ignite.internal.pagememory.DataRegion;
 import org.apache.ignite.internal.pagememory.PageMemory;
+import org.apache.ignite.internal.pagememory.freelist.FreeList;
+import org.apache.ignite.internal.pagememory.reuse.ReuseList;
+import org.apache.ignite.internal.pagememory.tree.BplusTree;
 import org.apache.ignite.internal.schema.configuration.TableConfiguration;
 import org.apache.ignite.internal.schema.configuration.TableView;
 import org.apache.ignite.internal.schema.configuration.TablesConfiguration;
 import org.apache.ignite.internal.storage.MvPartitionStorage;
 import org.apache.ignite.internal.storage.StorageException;
+import org.apache.ignite.internal.storage.StorageRebalanceException;
 import org.apache.ignite.internal.storage.engine.MvTableStorage;
 import org.apache.ignite.internal.storage.index.HashIndexStorage;
 import org.apache.ignite.internal.storage.index.SortedIndexStorage;
 import 
org.apache.ignite.internal.storage.pagememory.mv.AbstractPageMemoryMvPartitionStorage;
-import org.apache.ignite.internal.tostring.S;
+import org.apache.ignite.internal.util.IgniteSpinBusyLock;
 import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.lang.IgniteStringFormatter;
 import org.jetbrains.annotations.Nullable;
 
 /**
  * Abstract table storage implementation based on {@link PageMemory}.
  */
 public abstract class AbstractPageMemoryTableStorage implements MvTableStorage 
{
-protected final TableConfiguration tableCfg;
+protected static final VarHandle CLOSED;
 
-protected TablesConfiguration tablesConfiguration;
+static {
+try {
+CLOSED = 
MethodHandles.lookup().findVarHandle(AbstractPageMemoryTableStorage.class, 
"closed", boolean.class);
+} catch (ReflectiveOperationException e) {
+throw new ExceptionInInitializerError(e);
+}
+}
+
+protected final TableConfiguration tableConfig;
 
-protected volatile boolean started;
+protected final TablesConfiguration tablesConfig;
 
 protected volatile 
AtomicReferenceArray mvPartitions;
 
-protected final ConcurrentMap> 
partitionIdDestroyFutureMap = new ConcurrentHashMap<>();
+protected final ConcurrentMap> 
destroyFutureByPartitionId = new ConcurrentHashMap<>();
+
+protected final ConcurrentMap> 
rebalanceFutureByPartitionId = new ConcurrentHashMap<>();
+
+/** Busy lock to stop synchronously. */
+protected final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
+
+/** To avoid double closure. */
+@SuppressWarnings("unused")
+protected volatile boolean closed;

Review Comment:
   Almost everyone else calls it `stopGuard`. Why do you break the pattern?



##
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##
@@ -268,12 +377,52 @@ private void checkPartitionId(int partitionId) {
 int partitions = mvPartitions.length();
 
 if (partitionId < 0 || partitionId >= partitions) {
-throw new IllegalArgumentException(S.toString(
-"Unable to access partition with id outside of configured 
range",
-"table", tableCfg.value().name(), false,
-"partitionId", partitionId, false,
-"partitions", partitions, false
+throw new IllegalArgumentException(Ignit

[GitHub] [ignite-3] valepakh commented on a diff in pull request #1479: IGNITE-18360 Migrate storage to new Binary Tuple format

2023-01-17 Thread GitBox


valepakh commented on code in PR #1479:
URL: https://github.com/apache/ignite-3/pull/1479#discussion_r1072139004


##
modules/schema/src/main/java/org/apache/ignite/internal/schema/TableRow.java:
##
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.schema;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/** Heap byte buffer-based row. */
+public class TableRow {

Review Comment:
   BinaryTuple is an existing class which is an utility that uses a schema to 
read values. I don't like the name either.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-17 Thread GitBox


AMashenkov commented on code in PR #1511:
URL: https://github.com/apache/ignite-3/pull/1511#discussion_r1072138375


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/OrderedMergePublisher.java:
##
@@ -36,49 +35,52 @@
  *
  * Merges multiple concurrent ordered data streams into one.
  */
-public class SortingCompositePublisher extends CompositePublisher {
+public class OrderedMergePublisher implements Publisher {
 /** Rows comparator. */
-private final Comparator comp;
+private final Comparator comp;
+
+/** Array of upstream publishers. */
+private final Publisher[] sources;
 
 /** Prefetch size. */
 private final int prefetch;
 
 /**
  * Constructor.
  *
- * @param publishers List of upstream publishers.
  * @param comp Rows comparator.
  * @param prefetch Prefetch size.
+ * @param sources List of upstream publishers.
  */
-public SortingCompositePublisher(Collection> 
publishers, Comparator comp, int prefetch) {
-super(publishers);
-
-this.comp = comp;
+public OrderedMergePublisher(
+Comparator comp,
+int prefetch,
+Publisher... sources) {
+this.sources = sources;
 this.prefetch = prefetch;
+this.comp = comp;
 }
 
+/** {@inheritDoc} */
 @Override
 public void subscribe(Subscriber downstream) {
-subscribe(new OrderedMergeCompositeSubscription<>(downstream, comp, 
prefetch, publishers.size()), downstream);
+OrderedMergeSubscription subscription = new 
OrderedMergeSubscription<>(downstream, comp, prefetch, sources.length);
+
+subscription.subscribe(sources);
+downstream.onSubscribe(subscription);
+subscription.drain();
 }
 
 /**
  * Sorting composite subscription.
  *
  * Merges multiple concurrent ordered data streams into one.
  */
-public static class OrderedMergeCompositeSubscription extends 
CompositePublisher.CompositeSubscription {
-/** Marker to indicate completed subscription. */
+static final class OrderedMergeSubscription implements Subscription {

Review Comment:
   Concatenated publisher is also ordered, but not sorted, as it iterates over 
array of upstreams.
   Another example, LinkedHashMap is ordered, but not sorted.
   



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] timoninmaxim opened a new pull request, #10483: DistributedProcess can await client node results

2023-01-17 Thread GitBox


timoninmaxim opened a new pull request, #10483:
URL: https://github.com/apache/ignite/pull/10483

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE- Change summary` where 
`` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers 
list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check 
PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to 
Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation 
rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding 
Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity 
Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email d...@ignite.apache.org or ask anу advice 
on http://asf.slack.com _#ignite_ channel.
   


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1479: IGNITE-18360 Migrate storage to new Binary Tuple format

2023-01-17 Thread GitBox


korlov42 commented on code in PR #1479:
URL: https://github.com/apache/ignite-3/pull/1479#discussion_r1072122879


##
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/MvPartitionStorage.java:
##
@@ -151,7 +151,7 @@ public interface MvPartitionStorage extends 
ManuallyCloseable {
  * @throws TxIdMismatchException If there's another pending update 
associated with different transaction id.
  * @throws StorageException If failed to write data to the storage.
  */
-@Nullable BinaryRow addWrite(RowId rowId, @Nullable BinaryRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)
+@Nullable TableRow addWrite(RowId rowId, @Nullable TableRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)

Review Comment:
   table can change over time, so we must store the version of the schema that 
was used to build the tuple so we can read its contents later



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ibessonov merged pull request #1534: IGNITE-18563 Reduce the list of duplicated jar dependencies

2023-01-17 Thread GitBox


ibessonov merged PR #1534:
URL: https://github.com/apache/ignite-3/pull/1534


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] rpuch commented on a diff in pull request #1534: IGNITE-18563 Reduce the list of duplicated jar dependencies

2023-01-17 Thread GitBox


rpuch commented on code in PR #1534:
URL: https://github.com/apache/ignite-3/pull/1534#discussion_r1072114151


##
modules/sql-engine/build.gradle:
##
@@ -45,7 +45,11 @@ dependencies {
 implementation libs.jackson.core
 implementation libs.jackson.databind
 implementation libs.jackson.annotations
-implementation libs.jsonpath.core
+implementation(libs.jsonpath.core) {
+//IDEA test runner don't apply Gradle dependency resolve strategy, 
this is just not implemented

Review Comment:
   ```suggestion
   //IDEA test runner doesn't apply Gradle dependency resolve strategy, 
this is just not implemented
   ```



##
modules/runner/build.gradle:
##
@@ -83,7 +83,11 @@ dependencies {
 testImplementation libs.hamcrest.path
 testImplementation libs.mockito.core
 testImplementation libs.mockito.junit
-testImplementation libs.jsonpath.assert
+testImplementation(libs.jsonpath.assert) {
+//IDEA test runner don't apply Gradle dependency resolve strategy, 
this is just not implemented

Review Comment:
   ```suggestion
   //IDEA test runner doesn't apply Gradle dependency resolve strategy, 
this is just not implemented
   ```



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1479: IGNITE-18360 Migrate storage to new Binary Tuple format

2023-01-17 Thread GitBox


tkalkirill commented on code in PR #1479:
URL: https://github.com/apache/ignite-3/pull/1479#discussion_r1072106772


##
modules/schema/src/main/java/org/apache/ignite/internal/schema/TableRow.java:
##
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.schema;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/** Heap byte buffer-based row. */
+public class TableRow {

Review Comment:
   Why not use **BinaryTuple**? This change looks strange.



##
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/MvPartitionStorage.java:
##
@@ -151,7 +151,7 @@ public interface MvPartitionStorage extends 
ManuallyCloseable {
  * @throws TxIdMismatchException If there's another pending update 
associated with different transaction id.
  * @throws StorageException If failed to write data to the storage.
  */
-@Nullable BinaryRow addWrite(RowId rowId, @Nullable BinaryRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)
+@Nullable TableRow addWrite(RowId rowId, @Nullable TableRow row, UUID 
txId, UUID commitTableId, int commitPartitionId)

Review Comment:
   Why not use **BinaryTuple**? This change looks strange.



##
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/TableRowAndRowId.java:
##
@@ -17,32 +17,32 @@
 
 package org.apache.ignite.internal.storage;
 
-import org.apache.ignite.internal.schema.BinaryRow;
+import org.apache.ignite.internal.schema.TableRow;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Wrapper that holds both {@link BinaryRow} and {@link RowId}. {@link 
BinaryRow} is null for tombstones.
+ * Wrapper that holds both {@link TableRow} and {@link RowId}. {@link 
TableRow} is null for tombstones.
  */
-public class BinaryRowAndRowId {
-/** Binary row. */
-private final @Nullable BinaryRow binaryRow;
+public class TableRowAndRowId {
+/** Table row. */
+private final @Nullable TableRow tableRow;

Review Comment:
   Why not use **BinaryTuple**? This change looks strange.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka commented on a diff in pull request #1521: IGNITE-18254: Sql. Extend SQL grammar with ALTER ZONE statement

2023-01-17 Thread GitBox


lowka commented on code in PR #1521:
URL: https://github.com/apache/ignite-3/pull/1521#discussion_r1072072004


##
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##
@@ -532,3 +532,96 @@ SqlDrop SqlDropZone(Span s, boolean replace) :
 return new IgniteSqlDropZone(s.end(this), ifExists, zoneId);
 }
 }
+
+SqlNode SqlAlterZone() :
+{
+final Span s;
+final SqlIdentifier zoneId;
+final SqlIdentifier newZoneId;
+SqlNodeList optionList = null;
+}
+{
+ { s = span(); }
+ zoneId = CompoundIdentifier()

Review Comment:
   The ticket does not mention such syntax but sure, no problem.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka commented on a diff in pull request #1521: IGNITE-18254: Sql. Extend SQL grammar with ALTER ZONE statement

2023-01-17 Thread GitBox


lowka commented on code in PR #1521:
URL: https://github.com/apache/ignite-3/pull/1521#discussion_r1072072004


##
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##
@@ -532,3 +532,96 @@ SqlDrop SqlDropZone(Span s, boolean replace) :
 return new IgniteSqlDropZone(s.end(this), ifExists, zoneId);
 }
 }
+
+SqlNode SqlAlterZone() :
+{
+final Span s;
+final SqlIdentifier zoneId;
+final SqlIdentifier newZoneId;
+SqlNodeList optionList = null;
+}
+{
+ { s = span(); }
+ zoneId = CompoundIdentifier()

Review Comment:
   The ticket does mention such syntax but sure, no problem.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka commented on a diff in pull request #1521: IGNITE-18254: Sql. Extend SQL grammar with ALTER ZONE statement

2023-01-17 Thread GitBox


lowka commented on code in PR #1521:
URL: https://github.com/apache/ignite-3/pull/1521#discussion_r1072066793


##
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##
@@ -532,3 +532,96 @@ SqlDrop SqlDropZone(Span s, boolean replace) :
 return new IgniteSqlDropZone(s.end(this), ifExists, zoneId);
 }
 }
+
+SqlNode SqlAlterZone() :
+{
+final Span s;
+final SqlIdentifier zoneId;
+final SqlIdentifier newZoneId;
+SqlNodeList optionList = null;
+}
+{
+ { s = span(); }
+ zoneId = CompoundIdentifier()
+(
+newZoneId = CompoundIdentifier() {
+return new IgniteSqlAlterZoneRenameTo(s.end(this), zoneId, newZoneId);
+  }
+  |
+   { s.add(this); } optionList = AlterZoneOptions() {

Review Comment:
   Sure.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka commented on a diff in pull request #1521: IGNITE-18254: Sql. Extend SQL grammar with ALTER ZONE statement

2023-01-17 Thread GitBox


lowka commented on code in PR #1521:
URL: https://github.com/apache/ignite-3/pull/1521#discussion_r1072065179


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/IgniteSqlAlterZoneRenameTo.java:
##
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.sql;
+
+import java.util.List;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlWriter;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.util.ImmutableNullableList;
+
+/**
+ * Parse tree for {@code ALTER ZONE RENAME TO} statement.
+ */
+public class IgniteSqlAlterZoneRenameTo extends IgniteAbstractSqlAlterZone {
+
+private final SqlIdentifier name;
+
+private final SqlIdentifier newName;
+
+/** Constructor. */
+public IgniteSqlAlterZoneRenameTo(SqlParserPos pos, SqlIdentifier name, 
SqlIdentifier newName) {
+super(pos);
+this.name = name;
+this.newName = newName;
+}
+
+/** {@inheritDoc} */
+@Override
+public List getOperandList() {
+return ImmutableNullableList.of(name);
+}
+
+/** The name of a distribution zone to alter. **/
+public SqlIdentifier name() {
+return name;
+}
+
+/**
+ * The new name for a distribution zone.
+ */
+public SqlIdentifier newName() {
+return newName;
+}
+
+

Review Comment:
   fixed



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern merged pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-17 Thread GitBox


xtern merged PR #1511:
URL: https://github.com/apache/ignite-3/pull/1511


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ptupitsyn closed pull request #1523: IGNITE-18509 .NET: Remove unused CompileMemberReader logic

2023-01-17 Thread GitBox


ptupitsyn closed pull request #1523: IGNITE-18509 .NET: Remove unused 
CompileMemberReader logic
URL: https://github.com/apache/ignite-3/pull/1523


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ptupitsyn merged pull request #1533: IGNITE-18215 .NET: LINQ: Fix GroupBy with complex expression

2023-01-17 Thread GitBox


ptupitsyn merged PR #1533:
URL: https://github.com/apache/ignite-3/pull/1533


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1479: IGNITE-18360 Migrate storage to new Binary Tuple format

2023-01-17 Thread GitBox


korlov42 commented on code in PR #1479:
URL: https://github.com/apache/ignite-3/pull/1479#discussion_r1071959373


##
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/TableRowAndRowId.java:
##
@@ -18,31 +18,32 @@
 package org.apache.ignite.internal.storage;
 
 import org.apache.ignite.internal.schema.BinaryRow;
+import org.apache.ignite.internal.schema.TableRow;
 import org.jetbrains.annotations.Nullable;
 
 /**
  * Wrapper that holds both {@link BinaryRow} and {@link RowId}. {@link 
BinaryRow} is null for tombstones.

Review Comment:
   there are still mentions



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] petrov-mg opened a new pull request, #10482: wip

2023-01-17 Thread GitBox


petrov-mg opened a new pull request, #10482:
URL: https://github.com/apache/ignite/pull/10482

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE- Change summary` where 
`` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers 
list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check 
PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to 
Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation 
rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding 
Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity 
Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email d...@ignite.apache.org or ask anу advice 
on http://asf.slack.com _#ignite_ channel.
   


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] ptupitsyn closed issue #10469: Question on loading data onto ignite

2023-01-16 Thread GitBox


ptupitsyn closed issue #10469: Question on loading data onto ignite
URL: https://github.com/apache/ignite/issues/10469


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] ibessonov opened a new pull request, #1534: IGNITE-18563 Reduce the list of duplicated jar dependencies

2023-01-16 Thread GitBox


ibessonov opened a new pull request, #1534:
URL: https://github.com/apache/ignite-3/pull/1534

   https://issues.apache.org/jira/browse/IGNITE-18563


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1521: IGNITE-18254: Sql. Extend SQL grammar with ALTER ZONE statement

2023-01-16 Thread GitBox


korlov42 commented on code in PR #1521:
URL: https://github.com/apache/ignite-3/pull/1521#discussion_r1071215818


##
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##
@@ -532,3 +532,96 @@ SqlDrop SqlDropZone(Span s, boolean replace) :
 return new IgniteSqlDropZone(s.end(this), ifExists, zoneId);
 }
 }
+
+SqlNode SqlAlterZone() :
+{
+final Span s;
+final SqlIdentifier zoneId;
+final SqlIdentifier newZoneId;
+SqlNodeList optionList = null;
+}
+{
+ { s = span(); }
+ zoneId = CompoundIdentifier()

Review Comment:
   we need to support `ALTER ZONE IF EXISTS` syntax



##
modules/sql-engine/src/main/codegen/config.fmpp:
##
@@ -594,7 +598,8 @@ data: {
 # Return type of method implementation should be 'SqlNode'.
 # Example: "SqlShowDatabases()", "SqlShowTables()".
 statementParserMethods: [
-  "SqlAlterTable()"
+  "SqlAlterTable()",
+  "SqlAlterZone()"

Review Comment:
   since you've extended SqlAlter, why don't you put this in 
`alterStatementParserMethods`? 



##
modules/sql-engine/src/main/codegen/config.fmpp:
##
@@ -29,6 +29,7 @@ data: {
 imports: [
   "org.apache.calcite.sql.SqlCreate",
   "org.apache.calcite.sql.SqlDrop",
+  "org.apache.calcite.sql.SqlDdl",

Review Comment:
   why do we need this import? 



##
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##
@@ -532,3 +532,96 @@ SqlDrop SqlDropZone(Span s, boolean replace) :
 return new IgniteSqlDropZone(s.end(this), ifExists, zoneId);
 }
 }
+
+SqlNode SqlAlterZone() :
+{
+final Span s;
+final SqlIdentifier zoneId;
+final SqlIdentifier newZoneId;
+SqlNodeList optionList = null;
+}
+{
+ { s = span(); }
+ zoneId = CompoundIdentifier()
+(
+newZoneId = CompoundIdentifier() {

Review Comment:
   newZoneId have to be SimpleIdentifier. We can't move a zone to another 
schema by simply renaming it



##
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##
@@ -532,3 +532,96 @@ SqlDrop SqlDropZone(Span s, boolean replace) :
 return new IgniteSqlDropZone(s.end(this), ifExists, zoneId);
 }
 }
+
+SqlNode SqlAlterZone() :
+{
+final Span s;
+final SqlIdentifier zoneId;
+final SqlIdentifier newZoneId;
+SqlNodeList optionList = null;
+}
+{
+ { s = span(); }
+ zoneId = CompoundIdentifier()
+(
+newZoneId = CompoundIdentifier() {
+return new IgniteSqlAlterZoneRenameTo(s.end(this), zoneId, newZoneId);
+  }
+  |
+   { s.add(this); } optionList = AlterZoneOptions() {
+return new IgniteSqlAlterZoneWith(s.end(this), zoneId, optionList);
+  }
+)
+}
+
+SqlNodeList AlterZoneOptions() :
+{
+  List list = new ArrayList();
+  final Span s = Span.of();
+}
+{
+  AlterZoneOption(list)
+  (
+   { s.add(this); } AlterZoneOption(list)
+  )+

Review Comment:
   did you mean `*`? With current rule it's impossible to change exactly one 
param. Also, we need to cover this case in tests too



##
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##
@@ -532,3 +532,96 @@ SqlDrop SqlDropZone(Span s, boolean replace) :
 return new IgniteSqlDropZone(s.end(this), ifExists, zoneId);
 }
 }
+
+SqlNode SqlAlterZone() :
+{
+final Span s;
+final SqlIdentifier zoneId;
+final SqlIdentifier newZoneId;
+SqlNodeList optionList = null;
+}
+{
+ { s = span(); }
+ zoneId = CompoundIdentifier()
+(
+newZoneId = CompoundIdentifier() {
+return new IgniteSqlAlterZoneRenameTo(s.end(this), zoneId, newZoneId);
+  }
+  |
+   { s.add(this); } optionList = AlterZoneOptions() {

Review Comment:
   IMO, we should use `WITH` keyword to provide context of the operation. To 
alter a certain property `SET` seems more natural to me. WDYT?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka commented on a diff in pull request #1521: IGNITE-18254: Sql. Extend SQL grammar with ALTER ZONE statement

2023-01-16 Thread GitBox


lowka commented on code in PR #1521:
URL: https://github.com/apache/ignite-3/pull/1521#discussion_r1071837306


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/IgniteAbstractSqlAlterZone.java:
##
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.sql;
+
+import org.apache.calcite.sql.SqlAlter;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlSpecialOperator;
+import org.apache.calcite.sql.parser.SqlParserPos;
+
+/**
+ * A base class for a parse tree for {@code ALTER ZONE } statement.
+ */
+public abstract class IgniteAbstractSqlAlterZone extends SqlAlter {
+
+/** Alter operator. */
+private static final SqlOperator OPERATOR =
+new SqlSpecialOperator("ALTER ZONE", SqlKind.OTHER_DDL);
+
+/** Scope. **/
+private static final String SCOPE = "ZONE";
+
+/** Constructor. */
+public IgniteAbstractSqlAlterZone(SqlParserPos pos) {

Review Comment:
   Fixed



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] luchnikovbsk closed pull request #10300: IGNITE-17345 TEMP PR to ask questions (don't merge)

2023-01-16 Thread GitBox


luchnikovbsk closed pull request #10300: IGNITE-17345 TEMP PR  to ask questions 
(don't merge)
URL: https://github.com/apache/ignite/pull/10300


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] zstan commented on a diff in pull request #1521: IGNITE-18254: Sql. Extend SQL grammar with ALTER ZONE statement

2023-01-16 Thread GitBox


zstan commented on code in PR #1521:
URL: https://github.com/apache/ignite-3/pull/1521#discussion_r1071766609


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/IgniteSqlAlterZoneRenameTo.java:
##
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.sql;
+
+import java.util.List;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlWriter;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.util.ImmutableNullableList;
+
+/**
+ * Parse tree for {@code ALTER ZONE RENAME TO} statement.
+ */
+public class IgniteSqlAlterZoneRenameTo extends IgniteAbstractSqlAlterZone {
+
+private final SqlIdentifier name;
+
+private final SqlIdentifier newName;
+
+/** Constructor. */
+public IgniteSqlAlterZoneRenameTo(SqlParserPos pos, SqlIdentifier name, 
SqlIdentifier newName) {
+super(pos);
+this.name = name;
+this.newName = newName;
+}
+
+/** {@inheritDoc} */
+@Override
+public List getOperandList() {
+return ImmutableNullableList.of(name);
+}
+
+/** The name of a distribution zone to alter. **/
+public SqlIdentifier name() {
+return name;
+}
+
+/**
+ * The new name for a distribution zone.
+ */
+public SqlIdentifier newName() {
+return newName;
+}
+
+

Review Comment:
   extra line



##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/IgniteAbstractSqlAlterZone.java:
##
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.sql;
+
+import org.apache.calcite.sql.SqlAlter;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlSpecialOperator;
+import org.apache.calcite.sql.parser.SqlParserPos;
+
+/**
+ * A base class for a parse tree for {@code ALTER ZONE } statement.
+ */
+public abstract class IgniteAbstractSqlAlterZone extends SqlAlter {
+
+/** Alter operator. */
+private static final SqlOperator OPERATOR =
+new SqlSpecialOperator("ALTER ZONE", SqlKind.OTHER_DDL);
+
+/** Scope. **/
+private static final String SCOPE = "ZONE";
+
+/** Constructor. */
+public IgniteAbstractSqlAlterZone(SqlParserPos pos) {

Review Comment:
   seems **public** access is redundant here



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] rpuch opened a new pull request, #1531: IGNITE-18505 Thread pool for components start

2023-01-16 Thread GitBox


rpuch opened a new pull request, #1531:
URL: https://github.com/apache/ignite-3/pull/1531

   https://issues.apache.org/jira/browse/IGNITE-18505


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-16 Thread GitBox


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/ConcatPublisher.java:
##
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.util;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.VarHandle;
+import java.util.Iterator;
+import java.util.concurrent.Flow.Publisher;
+import java.util.concurrent.Flow.Subscriber;
+import java.util.concurrent.Flow.Subscription;
+import java.util.concurrent.atomic.AtomicInteger;
+
+
+/**
+ * Thread-safe realization of combine multiple publishers. Generally, start 
consuming a source once the previous source has terminated,
+ * building a chain.
+ */
+public class ConcatPublisher implements Publisher {
+/** Iterator of upstream publishers. */
+private final Iterator> sources;
+
+/**
+ * Constructor.
+ *
+ * @param sources Iterator of upstream publishers.
+ */
+public ConcatPublisher(Iterator> sources) {
+this.sources = sources;
+}
+
+/** {@inheritDoc} */
+@Override
+public void subscribe(Subscriber downstream) {
+ConcatCoordinator subscription = new 
ConcatCoordinator<>(downstream, sources);
+
+downstream.onSubscribe(subscription);
+subscription.drain();
+}
+
+/**
+ * Concatenation composite subscription.
+ */
+static final class ConcatCoordinator extends SubscriptionArbiter 
implements Subscriber {
+/** Counter to prevent concurrent execution of a critical section. */
+private final AtomicInteger guardCntr = new AtomicInteger();
+
+final Subscriber downstream;
+
+final Iterator> sources;
+
+long consumed;
+
+ConcatCoordinator(
+Subscriber downstream,
+Iterator> sources
+) {
+this.downstream = downstream;
+this.sources = sources;
+}
+
+@Override
+public void onSubscribe(Subscription s) {
+setSubscription(s);
+}
+
+@Override
+public void onNext(T item) {
+consumed++;
+downstream.onNext(item);
+}
+
+@Override
+public void onError(Throwable throwable) {
+downstream.onError(throwable);
+}
+
+@Override
+public void onComplete() {
+drain();
+}
+
+void drain() {
+if (guardCntr.getAndIncrement() == 0) {
+do {
+if (isCancelled()) {
+return;
+}
+
+if (!sources.hasNext()) {
+downstream.onComplete();
+return;
+}
+
+long c = consumed;
+if (c != 0L) {
+consumed = 0L;
+setProduced(c);
+}
+
+sources.next().subscribe(this);
+
+} while ((guardCntr.getAndDecrement() - 1) != 0);
+}
+}
+}
+
+static class SubscriptionArbiter implements Subscription {
+Subscription current;
+static final VarHandle CURRENT;
+
+Subscription next;
+static final VarHandle NEXT;
+
+long requested;
+
+long downstreamRequested;
+static final VarHandle DOWNSTREAM_REQUESTED;
+
+long produced;
+static final VarHandle PRODUCED;
+
+int wip;
+static final VarHandle WIP;

Review Comment:
   We decided to keep the code as close as possible to the original source 
https://akarnokd.blogspot.com/2017/09/java-9-flow-api-arbitration-and.html



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-16 Thread GitBox


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/OrderedMergePublisher.java:
##
@@ -36,49 +35,52 @@
  *
  * Merges multiple concurrent ordered data streams into one.
  */
-public class SortingCompositePublisher extends CompositePublisher {
+public class OrderedMergePublisher implements Publisher {

Review Comment:
   Javadoc updated:
   
   ```
   /**
* Sorting composite publisher.
*
* Merges multiple publishers using merge-sort algorithm.
*
* Note: upstream publishers must be sources of sorted data.
*/
   ```



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-16 Thread GitBox


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/OrderedMergePublisher.java:
##
@@ -36,49 +35,52 @@
  *
  * Merges multiple concurrent ordered data streams into one.
  */
-public class SortingCompositePublisher extends CompositePublisher {
+public class OrderedMergePublisher implements Publisher {
 /** Rows comparator. */
-private final Comparator comp;
+private final Comparator comp;
+
+/** Array of upstream publishers. */
+private final Publisher[] sources;
 
 /** Prefetch size. */
 private final int prefetch;
 
 /**
  * Constructor.
  *
- * @param publishers List of upstream publishers.
  * @param comp Rows comparator.
  * @param prefetch Prefetch size.
+ * @param sources List of upstream publishers.
  */
-public SortingCompositePublisher(Collection> 
publishers, Comparator comp, int prefetch) {
-super(publishers);
-
-this.comp = comp;
+public OrderedMergePublisher(
+Comparator comp,
+int prefetch,
+Publisher... sources) {
+this.sources = sources;
 this.prefetch = prefetch;
+this.comp = comp;
 }
 
+/** {@inheritDoc} */
 @Override
 public void subscribe(Subscriber downstream) {
-subscribe(new OrderedMergeCompositeSubscription<>(downstream, comp, 
prefetch, publishers.size()), downstream);
+OrderedMergeSubscription subscription = new 
OrderedMergeSubscription<>(downstream, comp, prefetch, sources.length);
+
+subscription.subscribe(sources);
+downstream.onSubscribe(subscription);
+subscription.drain();
 }
 
 /**
  * Sorting composite subscription.
  *
  * Merges multiple concurrent ordered data streams into one.
  */
-public static class OrderedMergeCompositeSubscription extends 
CompositePublisher.CompositeSubscription {
-/** Marker to indicate completed subscription. */
+static final class OrderedMergeSubscription implements Subscription {

Review Comment:
   It seems to me that the current names `OrderedMergePublisher` and 
`OrderedMergeSubscription` better reflect the purpose of these classes.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] timoninmaxim commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


timoninmaxim commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071285548


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/AbstractConsistentCutTest.java:
##
@@ -0,0 +1,301 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.io.File;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.UUID;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cluster.ClusterState;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.pagemem.wal.WALIterator;
+import org.apache.ignite.internal.pagemem.wal.record.ConsistentCutFinishRecord;
+import org.apache.ignite.internal.pagemem.wal.record.ConsistentCutStartRecord;
+import org.apache.ignite.internal.pagemem.wal.record.DataRecord;
+import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
+import org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer;
+import 
org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.Nullable;
+
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.CONSISTENT_CUT_FINISH_RECORD;
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.CONSISTENT_CUT_START_RECORD;
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.DATA_RECORD_V2;
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp;
+
+/** Base class for testing Consistency Cut algorithm. */
+public abstract class AbstractConsistentCutTest extends GridCommonAbstractTest 
{
+/** */
+protected static final String CACHE = "CACHE";
+
+/** */
+protected static final String SNP = "base";
+
+/** {@inheritDoc} */
+@Override protected IgniteConfiguration getConfiguration(String 
instanceName) throws Exception {
+IgniteConfiguration cfg = super.getConfiguration(instanceName);
+
+cfg.setDataStorageConfiguration(new DataStorageConfiguration()
+.setWalCompactionEnabled(true)
+.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
+.setName("consistent-cut-persist")
+.setPersistenceEnabled(true)));
+
+CacheConfiguration ccfg = new 
CacheConfiguration()
+.setName(CACHE)
+.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
+.setBackups(backups());
+
+if (withNearCache())
+ccfg.setNearConfiguration(new NearCacheConfiguration<>());
+
+cfg.setCacheConfiguration(ccfg);
+
+cfg.setConsistentId(instanceName);
+
+return cfg;
+}
+
+/** {@inheritDoc} */
+@Override protected void beforeTest() throws Exception {
+cleanPersistenceDir();
+
+startGrids(nodes());
+
+grid(0).cluster().state(ClusterState.ACTIVE);
+
+startClientGrid(nodes());
+
+snp(grid(0)).c

[GitHub] [ignite-3] tkalkirill opened a new pull request, #1530: IGNITE-18027 Implementation of a full rebalance for RocksDbMvPartitionStorage on receiver

2023-01-16 Thread GitBox


tkalkirill opened a new pull request, #1530:
URL: https://github.com/apache/ignite-3/pull/1530

   https://issues.apache.org/jira/browse/IGNITE-18027


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] timoninmaxim commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


timoninmaxim commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071271269


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/TransactionTestCase.java:
##
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.stream.Collectors;
+import org.apache.ignite.cache.affinity.Affinity;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Class represents a transaction test case for single or two keys.
+ */
+public class TransactionTestCase {
+/** Keys array described with pairs (primary, backup). */

Review Comment:
   those are node IDs that represents key in test case. Pair (1, 0) means that 
primary copy is on node with ID=1, and backup copy is on node with ID=0



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill merged pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


tkalkirill merged PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-16 Thread GitBox


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/ConcatPublisher.java:
##
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.util;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.VarHandle;
+import java.util.Iterator;
+import java.util.concurrent.Flow.Publisher;
+import java.util.concurrent.Flow.Subscriber;
+import java.util.concurrent.Flow.Subscription;
+import java.util.concurrent.atomic.AtomicInteger;
+
+
+/**
+ * Thread-safe realization of combine multiple publishers. Generally, start 
consuming a source once the previous source has terminated,
+ * building a chain.
+ */
+public class ConcatPublisher implements Publisher {
+/** Iterator of upstream publishers. */
+private final Iterator> sources;
+
+/**
+ * Constructor.
+ *
+ * @param sources Iterator of upstream publishers.
+ */
+public ConcatPublisher(Iterator> sources) {
+this.sources = sources;
+}
+
+/** {@inheritDoc} */
+@Override
+public void subscribe(Subscriber downstream) {
+ConcatCoordinator subscription = new 
ConcatCoordinator<>(downstream, sources);
+
+downstream.onSubscribe(subscription);
+subscription.drain();
+}
+
+/**
+ * Concatenation composite subscription.
+ */
+static final class ConcatCoordinator extends SubscriptionArbiter 
implements Subscriber {

Review Comment:
   Renamed to `ConcatenatedSubscriber`



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-16 Thread GitBox


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/ConcatPublisher.java:
##
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.util;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.VarHandle;
+import java.util.Iterator;
+import java.util.concurrent.Flow.Publisher;
+import java.util.concurrent.Flow.Subscriber;
+import java.util.concurrent.Flow.Subscription;
+import java.util.concurrent.atomic.AtomicInteger;
+
+
+/**
+ * Thread-safe realization of combine multiple publishers. Generally, start 
consuming a source once the previous source has terminated,
+ * building a chain.
+ */
+public class ConcatPublisher implements Publisher {
+/** Iterator of upstream publishers. */
+private final Iterator> sources;
+
+/**
+ * Constructor.
+ *
+ * @param sources Iterator of upstream publishers.
+ */
+public ConcatPublisher(Iterator> sources) {
+this.sources = sources;
+}
+
+/** {@inheritDoc} */
+@Override
+public void subscribe(Subscriber downstream) {
+ConcatCoordinator subscription = new 
ConcatCoordinator<>(downstream, sources);
+
+downstream.onSubscribe(subscription);
+subscription.drain();
+}
+
+/**
+ * Concatenation composite subscription.
+ */
+static final class ConcatCoordinator extends SubscriptionArbiter 
implements Subscriber {
+/** Counter to prevent concurrent execution of a critical section. */
+private final AtomicInteger guardCntr = new AtomicInteger();
+
+final Subscriber downstream;
+
+final Iterator> sources;
+
+long consumed;
+
+ConcatCoordinator(
+Subscriber downstream,
+Iterator> sources
+) {
+this.downstream = downstream;
+this.sources = sources;
+}
+
+@Override

Review Comment:
   Done



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-16 Thread GitBox


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/OrderedMergePublisher.java:
##
@@ -107,14 +109,20 @@ public void subscribe(Subscriber downstream) {
 /** Number of emitted rows (guarded by {@link #guardCntr}). */
 private long emitted;
 
+static final VarHandle ERROR;
+
+static final VarHandle CANCELLED;
+
+static final VarHandle REQUESTED;

Review Comment:
   Done



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] xtern commented on a diff in pull request #1511: IGNITE-18510: Make composite publisher thread safe.

2023-01-16 Thread GitBox


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/ConcatPublisher.java:
##
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.util;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.VarHandle;
+import java.util.Iterator;
+import java.util.concurrent.Flow.Publisher;
+import java.util.concurrent.Flow.Subscriber;
+import java.util.concurrent.Flow.Subscription;
+import java.util.concurrent.atomic.AtomicInteger;
+
+
+/**
+ * Thread-safe realization of combine multiple publishers. Generally, start 
consuming a source once the previous source has terminated,
+ * building a chain.
+ */
+public class ConcatPublisher implements Publisher {

Review Comment:
   Done



##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/ConcatPublisher.java:
##
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.util;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.VarHandle;
+import java.util.Iterator;
+import java.util.concurrent.Flow.Publisher;
+import java.util.concurrent.Flow.Subscriber;
+import java.util.concurrent.Flow.Subscription;
+import java.util.concurrent.atomic.AtomicInteger;
+
+
+/**
+ * Thread-safe realization of combine multiple publishers. Generally, start 
consuming a source once the previous source has terminated,
+ * building a chain.
+ */
+public class ConcatPublisher implements Publisher {
+/** Iterator of upstream publishers. */
+private final Iterator> sources;
+
+/**
+ * Constructor.
+ *
+ * @param sources Iterator of upstream publishers.
+ */
+public ConcatPublisher(Iterator> sources) {
+this.sources = sources;
+}
+
+/** {@inheritDoc} */
+@Override
+public void subscribe(Subscriber downstream) {
+ConcatCoordinator subscription = new 
ConcatCoordinator<>(downstream, sources);
+
+downstream.onSubscribe(subscription);
+subscription.drain();
+}
+
+/**
+ * Concatenation composite subscription.
+ */
+static final class ConcatCoordinator extends SubscriptionArbiter 
implements Subscriber {
+/** Counter to prevent concurrent execution of a critical section. */
+private final AtomicInteger guardCntr = new AtomicInteger();
+
+final Subscriber downstream;
+
+final Iterator> sources;
+
+long consumed;
+
+ConcatCoordinator(
+Subscriber downstream,
+Iterator> sources
+) {
+this.downstream = downstream;
+this.sources = sources;
+}
+
+@Override
+public void onSubscribe(Subscription s) {
+setSubscription(s);
+}
+
+@Override
+public void onNext(T item) {
+consumed++;
+downstream.onNext(item);
+}
+
+@Override
+public void onError(Throwable throwable) {
+downstream.onError(throwable);
+}
+
+@Override
+public void onComplete() {
+drain();
+}
+
+void drain() {
+if (guardCntr.getAndIn

[GitHub] [ignite-3] lowka commented on a diff in pull request #1513: IGNITE-18163: Old-style join on different column types fails with ClassCastException

2023-01-16 Thread GitBox


lowka commented on code in PR #1513:
URL: https://github.com/apache/ignite-3/pull/1513#discussion_r1071234558


##
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/TypeCoercionTest.java:
##
@@ -0,0 +1,395 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.prepare;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.BiConsumer;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.calcite.avatica.util.TimeUnit;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.runtime.CalciteContextException;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlSelect;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest;
+import org.apache.ignite.internal.sql.engine.schema.IgniteSchema;
+import org.apache.ignite.internal.sql.engine.trait.IgniteDistributions;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
+/**
+ * Tests type coercion behaviour.
+ *
+ * @see IgniteTypeCoercion
+ */
+public class TypeCoercionTest extends AbstractPlannerTest {
+
+private static final RelDataType VARCHAR = 
TYPE_FACTORY.createSqlType(SqlTypeName.VARCHAR, 20);
+
+private static final List NUMERIC_TYPES =  
SqlTypeName.NUMERIC_TYPES.stream().map(t -> {
+if (t == SqlTypeName.DECIMAL) {
+return TYPE_FACTORY.createSqlType(t, 10, 2);
+} else {
+return TYPE_FACTORY.createSqlType(t);
+}
+}).collect(Collectors.toList());
+
+@ParameterizedTest
+@MethodSource("booleanToNumeric")
+public void testBooleanToNumeric(TypeCoercionRule rule) {
+Tester tester = new Tester(rule);
+tester.execute();
+}
+
+private static Stream booleanToNumeric() {
+List numericRules = new ArrayList<>();
+
+for (RelDataType type : NUMERIC_TYPES) {
+RelDataType booleanType = 
TYPE_FACTORY.createSqlType(SqlTypeName.BOOLEAN);
+numericRules.add(typeCoercionRule(type, booleanType, new 
ToSpecificType(type)));
+numericRules.add(typeCoercionRule(booleanType, type, new 
ToSpecificType(type)));
+}
+
+return numericRules.stream();
+}
+
+@ParameterizedTest
+@MethodSource("varCharToNumeric")
+public void testVarCharToNumeric(TypeCoercionRule rule) {
+Tester tester = new Tester(rule);
+tester.execute();
+}
+
+private static Stream varCharToNumeric() {
+List numericRules = new ArrayList<>();
+
+for (RelDataType type : NUMERIC_TYPES) {
+if (type.getSqlTypeName() == SqlTypeName.DECIMAL) {
+// The widest decimal possible?

Review Comment:
   Done



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka commented on a diff in pull request #1513: IGNITE-18163: Old-style join on different column types fails with ClassCastException

2023-01-16 Thread GitBox


lowka commented on code in PR #1513:
URL: https://github.com/apache/ignite-3/pull/1513#discussion_r1071234230


##
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/TypeCoercionTest.java:
##
@@ -0,0 +1,414 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.prepare;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.BiConsumer;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.calcite.avatica.util.TimeUnit;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.runtime.CalciteContextException;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlSelect;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest;
+import org.apache.ignite.internal.sql.engine.schema.IgniteSchema;
+import org.apache.ignite.internal.sql.engine.trait.IgniteDistributions;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
+/**
+ * Tests type coercion behaviour.
+ *
+ * @see IgniteTypeCoercion
+ */
+public class TypeCoercionTest extends AbstractPlannerTest {
+
+private static final RelDataType VARCHAR = 
TYPE_FACTORY.createSqlType(SqlTypeName.VARCHAR, 20);
+
+private static final List NUMERIC_TYPES =  
SqlTypeName.NUMERIC_TYPES.stream().map(t -> {
+if (t == SqlTypeName.DECIMAL) {
+return TYPE_FACTORY.createSqlType(t, 10, 2);
+} else {
+return TYPE_FACTORY.createSqlType(t);
+}
+}).collect(Collectors.toList());
+
+@ParameterizedTest
+@MethodSource("booleanToNumeric")
+public void testBooleanToNumeric(TypeCoercionRule rule) {
+Tester tester = new Tester(rule);
+tester.execute();
+}
+
+private static Stream booleanToNumeric() {
+List numericRules = new ArrayList<>();
+RelDataType booleanType = 
TYPE_FACTORY.createSqlType(SqlTypeName.BOOLEAN);
+
+for (RelDataType type : NUMERIC_TYPES) {
+numericRules.add(typeCoercionRule(type, booleanType, new 
ToSpecificType(type)));
+numericRules.add(typeCoercionRule(booleanType, type, new 
ToSpecificType(type)));
+}
+
+return numericRules.stream();
+}
+
+@ParameterizedTest
+@MethodSource("varCharToNumeric")
+public void testVarCharToNumeric(TypeCoercionRule rule) {
+Tester tester = new Tester(rule);
+tester.execute();
+}
+
+private static Stream varCharToNumeric() {
+List numericRules = new ArrayList<>();
+RelDataType expectedDecimalType = 
TYPE_FACTORY.createSqlType(SqlTypeName.DECIMAL, 32767, 16383);
+
+for (RelDataType type : NUMERIC_TYPES) {
+if (type.getSqlTypeName() == SqlTypeName.DECIMAL) {
+// TODO: https://issues.apache.org/jira/browse/IGNITE-18559
+// Coerce to the widest decimal possible?
+numericRules.add(typeCoercionRule(type, VARCHAR, new 
ToSpecificType(expectedDecimalType)));
+numericRules.add(typeCoercionRule(VARCHAR, type, new 
ToSpecificType(expectedDecimalType)));
+} else {
+// cast the right hand side to type
+numericRules.add(typeCoercionRule(type, VARC

[GitHub] [ignite] timoninmaxim commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


timoninmaxim commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071226965


##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java:
##
@@ -218,73 +222,151 @@ public IgniteTxHandler(GridCacheSharedContext ctx) {
 txPrepareMsgLog = ctx.logger(CU.TX_MSG_PREPARE_LOG_CATEGORY);
 txFinishMsgLog = ctx.logger(CU.TX_MSG_FINISH_LOG_CATEGORY);
 
-ctx.io().addCacheHandler(0, GridNearTxPrepareRequest.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
GridNearTxPrepareRequest.class, new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processNearTxPrepareRequest(nodeId, 
(GridNearTxPrepareRequest)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridNearTxPrepareResponse.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
GridNearTxPrepareResponse.class, new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processNearTxPrepareResponse(nodeId, 
(GridNearTxPrepareResponse)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridNearTxFinishRequest.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, GridNearTxFinishRequest.class, 
new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processNearTxFinishRequest(nodeId, 
(GridNearTxFinishRequest)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridNearTxFinishResponse.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
GridNearTxFinishResponse.class, new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processNearTxFinishResponse(nodeId, 
(GridNearTxFinishResponse)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridDhtTxPrepareRequest.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, GridDhtTxPrepareRequest.class, 
new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processDhtTxPrepareRequest(nodeId, 
(GridDhtTxPrepareRequest)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridDhtTxPrepareResponse.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
GridDhtTxPrepareResponse.class, new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processDhtTxPrepareResponse(nodeId, 
(GridDhtTxPrepareResponse)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridDhtTxFinishRequest.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, GridDhtTxFinishRequest.class, 
new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processDhtTxFinishRequest(nodeId, (GridDhtTxFinishRequest)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridDhtTxOnePhaseCommitAckRequest.class, 
new CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
GridDhtTxOnePhaseCommitAckRequest.class, new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processDhtTxOnePhaseCommitAckRequest(nodeId, 
(GridDhtTxOnePhaseCommitAckRequest)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridDhtTxFinishResponse.class, new 
CI2() {
+ctx.io().addCacheHandler(TX_MSG_HND_ID, GridDhtTxFinishResponse.class, 
new CI2() {
 @Override public void apply(UUID nodeId, GridCacheMessage msg) {
 processDhtTxFinishResponse(nodeId, 
(GridDhtTxFinishResponse)msg);
 }
 });
 
-ctx.io().addCacheHandler(0, GridCacheTxRecoveryRequest.class,
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
GridCacheTxRecoveryRequest.class,
 new CI2() {
 @Override public void apply(UUID nodeId, 
GridCacheTxRecoveryRequest req) {
 processCheckPreparedTxRequest(nodeId, req);
 }
 });
 
-ctx.io().addCacheHandler(0, GridCacheTxRecoveryResponse.class,
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
GridCacheTxRecoveryResponse.class,
 new CI2() {
 @Override public void apply(UUID nodeId, 
GridCacheTxRecoveryResponse res) {
 processCheckPreparedTxResponse(nodeId, res);
 }
 });
+
+ctx.io().addCacheHandler(TX_MSG_HND_ID, 
ConsistentCutAwareMessage.class,
+new CI2() {
+@Override public void apply(UUID nodeId, 
ConsistentCutAwareMessage msg) {
+processConsistentCutAwareMessage(nodeId, msg);
+}
+});
+}
+
+/** */
+private void processConsistentCutAwareMessage(UUID nodeId, 
ConsistentCutAwareMessage msg) {
+   

[GitHub] [ignite] timoninmaxim commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


timoninmaxim commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071227994


##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java:
##
@@ -3130,6 +3143,50 @@ public DistributedTransactionConfiguration 
getDistributedTransactionConfiguratio
 return distributedTransactionConfiguration;
 }
 
+/** @param transform Transaction message transformer. */
+public void txMessageTransformer(BiFunction transform) {
+txMsgTransform = transform;
+}
+
+/** @param callback Callback invoked on transaction commit. */
+public void onCommitCallback(Consumer callback) {
+onCommitCallback = callback;
+}
+
+/**
+ * Sends transaction message after transforming it.
+ *
+ * @param nodeId Node ID to send message.
+ * @param msg Original message to transform.
+ * @param tx Transaction.
+ * @param plc IO policy.
+ */
+public void sendTransactionMessage(UUID nodeId, GridCacheMessage msg, 
IgniteInternalTx tx, byte plc) throws IgniteCheckedException {

Review Comment:
   No, `plc` can be set from request policy, see `IgniteTxHandler#sendReply`



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] sashapolo commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


sashapolo commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071223554


##
modules/metastorage/src/testFixtures/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java:
##
@@ -359,21 +360,30 @@ public StatementResult invoke(If iif) {
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, boolean 
includeTombstones) {
 synchronized (mux) {
 return new RangeCursor(keyFrom, keyTo, rev, includeTombstones);
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, long 
revUpperBound, boolean includeTombstones) {
 return new RangeCursor(keyFrom, keyTo, revUpperBound, 
includeTombstones);
 }
 
-/** {@inheritDoc} */
+@Override
+public Cursor prefix(byte[] prefix, boolean includeTombstones) {
+synchronized (mux) {

Review Comment:
   I've made the code clearer



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


tkalkirill commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071220712


##
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##
@@ -676,17 +676,15 @@ public Cursor range(ByteArray keyFrom, @Nullable 
ByteArray keyTo) throws
  * @see ByteArray
  * @see Entry
  */
-public @NotNull Cursor prefixWithAppliedRevision(@NotNull ByteArray 
keyPrefix) throws NodeStoppingException {
+public Cursor prefixWithAppliedRevision(ByteArray keyPrefix) throws 
NodeStoppingException {
 if (!busyLock.enterBusy()) {

Review Comment:
   The balance of "force" began to shift =)



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


tkalkirill commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071218519


##
modules/metastorage/src/testFixtures/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java:
##
@@ -359,21 +360,30 @@ public StatementResult invoke(If iif) {
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, boolean 
includeTombstones) {
 synchronized (mux) {
 return new RangeCursor(keyFrom, keyTo, rev, includeTombstones);
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, long 
revUpperBound, boolean includeTombstones) {
 return new RangeCursor(keyFrom, keyTo, revUpperBound, 
includeTombstones);
 }
 
-/** {@inheritDoc} */
+@Override
+public Cursor prefix(byte[] prefix, boolean includeTombstones) {
+synchronized (mux) {

Review Comment:
   Write a comment why `mux` is used there.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] nizhikov merged pull request #10481: IGNITE-18515 CDC: add documentation about metadata replication

2023-01-16 Thread GitBox


nizhikov merged PR #10481:
URL: https://github.com/apache/ignite/pull/10481


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] sashapolo commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


sashapolo commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071211290


##
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##
@@ -676,17 +676,15 @@ public Cursor range(ByteArray keyFrom, @Nullable 
ByteArray keyTo) throws
  * @see ByteArray
  * @see Entry
  */
-public @NotNull Cursor prefixWithAppliedRevision(@NotNull ByteArray 
keyPrefix) throws NodeStoppingException {
+public Cursor prefixWithAppliedRevision(ByteArray keyPrefix) throws 
NodeStoppingException {
 if (!busyLock.enterBusy()) {

Review Comment:
   We use try-finally approach everywhere else, so I would prefer to leave this 
as-is for the sake of consistency



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


tkalkirill commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071209772


##
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##
@@ -676,17 +676,15 @@ public Cursor range(ByteArray keyFrom, @Nullable 
ByteArray keyTo) throws
  * @see ByteArray
  * @see Entry
  */
-public @NotNull Cursor prefixWithAppliedRevision(@NotNull ByteArray 
keyPrefix) throws NodeStoppingException {
+public Cursor prefixWithAppliedRevision(ByteArray keyPrefix) throws 
NodeStoppingException {
 if (!busyLock.enterBusy()) {

Review Comment:
   This **suggestion** will reduce the amount of similar code.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] sashapolo commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


sashapolo commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071205107


##
modules/metastorage/src/testFixtures/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java:
##
@@ -359,21 +360,30 @@ public StatementResult invoke(If iif) {
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, boolean 
includeTombstones) {
 synchronized (mux) {
 return new RangeCursor(keyFrom, keyTo, rev, includeTombstones);
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, long 
revUpperBound, boolean includeTombstones) {
 return new RangeCursor(keyFrom, keyTo, revUpperBound, 
includeTombstones);
 }
 
-/** {@inheritDoc} */
+@Override
+public Cursor prefix(byte[] prefix, boolean includeTombstones) {
+synchronized (mux) {

Review Comment:
   How would that work? All other methods use a separate object for 
synchronisation



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] sashapolo commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


sashapolo commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071204424


##
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##
@@ -676,17 +676,15 @@ public Cursor range(ByteArray keyFrom, @Nullable 
ByteArray keyTo) throws
  * @see ByteArray
  * @see Entry
  */
-public @NotNull Cursor prefixWithAppliedRevision(@NotNull ByteArray 
keyPrefix) throws NodeStoppingException {
+public Cursor prefixWithAppliedRevision(ByteArray keyPrefix) throws 
NodeStoppingException {
 if (!busyLock.enterBusy()) {

Review Comment:
   Why should I?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] zstan commented on a diff in pull request #1513: IGNITE-18163: Old-style join on different column types fails with ClassCastException

2023-01-16 Thread GitBox


zstan commented on code in PR #1513:
URL: https://github.com/apache/ignite-3/pull/1513#discussion_r1071201780


##
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/TypeCoercionTest.java:
##
@@ -0,0 +1,414 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.prepare;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.BiConsumer;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.calcite.avatica.util.TimeUnit;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.runtime.CalciteContextException;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlSelect;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.ignite.internal.sql.engine.planner.AbstractPlannerTest;
+import org.apache.ignite.internal.sql.engine.schema.IgniteSchema;
+import org.apache.ignite.internal.sql.engine.trait.IgniteDistributions;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
+/**
+ * Tests type coercion behaviour.
+ *
+ * @see IgniteTypeCoercion
+ */
+public class TypeCoercionTest extends AbstractPlannerTest {
+
+private static final RelDataType VARCHAR = 
TYPE_FACTORY.createSqlType(SqlTypeName.VARCHAR, 20);
+
+private static final List NUMERIC_TYPES =  
SqlTypeName.NUMERIC_TYPES.stream().map(t -> {
+if (t == SqlTypeName.DECIMAL) {
+return TYPE_FACTORY.createSqlType(t, 10, 2);
+} else {
+return TYPE_FACTORY.createSqlType(t);
+}
+}).collect(Collectors.toList());
+
+@ParameterizedTest
+@MethodSource("booleanToNumeric")
+public void testBooleanToNumeric(TypeCoercionRule rule) {
+Tester tester = new Tester(rule);
+tester.execute();
+}
+
+private static Stream booleanToNumeric() {
+List numericRules = new ArrayList<>();
+RelDataType booleanType = 
TYPE_FACTORY.createSqlType(SqlTypeName.BOOLEAN);
+
+for (RelDataType type : NUMERIC_TYPES) {
+numericRules.add(typeCoercionRule(type, booleanType, new 
ToSpecificType(type)));
+numericRules.add(typeCoercionRule(booleanType, type, new 
ToSpecificType(type)));
+}
+
+return numericRules.stream();
+}
+
+@ParameterizedTest
+@MethodSource("varCharToNumeric")
+public void testVarCharToNumeric(TypeCoercionRule rule) {
+Tester tester = new Tester(rule);
+tester.execute();
+}
+
+private static Stream varCharToNumeric() {
+List numericRules = new ArrayList<>();
+RelDataType expectedDecimalType = 
TYPE_FACTORY.createSqlType(SqlTypeName.DECIMAL, 32767, 16383);
+
+for (RelDataType type : NUMERIC_TYPES) {
+if (type.getSqlTypeName() == SqlTypeName.DECIMAL) {
+// TODO: https://issues.apache.org/jira/browse/IGNITE-18559
+// Coerce to the widest decimal possible?
+numericRules.add(typeCoercionRule(type, VARCHAR, new 
ToSpecificType(expectedDecimalType)));
+numericRules.add(typeCoercionRule(VARCHAR, type, new 
ToSpecificType(expectedDecimalType)));
+} else {
+// cast the right hand side to type
+numericRules.add(typeCoercionRule(type, VARC

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


tkalkirill commented on code in PR #1526:
URL: https://github.com/apache/ignite-3/pull/1526#discussion_r1071195665


##
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/raft/MetaStorageListener.java:
##
@@ -253,19 +254,27 @@ public void 
onWrite(Iterator> iter) {
 
 IgniteUuid cursorId = rangeCmd.cursorId();
 
-Cursor cursor = (rangeCmd.revUpperBound() != -1)
+Cursor cursor = rangeCmd.revUpperBound() != -1
 ? storage.range(rangeCmd.keyFrom(), rangeCmd.keyTo(), 
rangeCmd.revUpperBound(), rangeCmd.includeTombstones())
 : storage.range(rangeCmd.keyFrom(), rangeCmd.keyTo(), 
rangeCmd.includeTombstones());
 
-cursors.put(
-cursorId,
-new CursorMeta(
-cursor,
-CursorType.RANGE,
-rangeCmd.requesterNodeId(),
-rangeCmd.batchSize()
-)
-);
+var meta = new CursorMeta(cursor, CursorType.RANGE, 
rangeCmd.requesterNodeId(), rangeCmd.batchSize());

Review Comment:
   I think `metaCursor` would be a better name.



##
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/raft/MetaStorageListener.java:
##
@@ -253,19 +254,27 @@ public void 
onWrite(Iterator> iter) {
 
 IgniteUuid cursorId = rangeCmd.cursorId();
 
-Cursor cursor = (rangeCmd.revUpperBound() != -1)
+Cursor cursor = rangeCmd.revUpperBound() != -1
 ? storage.range(rangeCmd.keyFrom(), rangeCmd.keyTo(), 
rangeCmd.revUpperBound(), rangeCmd.includeTombstones())
 : storage.range(rangeCmd.keyFrom(), rangeCmd.keyTo(), 
rangeCmd.includeTombstones());
 
-cursors.put(
-cursorId,
-new CursorMeta(
-cursor,
-CursorType.RANGE,
-rangeCmd.requesterNodeId(),
-rangeCmd.batchSize()
-)
-);
+var meta = new CursorMeta(cursor, CursorType.RANGE, 
rangeCmd.requesterNodeId(), rangeCmd.batchSize());
+
+cursors.put(cursorId, meta);
+
+clo.result(cursorId);
+} else if (command instanceof PrefixCommand) {
+var prefixCmd = (PrefixCommand) command;
+
+IgniteUuid cursorId = prefixCmd.cursorId();
+
+Cursor cursor = prefixCmd.revUpperBound() == -1
+? storage.prefix(prefixCmd.prefix(), 
prefixCmd.includeTombstones())
+: storage.prefix(prefixCmd.prefix(), 
prefixCmd.revUpperBound(), prefixCmd.includeTombstones());
+
+var meta = new CursorMeta(cursor, CursorType.RANGE, 
prefixCmd.requesterNodeId(), prefixCmd.batchSize());
+
+cursors.put(cursorId, meta);

Review Comment:
   I think `metaCursor` would be a better name.



##
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##
@@ -676,17 +676,15 @@ public Cursor range(ByteArray keyFrom, @Nullable 
ByteArray keyTo) throws
  * @see ByteArray
  * @see Entry
  */
-public @NotNull Cursor prefixWithAppliedRevision(@NotNull ByteArray 
keyPrefix) throws NodeStoppingException {
+public Cursor prefixWithAppliedRevision(ByteArray keyPrefix) throws 
NodeStoppingException {
 if (!busyLock.enterBusy()) {

Review Comment:
   U can use 
`org.apache.ignite.internal.util.IgniteUtils#inBusyLock(org.apache.ignite.internal.util.IgniteSpinBusyLock,
 java.util.function.Supplier)`



##
modules/metastorage/src/testFixtures/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java:
##
@@ -359,21 +360,30 @@ public StatementResult invoke(If iif) {
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, boolean 
includeTombstones) {
 synchronized (mux) {
 return new RangeCursor(keyFrom, keyTo, rev, includeTombstones);
 }
 }
 
-/** {@inheritDoc} */
 @Override
 public Cursor range(byte[] keyFrom, byte[] keyTo, long 
revUpperBound, boolean includeTombstones) {
 return new RangeCursor(keyFrom, keyTo, revUpperBound, 
includeTombstones);
 }
 
-/** {@inheritDoc} */
+@Override
+public Cursor prefix(byte[] prefix, boolean includeTombstones) {
+synchronized (mux) {

Review Comment:
   Maybe you should add `synchronized` for `prefix`* methods header, for 
example `public synchronized Cursor prefix(...)`?



-- 
This is an automated message from the Apache Git Service.
To respond to 

[GitHub] [ignite-3] zstan opened a new pull request, #1529: IGNITE-18501 Sql. Remove deprecated QueryProcessor#queryAsync from QueryChecker

2023-01-16 Thread GitBox


zstan opened a new pull request, #1529:
URL: https://github.com/apache/ignite-3/pull/1529

   …eryChecker


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka opened a new pull request, #1528: IGNITE-18422: Sql. Match number of dynamic parameters with given parameters

2023-01-16 Thread GitBox


lowka opened a new pull request, #1528:
URL: https://github.com/apache/ignite-3/pull/1528

   …meters


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] nizhikov commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071152344


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/AbstractConsistentCutTest.java:
##
@@ -0,0 +1,301 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.io.File;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.UUID;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cluster.ClusterState;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.pagemem.wal.WALIterator;
+import org.apache.ignite.internal.pagemem.wal.record.ConsistentCutFinishRecord;
+import org.apache.ignite.internal.pagemem.wal.record.ConsistentCutStartRecord;
+import org.apache.ignite.internal.pagemem.wal.record.DataRecord;
+import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
+import org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer;
+import 
org.apache.ignite.internal.processors.cache.persistence.wal.reader.IgniteWalIteratorFactory;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.Nullable;
+
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.CONSISTENT_CUT_FINISH_RECORD;
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.CONSISTENT_CUT_START_RECORD;
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.DATA_RECORD_V2;
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp;
+
+/** Base class for testing Consistency Cut algorithm. */
+public abstract class AbstractConsistentCutTest extends GridCommonAbstractTest 
{
+/** */
+protected static final String CACHE = "CACHE";
+
+/** */
+protected static final String SNP = "base";
+
+/** {@inheritDoc} */
+@Override protected IgniteConfiguration getConfiguration(String 
instanceName) throws Exception {
+IgniteConfiguration cfg = super.getConfiguration(instanceName);
+
+cfg.setDataStorageConfiguration(new DataStorageConfiguration()
+.setWalCompactionEnabled(true)
+.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
+.setName("consistent-cut-persist")
+.setPersistenceEnabled(true)));
+
+CacheConfiguration ccfg = new 
CacheConfiguration()
+.setName(CACHE)
+.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
+.setBackups(backups());
+
+if (withNearCache())
+ccfg.setNearConfiguration(new NearCacheConfiguration<>());
+
+cfg.setCacheConfiguration(ccfg);
+
+cfg.setConsistentId(instanceName);
+
+return cfg;
+}
+
+/** {@inheritDoc} */
+@Override protected void beforeTest() throws Exception {
+cleanPersistenceDir();
+
+startGrids(nodes());
+
+grid(0).cluster().state(ClusterState.ACTIVE);
+
+startClientGrid(nodes());
+
+snp(grid(0)).creat

[GitHub] [ignite] shishkovilja opened a new pull request, #10481: IGNITE-18515 CDC: add documentation about metadata replication

2023-01-16 Thread GitBox


shishkovilja opened a new pull request, #10481:
URL: https://github.com/apache/ignite/pull/10481

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE- Change summary` where 
`` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers 
list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check 
PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to 
Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation 
rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding 
Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity 
Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email d...@ignite.apache.org or ask anу advice 
on http://asf.slack.com _#ignite_ channel.
   


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] lowka commented on a diff in pull request #1513: IGNITE-18163: Old-style join on different column types fails with ClassCastException

2023-01-16 Thread GitBox


lowka commented on code in PR #1513:
URL: https://github.com/apache/ignite-3/pull/1513#discussion_r1071140488


##
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/LeastRestrictiveTypesTest.java:
##
@@ -0,0 +1,257 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.prepare;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.ignite.internal.sql.engine.type.IgniteTypeFactory;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+/**
+ * Tests the behaviour of {@link IgniteTypeFactory#leastRestrictive(List)}.
+ */
+public class LeastRestrictiveTypesTest {
+
+private static final IgniteTypeFactory TYPE_FACTORY = new 
IgniteTypeFactory();
+
+private static final RelDataType TINYINT = 
TYPE_FACTORY.createSqlType(SqlTypeName.TINYINT);
+
+private static final RelDataType SMALLINT = 
TYPE_FACTORY.createSqlType(SqlTypeName.SMALLINT);
+
+private static final RelDataType INTEGER = 
TYPE_FACTORY.createSqlType(SqlTypeName.INTEGER);
+
+private static final RelDataType FLOAT = 
TYPE_FACTORY.createSqlType(SqlTypeName.FLOAT);
+
+private static final RelDataType DOUBLE = 
TYPE_FACTORY.createSqlType(SqlTypeName.DOUBLE);
+
+private static final RelDataType REAL = 
TYPE_FACTORY.createSqlType(SqlTypeName.REAL);
+
+private static final RelDataType BIGINT = 
TYPE_FACTORY.createSqlType(SqlTypeName.BIGINT);
+
+private static final RelDataType DECIMAL = 
TYPE_FACTORY.createSqlType(SqlTypeName.DECIMAL, 1000, 10);
+
+@ParameterizedTest
+@MethodSource("tinyIntTests")
+public void testTinyInt(RelDataType t1, RelDataType t2, 
LeastRestrictiveType leastRestrictiveType) {
+expectLeastRestrictiveType(t1, t2, leastRestrictiveType);
+expectLeastRestrictiveType(t2, t1, leastRestrictiveType);
+}
+
+private static Stream tinyIntTests() {
+List tests = new ArrayList<>();
+
+tests.add(Arguments.arguments(TINYINT, TINYINT, new 
LeastRestrictiveType(TINYINT)));
+tests.add(Arguments.arguments(TINYINT, SMALLINT, new 
LeastRestrictiveType(SMALLINT)));
+tests.add(Arguments.arguments(TINYINT, INTEGER, new 
LeastRestrictiveType(INTEGER)));
+tests.add(Arguments.arguments(TINYINT, FLOAT, new 
LeastRestrictiveType(FLOAT)));
+tests.add(Arguments.arguments(TINYINT, REAL, new 
LeastRestrictiveType(REAL)));
+tests.add(Arguments.arguments(TINYINT, DOUBLE, new 
LeastRestrictiveType(DOUBLE)));
+tests.add(Arguments.arguments(TINYINT, DECIMAL, new 
LeastRestrictiveType(DECIMAL)));
+tests.add(Arguments.arguments(TINYINT, BIGINT, new 
LeastRestrictiveType(BIGINT)));
+
+return tests.stream();
+}
+
+@ParameterizedTest
+@MethodSource("smallIntTests")
+public void testSmallInt(RelDataType t1, RelDataType t2, 
LeastRestrictiveType leastRestrictiveType) {
+expectLeastRestrictiveType(t1, t2, leastRestrictiveType);
+expectLeastRestrictiveType(t2, t1, leastRestrictiveType);
+}
+
+private static Stream smallIntTests() {
+List tests = new ArrayList<>();
+
+tests.add(Arguments.arguments(SMALLINT, TINYINT, new 
LeastRestrictiveType(SMALLINT)));
+tests.add(Arguments.arguments(SMALLINT, SMALLINT, new 
LeastRestrictiveType(SMALLINT)));
+tests.add(Arguments.arguments(SMALLINT, INTEGER, new 
LeastRestrictiveType(INTEGER)));
+tests.add(Arguments.arguments(SMALLINT, FLOAT, new 
LeastRestrictiveType(FLOAT)));
+tests.add(Arguments.arguments(SMALLINT, REAL, new 
LeastRestrictiveType(REAL)));
+tests.add(Arguments.arguments(SMALLINT, DOUBLE, new 
LeastRestrictiveType(DOUBLE)));
+tests.add(Arguments.arguments(SMALLINT, DECIMAL, new 
LeastRestrictiveType(DECIMAL)));
+tests.add(Arguments.arguments(SM

[GitHub] [ignite] nizhikov commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071136370


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/ConcurrentTxsConsistentCutTest.java:
##
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.Lock;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp;
+
+/** Load Ignite with transactions and starts Consistent Cut concurrently. */
+@RunWith(Parameterized.class)
+public class ConcurrentTxsConsistentCutTest extends AbstractConsistentCutTest {
+/** Amount of Consistent Cuts to await. */
+private static final int CUTS = 20;
+
+/** */
+private static final Random RND = new Random();
+
+/** */
+private final AtomicInteger txCnt = new AtomicInteger();
+
+/** Notifies data loader to stop preparing new transactions. */
+private volatile CountDownLatch stopLoadLatch;
+
+/** Number of server nodes. */
+@Parameterized.Parameter
+public int nodes;
+
+/** Number of backups. */
+@Parameterized.Parameter(1)
+public int backups;
+
+/** */
+@Parameterized.Parameter(2)
+public boolean withNearCache;
+
+/** */
+@Parameterized.Parameters(name = "nodes={0}, backups={1}, 
withNearCache={2}")
+public static List params() {
+List> nodesAndBackups = F.asList(
+new T2<>(3, 0),
+new T2<>(2, 1),
+new T2<>(3, 2));
+
+List params = new ArrayList<>();
+
+for (T2 nb: nodesAndBackups) {
+for (boolean near: new boolean[] {false, true})
+params.add(new Object[] {nb.get1(), nb.get2(), near});
+}
+
+return params;
+}
+
+/** {@inheritDoc} */
+@Override protected int nodes() {
+return nodes;
+}
+
+/** {@inheritDoc} */
+@Override protected int backups() {
+return backups;
+}
+
+/** {@inheritDoc} */
+@Override protected boolean withNearCache() {
+return withNearCache;
+}
+
+/** */
+@Test
+public void noLoadTest() throws Exception {
+testConcurrentTransactionsAndCuts(() -> {}, false);
+}
+
+/** */
+@Test
+public void concurrentLoadTransactionsTest() throws Exception {
+testConcurrentTransactionsAndCuts(() -> {
+// +1 - client node.
+int n = RND.nextInt(nodes() + 1);
+
+Ignite g = grid(n);
+
+try (Transaction tx = g.transactions().txStart()) {
+int cnt = 1 + RND.nextInt(nodes());
+
+for (int j = 0; j < cnt; j++) {
+IgniteCache cache = g.cache(CACHE);
+
+cache.put(RND.nextInt(), RND.nextInt());
+}
+
+tx.commit();
+}
+}, true);
+}
+
+/** */
+@Test
+public void concurrentLoadImplicitTransactionsTest() throws Exception {
+testConcurrentTransactionsAndCuts(() -> {
+// +1 - client node.
+int n = RND.nextInt(nodes() + 1);
+
+IgniteCache cache = grid(n).cache(CACHE);
+
+cache.put(RND.nextInt(), RND.nextInt());
+}, true);
+}
+
+/** */
+@Test
+public void concurrentLoadImplicitTransactionsAndExplicitLocksTest() 
throws Exception {
+testConcurrentTransactionsAndCuts(() -> {
+// +1 - client node.
+int n = RND.nextInt(nodes() + 1

[GitHub] [ignite] nizhikov commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071109454


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/ConcurrentTxsConsistentCutTest.java:
##
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.Lock;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp;
+
+/** Load Ignite with transactions and starts Consistent Cut concurrently. */
+@RunWith(Parameterized.class)
+public class ConcurrentTxsConsistentCutTest extends AbstractConsistentCutTest {
+/** Amount of Consistent Cuts to await. */
+private static final int CUTS = 20;
+
+/** */
+private static final Random RND = new Random();
+
+/** */
+private final AtomicInteger txCnt = new AtomicInteger();
+
+/** Notifies data loader to stop preparing new transactions. */
+private volatile CountDownLatch stopLoadLatch;
+
+/** Number of server nodes. */
+@Parameterized.Parameter
+public int nodes;
+
+/** Number of backups. */
+@Parameterized.Parameter(1)
+public int backups;
+
+/** */
+@Parameterized.Parameter(2)
+public boolean withNearCache;
+
+/** */
+@Parameterized.Parameters(name = "nodes={0}, backups={1}, 
withNearCache={2}")
+public static List params() {
+List> nodesAndBackups = F.asList(
+new T2<>(3, 0),
+new T2<>(2, 1),
+new T2<>(3, 2));
+
+List params = new ArrayList<>();
+
+for (T2 nb: nodesAndBackups) {
+for (boolean near: new boolean[] {false, true})
+params.add(new Object[] {nb.get1(), nb.get2(), near});
+}
+
+return params;
+}
+
+/** {@inheritDoc} */
+@Override protected int nodes() {
+return nodes;
+}
+
+/** {@inheritDoc} */
+@Override protected int backups() {
+return backups;
+}
+
+/** {@inheritDoc} */
+@Override protected boolean withNearCache() {
+return withNearCache;
+}
+
+/** */
+@Test
+public void noLoadTest() throws Exception {
+testConcurrentTransactionsAndCuts(() -> {}, false);
+}
+
+/** */
+@Test
+public void concurrentLoadTransactionsTest() throws Exception {
+testConcurrentTransactionsAndCuts(() -> {
+// +1 - client node.
+int n = RND.nextInt(nodes() + 1);
+
+Ignite g = grid(n);
+
+try (Transaction tx = g.transactions().txStart()) {
+int cnt = 1 + RND.nextInt(nodes());
+
+for (int j = 0; j < cnt; j++) {
+IgniteCache cache = g.cache(CACHE);
+
+cache.put(RND.nextInt(), RND.nextInt());
+}
+
+tx.commit();

Review Comment:
   We need randomly commit or rollback transactions here.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] nizhikov commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071107606


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/ConcurrentTxsConsistentCutTest.java:
##
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.Lock;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp;
+
+/** Load Ignite with transactions and starts Consistent Cut concurrently. */
+@RunWith(Parameterized.class)
+public class ConcurrentTxsConsistentCutTest extends AbstractConsistentCutTest {
+/** Amount of Consistent Cuts to await. */
+private static final int CUTS = 20;
+
+/** */
+private static final Random RND = new Random();
+
+/** */
+private final AtomicInteger txCnt = new AtomicInteger();
+
+/** Notifies data loader to stop preparing new transactions. */
+private volatile CountDownLatch stopLoadLatch;
+
+/** Number of server nodes. */
+@Parameterized.Parameter
+public int nodes;
+
+/** Number of backups. */
+@Parameterized.Parameter(1)
+public int backups;
+
+/** */
+@Parameterized.Parameter(2)
+public boolean withNearCache;
+
+/** */
+@Parameterized.Parameters(name = "nodes={0}, backups={1}, 
withNearCache={2}")
+public static List params() {
+List> nodesAndBackups = F.asList(
+new T2<>(3, 0),
+new T2<>(2, 1),
+new T2<>(3, 2));
+
+List params = new ArrayList<>();
+
+for (T2 nb: nodesAndBackups) {
+for (boolean near: new boolean[] {false, true})
+params.add(new Object[] {nb.get1(), nb.get2(), near});
+}
+
+return params;
+}
+
+/** {@inheritDoc} */
+@Override protected int nodes() {
+return nodes;
+}
+
+/** {@inheritDoc} */
+@Override protected int backups() {
+return backups;
+}
+
+/** {@inheritDoc} */
+@Override protected boolean withNearCache() {
+return withNearCache;
+}
+
+/** */
+@Test
+public void noLoadTest() throws Exception {
+testConcurrentTransactionsAndCuts(() -> {}, false);
+}
+
+/** */
+@Test
+public void concurrentLoadTransactionsTest() throws Exception {
+testConcurrentTransactionsAndCuts(() -> {
+// +1 - client node.
+int n = RND.nextInt(nodes() + 1);
+
+Ignite g = grid(n);
+
+try (Transaction tx = g.transactions().txStart()) {
+int cnt = 1 + RND.nextInt(nodes());
+
+for (int j = 0; j < cnt; j++) {
+IgniteCache cache = g.cache(CACHE);

Review Comment:
   We need to test several cache transactions.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] nizhikov commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071100462


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/ConcurrentTxsConsistentCutTest.java:
##
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.Lock;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp;
+
+/** Load Ignite with transactions and starts Consistent Cut concurrently. */
+@RunWith(Parameterized.class)
+public class ConcurrentTxsConsistentCutTest extends AbstractConsistentCutTest {
+/** Amount of Consistent Cuts to await. */
+private static final int CUTS = 20;
+
+/** */
+private static final Random RND = new Random();
+
+/** */
+private final AtomicInteger txCnt = new AtomicInteger();
+
+/** Notifies data loader to stop preparing new transactions. */
+private volatile CountDownLatch stopLoadLatch;
+
+/** Number of server nodes. */
+@Parameterized.Parameter
+public int nodes;
+
+/** Number of backups. */
+@Parameterized.Parameter(1)
+public int backups;
+
+/** */
+@Parameterized.Parameter(2)
+public boolean withNearCache;
+
+/** */
+@Parameterized.Parameters(name = "nodes={0}, backups={1}, 
withNearCache={2}")
+public static List params() {
+List> nodesAndBackups = F.asList(

Review Comment:
   `int[][]` is enough here.



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite-3] sashapolo opened a new pull request, #1526: IGNITE-18558 Fix Meta Storage prefix overflow

2023-01-16 Thread GitBox


sashapolo opened a new pull request, #1526:
URL: https://github.com/apache/ignite-3/pull/1526

   https://issues.apache.org/jira/browse/IGNITE-18558


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] nizhikov commented on pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on PR #10314:
URL: https://github.com/apache/ignite/pull/10314#issuecomment-1383837598

   Do we have tests that just:
   * performs transactions from several threads to several nodes
   * incremental snapshots created without any interaction with transaction 
threads
   * check files to contain same set of transaction for every cluster node


-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] nizhikov commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071072854


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotTest.java:
##
@@ -219,6 +221,8 @@ public void testFailIfSegmentNotFound() throws Exception {
 
 FileWriteAheadLogManager wal = 
(FileWriteAheadLogManager)srv.context().cache().context().wal();
 
+forceRollWal(srv);

Review Comment:
   Why this change?



-- 
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-unsubscr...@ignite.apache.org

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



[GitHub] [ignite] nizhikov commented on a diff in pull request #10314: IGNITE-17029 Consistent Cut for incremental snapshot

2023-01-16 Thread GitBox


nizhikov commented on code in PR #10314:
URL: https://github.com/apache/ignite/pull/10314#discussion_r1071071348


##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistentcut/ConsistentCutNoBackupMessagesBlockingTest.java:
##
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.consistentcut;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+/** */
+@RunWith(Parameterized.class)
+public class ConsistentCutNoBackupMessagesBlockingTest extends 
AbstractConsistentCutMessagesBlockingTest {
+/** */
+@Parameterized.Parameter
+public BlkNodeType txNodeBlkType;
+
+/** */
+@Parameterized.Parameter(1)
+public BlkCutType cutBlkType;
+
+/** */
+@Parameterized.Parameter(2)
+public BlkNodeType cutNodeBlkType;
+
+/** */
+@Parameterized.Parameters(name = "txNodeBlk={0}, cutBlkAt={1}, 
cutNodeBlk={2}")
+public static List params() {
+List p = new ArrayList<>();
+
+Stream.of(BlkNodeType.NEAR, BlkNodeType.PRIMARY).forEach(txN ->
+Stream.of(BlkNodeType.NEAR, BlkNodeType.PRIMARY).forEach(cutN -> {
+for (BlkCutType c : BlkCutType.values())
+p.add(new Object[] {txN, c, cutN});
+})
+);
+
+return p;
+}
+
+/** */
+@Test
+public void testExplicitTransactions() throws Exception {

Review Comment:
   Why this test case specific to this class only?



-- 
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-unsubscr...@ignite.apache.org

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



<    1   2   3   4   5   6   7   8   9   10   >