You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/05/30 11:32:33 UTC

[GitHub] [ignite-3] tkalkirill opened a new pull request, #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

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

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


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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886657918


##########
examples/pom.xml:
##########
@@ -60,6 +60,11 @@
             <artifactId>ignite-client</artifactId>
         </dependency>
 
+        <dependency>

Review Comment:
   Changed to **<scope>test</scope>**



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886611251


##########
examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java:
##########
@@ -52,7 +59,16 @@ public void startNode() {
 
         IgnitionManager.init(TEST_NODE_NAME, List.of(TEST_NODE_NAME), "cluster");
 
-        assertThat(ignite, willCompleteSuccessfully());
+        assertThat(igniteFuture, willCompleteSuccessfully());
+
+        ignite = (IgniteImpl) igniteFuture.get(1, TimeUnit.MILLISECONDS);
+
+        ignite
+                .clusterConfiguration()

Review Comment:
   Add comment



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886661595


##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:version}<br>
+ *         For example:<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:3.0.0-SNAPSHOT}<br>
+ *     </li>
+ *     <li>
+ *         Start a server node using the CLI tool:<br>
+ *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}

Review Comment:
   You are right, but I propose to do this in a separate ticket.



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886616811


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PageMemoryStorageEngine.java:
##########
@@ -109,4 +107,18 @@ public TableStorage createTable(TableConfiguration tableCfg) {
 
         return new VolatilePageMemoryTableStorage(tableCfg, dataRegion);
     }
+
+    /**
+     * Creates, starts and adds a new date region to the engine.
+     *
+     * @param name Data region name.
+     * @param dataRegionConfig Data region configuration.
+     */
+    private void addDataRegion(String name, PageMemoryDataRegionConfiguration dataRegionConfig, int pageSize) {

Review Comment:
   Yes, I can 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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886663847


##########
examples/src/main/java/org/apache/ignite/example/rebalance/RebalanceExample.java:
##########
@@ -40,17 +40,32 @@
  * <ol>
  *     <li>Import the examples project into you IDE.</li>
  *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
  *         Start <b>two</b> nodes using the CLI tool:<br>
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}<br>
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-second-node}
  *     </li>
+ *     <li>
+ *         Cluster initialization using the CLI tool (if not done yet):<br>
+ *         {@code ignite cluster init --cluster-name=ignite-cluster --node-endpoint=localhost:10300 --meta-storage-node=my-first-node}
+ *     </li>
  *     <li>Run the example in the IDE.</li>
  *     <li>
- *         When requested, start another two nodes using the CLI tool:
+ *         When requested, start another <b>two</b> nodes using the CLI tool:
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-additional-node}<br>
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-second-additional-node}
  *     </li>
  *     <li>Press {@code Enter} to resume the example.</li>
+ *     <li>
+ *         Stop <b>four</b> nodes using the CLI tool:<br>
+ *         {@code ignite node stop --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}<br>

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886613166


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PageMemoryStorageEngine.java:
##########
@@ -109,4 +107,18 @@ public TableStorage createTable(TableConfiguration tableCfg) {
 
         return new VolatilePageMemoryTableStorage(tableCfg, dataRegion);
     }
+
+    /**
+     * Creates, starts and adds a new date region to the engine.

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886716967


##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:version}<br>
+ *         For example:<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:3.0.0-SNAPSHOT}<br>
+ *     </li>
+ *     <li>
+ *         Start a server node using the CLI tool:<br>
+ *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}
+ *     </li>
+ *     <li>
+ *         Cluster initialization using the CLI tool (if not done yet):<br>
+ *         {@code ignite cluster init --cluster-name=ignite-cluster --node-endpoint=localhost:10300 --meta-storage-node=my-first-node}
+ *     </li>
+ *     <li>
+ *         Add configuration for in-memory data region of of the PageMemory storage engine using the CLI tool (if not done yet):<br>
+ *         {@code ignite config set --type=cluster "{pageMemory:{regions:[{name:in-memory,persistent:false}]}}"}

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886618614


##########
examples/src/main/java/org/apache/ignite/example/tx/TransactionsExample.java:
##########
@@ -32,10 +32,22 @@
  * <ol>
  *     <li>Import the examples project into you IDE.</li>
  *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886764197


##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>

Review Comment:
   Well made **PageMemory** the default engine.



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886968104


##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read abaut [cli](https://ignite.apache.org/docs/3.0.0-alpha/ignite-cli-tool).

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

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


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
ibessonov commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886586276


##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>

Review Comment:
   Shouldn't it be there by default?



##########
examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java:
##########
@@ -52,7 +59,16 @@ public void startNode() {
 
         IgnitionManager.init(TEST_NODE_NAME, List.of(TEST_NODE_NAME), "cluster");
 
-        assertThat(ignite, willCompleteSuccessfully());
+        assertThat(igniteFuture, willCompleteSuccessfully());
+
+        ignite = (IgniteImpl) igniteFuture.get(1, TimeUnit.MILLISECONDS);

Review Comment:
   You can call "get" without timeout, future is already completed at this point



##########
examples/pom.xml:
##########
@@ -60,6 +60,11 @@
             <artifactId>ignite-client</artifactId>
         </dependency>
 
+        <dependency>

Review Comment:
   I'm against this decision as well, why would you explicitly depend on internal module? I actually need an answer



##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read [../modules/cli/README.md](../modules/cli/README.md).

Review Comment:
   Are you sure that it's a good idea to redirect users into a project with source code? Examples modules is a thing by itself, at least this is what I thought



##########
examples/src/main/java/org/apache/ignite/example/rebalance/RebalanceExample.java:
##########
@@ -40,17 +40,32 @@
  * <ol>
  *     <li>Import the examples project into you IDE.</li>
  *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
  *         Start <b>two</b> nodes using the CLI tool:<br>
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}<br>
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-second-node}
  *     </li>
+ *     <li>
+ *         Cluster initialization using the CLI tool (if not done yet):<br>
+ *         {@code ignite cluster init --cluster-name=ignite-cluster --node-endpoint=localhost:10300 --meta-storage-node=my-first-node}
+ *     </li>
  *     <li>Run the example in the IDE.</li>
  *     <li>
- *         When requested, start another two nodes using the CLI tool:
+ *         When requested, start another <b>two</b> nodes using the CLI tool:
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-additional-node}<br>
  *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-second-additional-node}
  *     </li>
  *     <li>Press {@code Enter} to resume the example.</li>
+ *     <li>
+ *         Stop <b>four</b> nodes using the CLI tool:<br>
+ *         {@code ignite node stop --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}<br>

Review Comment:
   What's going on here? Why tf would you need to pass a config file when you're stopping a node?



##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:version}<br>
+ *         For example:<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:3.0.0-SNAPSHOT}<br>
+ *     </li>
+ *     <li>
+ *         Start a server node using the CLI tool:<br>
+ *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}
+ *     </li>
+ *     <li>
+ *         Cluster initialization using the CLI tool (if not done yet):<br>
+ *         {@code ignite cluster init --cluster-name=ignite-cluster --node-endpoint=localhost:10300 --meta-storage-node=my-first-node}
+ *     </li>
+ *     <li>
+ *         Add configuration for in-memory data region of of the PageMemory storage engine using the CLI tool (if not done yet):<br>
+ *         {@code ignite config set --type=cluster "{pageMemory:{regions:[{name:in-memory,persistent:false}]}}"}

Review Comment:
   Actually, I would advice to use simplified syntax. Here, it's enough to do the following:
   `pageMemory.regions.in-memory: { persistent = false }` we don't need that many braces. Also, how common is it to use dashes in names? I don't know



##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:version}<br>
+ *         For example:<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:3.0.0-SNAPSHOT}<br>
+ *     </li>
+ *     <li>
+ *         Start a server node using the CLI tool:<br>
+ *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}

Review Comment:
   We should move configs to HOCON btw, otherwise no one will ever know that we can do so. I'm not sure that we need to do it right now, but eventually - for sure. JSON sucks



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PageMemoryStorageEngine.java:
##########
@@ -64,26 +70,18 @@ public PageMemoryStorageEngine(
     public void start() {
         int pageSize = engineConfig.pageSize().value();
 
-        VolatilePageMemoryDataRegion defaultRegion = new VolatilePageMemoryDataRegion(
-                engineConfig.defaultRegion(),
-                ioRegistry, pageSize
-        );
+        addDataRegion(DEFAULT_DATA_REGION_NAME, engineConfig.defaultRegion(), pageSize);
 
-        defaultRegion.start();
+        // TODO: IGNITE-17066 Add handling deleting/updating data regions configuration
+        engineConfig.regions().listenElements(new ConfigurationNamedListListener<>() {

Review Comment:
   I'm sorry, I don't think that this is correct and that this is what we have discussed privately. This should be done with "any" listeners and they have to be registered in constructor, not during the start.
   And, as always, everything is synchronous. I'm not asking to change it now, but I see a very dangerous tendency - we don't think "parallel", there's a lot of baggage already in the code that must be redone.



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

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

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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
sashapolo commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886586354


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PageMemoryStorageEngine.java:
##########
@@ -109,4 +107,18 @@ public TableStorage createTable(TableConfiguration tableCfg) {
 
         return new VolatilePageMemoryTableStorage(tableCfg, dataRegion);
     }
+
+    /**
+     * Creates, starts and adds a new date region to the engine.

Review Comment:
   ```suggestion
        * Creates, starts and adds a new data region to the engine.
   ```



##########
modules/cli/README.md:
##########
@@ -22,6 +22,10 @@ Node start:
 Node stop:
 
     ignite stop consistent-id
+
+Cluster initialization:
+
+    ignite cluster init --cluster-name=cluster-name --node-endpoint=localhost:10300 --meta-storage-node=consistent-id --cmg-node=consistent-id

Review Comment:
   missing newline



##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:version}<br>
+ *         For example:<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:3.0.0-SNAPSHOT}<br>
+ *     </li>
+ *     <li>
+ *         Start a server node using the CLI tool:<br>
+ *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}
+ *     </li>
+ *     <li>
+ *         Cluster initialization using the CLI tool (if not done yet):<br>
+ *         {@code ignite cluster init --cluster-name=ignite-cluster --node-endpoint=localhost:10300 --meta-storage-node=my-first-node}
+ *     </li>
+ *     <li>
+ *         Add configuration for in-memory data region of of the PageMemory storage engine using the CLI tool (if not done yet):<br>
+ *         {@code ignite config set --type=cluster "{pageMemory:{regions:[{name:in-memory,persistent:false}]}}"}
+ *     </li>
+ *     <li>Run the example in the IDE.</li>
+ *     <li>
+ *         Stop a server node using the CLI tool:<br>
+ *         {@code ignite node stop my-first-node}
+ *     </li>
+ *     <li>
+ *         Remove module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>

Review Comment:
   Why is this step required?



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PageMemoryStorageEngine.java:
##########
@@ -109,4 +107,18 @@ public TableStorage createTable(TableConfiguration tableCfg) {
 
         return new VolatilePageMemoryTableStorage(tableCfg, dataRegion);
     }
+
+    /**
+     * Creates, starts and adds a new date region to the engine.
+     *
+     * @param name Data region name.
+     * @param dataRegionConfig Data region configuration.
+     */
+    private void addDataRegion(String name, PageMemoryDataRegionConfiguration dataRegionConfig, int pageSize) {

Review Comment:
   Why do we need the `pageSize` parameter? Can it be computed based on the `engineConfig` field?



##########
examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java:
##########
@@ -52,7 +59,16 @@ public void startNode() {
 
         IgnitionManager.init(TEST_NODE_NAME, List.of(TEST_NODE_NAME), "cluster");
 
-        assertThat(ignite, willCompleteSuccessfully());
+        assertThat(igniteFuture, willCompleteSuccessfully());
+
+        ignite = (IgniteImpl) igniteFuture.get(1, TimeUnit.MILLISECONDS);

Review Comment:
   you can use `join()` here, because the future is guaranteed to be completed after the assertion above



##########
examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java:
##########
@@ -52,7 +59,16 @@ public void startNode() {
 
         IgnitionManager.init(TEST_NODE_NAME, List.of(TEST_NODE_NAME), "cluster");
 
-        assertThat(ignite, willCompleteSuccessfully());
+        assertThat(igniteFuture, willCompleteSuccessfully());
+
+        ignite = (IgniteImpl) igniteFuture.get(1, TimeUnit.MILLISECONDS);
+
+        ignite
+                .clusterConfiguration()

Review Comment:
   What is this for? Can you leave a comment?



##########
examples/src/main/java/org/apache/ignite/example/tx/TransactionsExample.java:
##########
@@ -32,10 +32,22 @@
  * <ol>
  *     <li>Import the examples project into you IDE.</li>
  *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>

Review Comment:
   ```suggestion
    *         Download and prepare artifacts for running an Ignite node using the CLI tool (if not done yet):<br>
   ```



##########
examples/src/main/java/org/apache/ignite/example/tx/TransactionsExample.java:
##########
@@ -32,10 +32,22 @@
  * <ol>
  *     <li>Import the examples project into you IDE.</li>
  *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>

Review Comment:
   please apply this to all similar places



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886978937


##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read abaut [cli](https://ignite.apache.org/docs/3.0.0-alpha/ignite-cli-tool).
 
-To run any other example, do the following:
-1. Import the examples project into you IDE.
-2. Start a server node using the CLI tool:
-   ```
-   ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node
-   ```
-3. Initialize the node using the following command:
-   ```
-   ignite cluster init --node-endpoint 'localhost:10300' --meta-storage-node 'my-first-node' --cluster-name 'ignite-cluster'
-   ```
-4. Run the preferred example in the IDE.
+To run the examples, refer to their JavaDoc for instructions.
+
+If errors occur at the cluster initialization step, it is recommended to delete the `ignite-work` directory and repeat the instruction to run the example.

Review Comment:
   Remove 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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
ibessonov commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r887683763


##########
modules/storage-api/src/test/java/org/apache/ignite/internal/storage/DataStorageManagerTest.java:
##########
@@ -87,7 +87,7 @@ void testDefaultDataStorageSingleStorage() {
                 dataStorageModules.createStorageEngines(mock(ConfigurationRegistry.class), workDir)
         );
 
-        assertThat(FIRST, equalTo(dataStorageManager.defaultDataStorage()));
+        assertThat("pagememory", equalTo(dataStorageManager.defaultDataStorage()));

Review Comment:
   What a weird test it is now



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

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

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


[GitHub] [ignite-3] slukyano commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
slukyano commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886706108


##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>

Review Comment:
   Pretty sure `PageMemory` should be the default. It preserves compatibility with 2.x behavior better, and it's more universal than LSM.



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

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

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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
sashapolo commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886622609


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PageMemoryStorageEngine.java:
##########
@@ -64,26 +70,18 @@ public PageMemoryStorageEngine(
     public void start() {
         int pageSize = engineConfig.pageSize().value();
 
-        VolatilePageMemoryDataRegion defaultRegion = new VolatilePageMemoryDataRegion(
-                engineConfig.defaultRegion(),
-                ioRegistry, pageSize
-        );
+        addDataRegion(DEFAULT_DATA_REGION_NAME, engineConfig.defaultRegion(), pageSize);
 
-        defaultRegion.start();
+        // TODO: IGNITE-17066 Add handling deleting/updating data regions configuration
+        engineConfig.regions().listenElements(new ConfigurationNamedListListener<>() {

Review Comment:
   > they have to be registered in constructor, not during the start
   
   Why?



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

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

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


[GitHub] [ignite-3] slukyano commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
slukyano commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886703715


##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read [../modules/cli/README.md](../modules/cli/README.md).

Review Comment:
   I'd suggest to replace with a link to public docs: https://ignite.apache.org/docs/3.0.0-alpha/ignite-cli-tool.



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886718586


##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read [../modules/cli/README.md](../modules/cli/README.md).

Review Comment:
   Replace 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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r887762909


##########
modules/storage-api/src/test/java/org/apache/ignite/internal/storage/DataStorageManagerTest.java:
##########
@@ -87,7 +87,7 @@ void testDefaultDataStorageSingleStorage() {
                 dataStorageModules.createStorageEngines(mock(ConfigurationRegistry.class), workDir)
         );
 
-        assertThat(FIRST, equalTo(dataStorageManager.defaultDataStorage()));
+        assertThat("pagememory", equalTo(dataStorageManager.defaultDataStorage()));

Review Comment:
   Try add comment.



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

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

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


[GitHub] [ignite-3] ibessonov merged pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
ibessonov merged PR #831:
URL: https://github.com/apache/ignite-3/pull/831


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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886623629


##########
examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java:
##########
@@ -52,7 +59,16 @@ public void startNode() {
 
         IgnitionManager.init(TEST_NODE_NAME, List.of(TEST_NODE_NAME), "cluster");
 
-        assertThat(ignite, willCompleteSuccessfully());
+        assertThat(igniteFuture, willCompleteSuccessfully());
+
+        ignite = (IgniteImpl) igniteFuture.get(1, TimeUnit.MILLISECONDS);

Review Comment:
   Fix it with join() by Alexander suggestion



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886619895


##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:version}<br>
+ *         For example:<br>
+ *         {@code ignite module add mvn:org.apache.ignite:ignite-storage-page-memory:3.0.0-SNAPSHOT}<br>
+ *     </li>
+ *     <li>
+ *         Start a server node using the CLI tool:<br>
+ *         {@code ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node}
+ *     </li>
+ *     <li>
+ *         Cluster initialization using the CLI tool (if not done yet):<br>
+ *         {@code ignite cluster init --cluster-name=ignite-cluster --node-endpoint=localhost:10300 --meta-storage-node=my-first-node}
+ *     </li>
+ *     <li>
+ *         Add configuration for in-memory data region of of the PageMemory storage engine using the CLI tool (if not done yet):<br>
+ *         {@code ignite config set --type=cluster "{pageMemory:{regions:[{name:in-memory,persistent:false}]}}"}
+ *     </li>
+ *     <li>Run the example in the IDE.</li>
+ *     <li>
+ *         Stop a server node using the CLI tool:<br>
+ *         {@code ignite node stop my-first-node}
+ *     </li>
+ *     <li>
+ *         Remove module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>

Review Comment:
   It is needed so as not to break other examples where tables are created without specifying "ENGINE".



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886605592


##########
examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java:
##########
@@ -52,7 +59,16 @@ public void startNode() {
 
         IgnitionManager.init(TEST_NODE_NAME, List.of(TEST_NODE_NAME), "cluster");
 
-        assertThat(ignite, willCompleteSuccessfully());
+        assertThat(igniteFuture, willCompleteSuccessfully());
+
+        ignite = (IgniteImpl) igniteFuture.get(1, TimeUnit.MILLISECONDS);

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886611891


##########
modules/cli/README.md:
##########
@@ -22,6 +22,10 @@ Node start:
 Node stop:
 
     ignite stop consistent-id
+
+Cluster initialization:
+
+    ignite cluster init --cluster-name=cluster-name --node-endpoint=localhost:10300 --meta-storage-node=consistent-id --cmg-node=consistent-id

Review Comment:
   Add new line



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886675924


##########
examples/src/main/java/org/apache/ignite/example/storage/VolatilePageMemoryStorageExample.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.example.storage;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * This example demonstrates a usage of the PageMemory storage engine configured with an in-memory data region.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for run Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite init}
+ *     </li>
+ *     <li>
+ *         Add module "ignite-storage-page-memory" using the CLI tool (if not done yet):<br>

Review Comment:
   @slukyano Do you think we should add the `PageMemory` storage engine to the **ignite-3** default jar or as an add-on module?
   
   If we add, the user may get the following problems:
   - It is necessary to explicitly specify the engine when creating tables through SQL, or do not forget to set up a cluster configuration where the engine will be set by default.
   
   I suggest making the engine as addable.



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

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

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


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
ibessonov commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r887717949


##########
modules/storage-api/src/test/java/org/apache/ignite/internal/storage/DataStorageManagerTest.java:
##########
@@ -87,7 +87,7 @@ void testDefaultDataStorageSingleStorage() {
                 dataStorageModules.createStorageEngines(mock(ConfigurationRegistry.class), workDir)
         );
 
-        assertThat(FIRST, equalTo(dataStorageManager.defaultDataStorage()));
+        assertThat("pagememory", equalTo(dataStorageManager.defaultDataStorage()));

Review Comment:
   @tkalkirill Can you please explain this scenario? It's not intuitive



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886667787


##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read [../modules/cli/README.md](../modules/cli/README.md).

Review Comment:
   @slukyano Do you think it's worth removing the link to the internal documentation on the **cli**? 
   When I ran the example for the first time, it was not clear to me how to work with the **cli** and how to run it, but according to this documentation, everything became clear and easy for me.



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

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

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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
sashapolo commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886938183


##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read abaut [cli](https://ignite.apache.org/docs/3.0.0-alpha/ignite-cli-tool).

Review Comment:
   ```suggestion
   Before running the examples, read about [cli](https://ignite.apache.org/docs/3.0.0-alpha/ignite-cli-tool).
   ```



##########
examples/README.md:
##########
@@ -10,17 +10,10 @@ The following examples are included:
 * `KeyValueViewExample` - demonstrates the usage of the `org.apache.ignite.table.KeyValueView` API
 * `SqlJdbcExample` - demonstrates the usage of the Apache Ignite JDBC driver.
 * `RebalanceExample` - demonstrates the data rebalancing process.
+* `VolatilePageMemoryStorageExample` - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.
 
-To run the `RebalanceExample`, refer to its JavaDoc for instructions.
+Before running the examples, read abaut [cli](https://ignite.apache.org/docs/3.0.0-alpha/ignite-cli-tool).
 
-To run any other example, do the following:
-1. Import the examples project into you IDE.
-2. Start a server node using the CLI tool:
-   ```
-   ignite node start --config=$IGNITE_HOME/examples/config/ignite-config.json my-first-node
-   ```
-3. Initialize the node using the following command:
-   ```
-   ignite cluster init --node-endpoint 'localhost:10300' --meta-storage-node 'my-first-node' --cluster-name 'ignite-cluster'
-   ```
-4. Run the preferred example in the IDE.
+To run the examples, refer to their JavaDoc for instructions.
+
+If errors occur at the cluster initialization step, it is recommended to delete the `ignite-work` directory and repeat the instruction to run the example.

Review Comment:
   I think this is quite a misleading sentence - it makes an impression that we may fail for no reason and you need to remove everything. I think it would be better to specify what error are you talking about and why it happens



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886659194


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PageMemoryStorageEngine.java:
##########
@@ -64,26 +70,18 @@ public PageMemoryStorageEngine(
     public void start() {
         int pageSize = engineConfig.pageSize().value();
 
-        VolatilePageMemoryDataRegion defaultRegion = new VolatilePageMemoryDataRegion(
-                engineConfig.defaultRegion(),
-                ioRegistry, pageSize
-        );
+        addDataRegion(DEFAULT_DATA_REGION_NAME, engineConfig.defaultRegion(), pageSize);
 
-        defaultRegion.start();
+        // TODO: IGNITE-17066 Add handling deleting/updating data regions configuration
+        engineConfig.regions().listenElements(new ConfigurationNamedListListener<>() {

Review Comment:
   Discussed personally, leave as is.
   
   @sashapolo doesn't need move to constructor, @ibessonov made a mistake.



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

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

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


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #831: IGNITE-17044 [Native Persistence 3.0] End-to-end test for in-memory PageMemory

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #831:
URL: https://github.com/apache/ignite-3/pull/831#discussion_r886657918


##########
examples/pom.xml:
##########
@@ -60,6 +60,11 @@
             <artifactId>ignite-client</artifactId>
         </dependency>
 
+        <dependency>

Review Comment:
   Changed to `<scope>test</scope>`



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

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

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