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/06/08 17:31:08 UTC

[GitHub] [ignite-3] sashapolo opened a new pull request, #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

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

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


-- 
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] SammyVimes closed pull request #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

Posted by GitBox <gi...@apache.org>.
SammyVimes closed pull request #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples
URL: https://github.com/apache/ignite-3/pull/868


-- 
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] SammyVimes commented on a diff in pull request #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

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


##########
modules/storage-rocksdb/src/test/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageEngineTest.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * 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.storage.rocksdb;
+
+import static org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfigurationSchema.DEFAULT_DATA_REGION_NAME;
+import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import java.nio.file.Path;
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.configuration.schemas.table.HashIndexConfigurationSchema;
+import org.apache.ignite.configuration.schemas.table.TableConfiguration;
+import org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
+import org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
+import org.apache.ignite.internal.storage.engine.TableStorage;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfiguration;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfigurationSchema;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfiguration;
+import org.apache.ignite.internal.testframework.WorkDirectory;
+import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Tests for {@link RocksDbStorageEngine}.
+ */
+@ExtendWith(WorkDirectoryExtension.class)
+@ExtendWith(ConfigurationExtension.class)
+public class RocksDbStorageEngineTest {
+    private RocksDbStorageEngine engine;
+
+    @InjectConfiguration
+    private RocksDbStorageEngineConfiguration engineConfig;
+
+    @BeforeEach
+    void setUp(@WorkDirectory Path workDir) {
+        engine = new RocksDbStorageEngine(engineConfig, workDir);
+
+        engine.start();
+    }
+
+    @AfterEach
+    void tearDown() {
+        engine.stop();
+    }
+
+    @Test
+    void testCreateTableWithDefaultDataRegion(
+            @InjectConfiguration(
+                    value = "mock.dataStorage.name=rocksdb",
+                    name = "table",
+                    polymorphicExtensions = {
+                            HashIndexConfigurationSchema.class,
+                            RocksDbDataStorageConfigurationSchema.class
+                    }
+            ) TableConfiguration tableCfg
+    ) {
+        TableStorage table = engine.createTable(tableCfg);
+
+        table.start();
+
+        try {
+            var dataStorageConfig = (RocksDbDataStorageConfiguration) table.configuration().dataStorage();

Review Comment:
   var!



##########
modules/storage-rocksdb/src/test/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageEngineTest.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * 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.storage.rocksdb;
+
+import static org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfigurationSchema.DEFAULT_DATA_REGION_NAME;
+import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import java.nio.file.Path;
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.configuration.schemas.table.HashIndexConfigurationSchema;
+import org.apache.ignite.configuration.schemas.table.TableConfiguration;
+import org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
+import org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
+import org.apache.ignite.internal.storage.engine.TableStorage;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfiguration;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfigurationSchema;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfiguration;
+import org.apache.ignite.internal.testframework.WorkDirectory;
+import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Tests for {@link RocksDbStorageEngine}.
+ */
+@ExtendWith(WorkDirectoryExtension.class)
+@ExtendWith(ConfigurationExtension.class)
+public class RocksDbStorageEngineTest {
+    private RocksDbStorageEngine engine;
+
+    @InjectConfiguration
+    private RocksDbStorageEngineConfiguration engineConfig;
+
+    @BeforeEach
+    void setUp(@WorkDirectory Path workDir) {
+        engine = new RocksDbStorageEngine(engineConfig, workDir);
+
+        engine.start();
+    }
+
+    @AfterEach
+    void tearDown() {
+        engine.stop();
+    }
+
+    @Test
+    void testCreateTableWithDefaultDataRegion(
+            @InjectConfiguration(
+                    value = "mock.dataStorage.name=rocksdb",
+                    name = "table",
+                    polymorphicExtensions = {
+                            HashIndexConfigurationSchema.class,
+                            RocksDbDataStorageConfigurationSchema.class
+                    }
+            ) TableConfiguration tableCfg
+    ) {
+        TableStorage table = engine.createTable(tableCfg);
+
+        table.start();
+
+        try {
+            var dataStorageConfig = (RocksDbDataStorageConfiguration) table.configuration().dataStorage();
+
+            assertThat(dataStorageConfig.dataRegion().value(), is(DEFAULT_DATA_REGION_NAME));
+
+            table.getOrCreatePartition(1);
+        } finally {
+            table.stop();
+        }
+    }
+
+    @Test
+    void testCreateTableWithDynamicCustomDataRegion(
+            @InjectConfiguration(
+                    value = "mock.dataStorage{name=rocksdb, dataRegion=foobar}",
+                    name = "table",
+                    polymorphicExtensions = {
+                            HashIndexConfigurationSchema.class,
+                            RocksDbDataStorageConfigurationSchema.class
+                    }
+            ) TableConfiguration tableCfg
+    ) {
+        String customRegionName = "foobar";
+
+        CompletableFuture<Void> engineConfigChangeFuture = engineConfig.regions()
+                .change(c -> c.create(customRegionName, rocksDbDataRegionChange -> {}));
+
+        assertThat(engineConfigChangeFuture, willCompleteSuccessfully());
+
+        TableStorage table = engine.createTable(tableCfg);
+
+        table.start();
+
+        try {
+            var dataStorageConfig = (RocksDbDataStorageConfiguration) table.configuration().dataStorage();

Review Comment:
   var!



-- 
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] rpuch commented on pull request #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

Posted by GitBox <gi...@apache.org>.
rpuch commented on PR #868:
URL: https://github.com/apache/ignite-3/pull/868#issuecomment-1150255184

   Looks good to 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 #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

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


##########
modules/storage-rocksdb/src/test/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageEngineTest.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * 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.storage.rocksdb;
+
+import static org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfigurationSchema.DEFAULT_DATA_REGION_NAME;
+import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import java.nio.file.Path;
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.configuration.schemas.table.HashIndexConfigurationSchema;
+import org.apache.ignite.configuration.schemas.table.TableConfiguration;
+import org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
+import org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
+import org.apache.ignite.internal.storage.engine.TableStorage;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfiguration;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfigurationSchema;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfiguration;
+import org.apache.ignite.internal.testframework.WorkDirectory;
+import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Tests for {@link RocksDbStorageEngine}.
+ */
+@ExtendWith(WorkDirectoryExtension.class)
+@ExtendWith(ConfigurationExtension.class)
+public class RocksDbStorageEngineTest {
+    private RocksDbStorageEngine engine;
+
+    @InjectConfiguration
+    private RocksDbStorageEngineConfiguration engineConfig;
+
+    @BeforeEach
+    void setUp(@WorkDirectory Path workDir) {
+        engine = new RocksDbStorageEngine(engineConfig, workDir);
+
+        engine.start();
+    }
+
+    @AfterEach
+    void tearDown() {
+        engine.stop();
+    }
+
+    @Test
+    void testCreateTableWithDefaultDataRegion(
+            @InjectConfiguration(
+                    value = "mock.dataStorage.name=rocksdb",
+                    name = "table",
+                    polymorphicExtensions = {
+                            HashIndexConfigurationSchema.class,
+                            RocksDbDataStorageConfigurationSchema.class
+                    }
+            ) TableConfiguration tableCfg
+    ) {
+        TableStorage table = engine.createTable(tableCfg);
+
+        table.start();
+
+        try {
+            var dataStorageConfig = (RocksDbDataStorageConfiguration) table.configuration().dataStorage();
+
+            assertThat(dataStorageConfig.dataRegion().value(), is(DEFAULT_DATA_REGION_NAME));
+
+            table.getOrCreatePartition(1);
+        } finally {
+            table.stop();
+        }
+    }
+
+    @Test
+    void testCreateTableWithDynamicCustomDataRegion(
+            @InjectConfiguration(
+                    value = "mock.dataStorage{name=rocksdb, dataRegion=foobar}",
+                    name = "table",
+                    polymorphicExtensions = {
+                            HashIndexConfigurationSchema.class,
+                            RocksDbDataStorageConfigurationSchema.class
+                    }
+            ) TableConfiguration tableCfg
+    ) {
+        String customRegionName = "foobar";
+
+        CompletableFuture<Void> engineConfigChangeFuture = engineConfig.regions()
+                .change(c -> c.create(customRegionName, rocksDbDataRegionChange -> {}));
+
+        assertThat(engineConfigChangeFuture, willCompleteSuccessfully());
+
+        TableStorage table = engine.createTable(tableCfg);
+
+        table.start();
+
+        try {
+            var dataStorageConfig = (RocksDbDataStorageConfiguration) table.configuration().dataStorage();

Review Comment:
   what's wrong with that?



##########
modules/storage-rocksdb/src/test/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageEngineTest.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * 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.storage.rocksdb;
+
+import static org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfigurationSchema.DEFAULT_DATA_REGION_NAME;
+import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import java.nio.file.Path;
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.configuration.schemas.table.HashIndexConfigurationSchema;
+import org.apache.ignite.configuration.schemas.table.TableConfiguration;
+import org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
+import org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
+import org.apache.ignite.internal.storage.engine.TableStorage;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfiguration;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbDataStorageConfigurationSchema;
+import org.apache.ignite.internal.storage.rocksdb.configuration.schema.RocksDbStorageEngineConfiguration;
+import org.apache.ignite.internal.testframework.WorkDirectory;
+import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Tests for {@link RocksDbStorageEngine}.
+ */
+@ExtendWith(WorkDirectoryExtension.class)
+@ExtendWith(ConfigurationExtension.class)
+public class RocksDbStorageEngineTest {
+    private RocksDbStorageEngine engine;
+
+    @InjectConfiguration
+    private RocksDbStorageEngineConfiguration engineConfig;
+
+    @BeforeEach
+    void setUp(@WorkDirectory Path workDir) {
+        engine = new RocksDbStorageEngine(engineConfig, workDir);
+
+        engine.start();
+    }
+
+    @AfterEach
+    void tearDown() {
+        engine.stop();
+    }
+
+    @Test
+    void testCreateTableWithDefaultDataRegion(
+            @InjectConfiguration(
+                    value = "mock.dataStorage.name=rocksdb",
+                    name = "table",
+                    polymorphicExtensions = {
+                            HashIndexConfigurationSchema.class,
+                            RocksDbDataStorageConfigurationSchema.class
+                    }
+            ) TableConfiguration tableCfg
+    ) {
+        TableStorage table = engine.createTable(tableCfg);
+
+        table.start();
+
+        try {
+            var dataStorageConfig = (RocksDbDataStorageConfiguration) table.configuration().dataStorage();

Review Comment:
   what's wrong with that?



-- 
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 #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

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


##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageEngine.java:
##########
@@ -75,19 +78,27 @@ public RocksDbStorageEngine(RocksDbStorageEngineConfiguration engineConfig, Path
     /** {@inheritDoc} */
     @Override
     public void start() throws StorageException {
-        RocksDbDataRegion defaultRegion = new RocksDbDataRegion(engineConfig.defaultRegion());
+        registerDataRegion(engineConfig.defaultRegion());
+
+        // TODO: IGNITE-17066 Add handling deleting/updating data regions configuration
+        engineConfig.regions().listenElements(new ConfigurationNamedListListener<>() {
+            @Override
+            public CompletableFuture<?> onCreate(ConfigurationNotificationEvent<RocksDbDataRegionView> ctx) {
+                registerDataRegion(ctx.config(RocksDbDataRegionConfiguration.class));
 
-        defaultRegion.start();
+                return CompletableFuture.completedFuture(null);
+            }
+        });
+    }
 
-        regions.put(DEFAULT_DATA_REGION_NAME, defaultRegion);
+    private void registerDataRegion(RocksDbDataRegionConfiguration dataRegionConfig) {
+        var region = new RocksDbDataRegion(dataRegionConfig);
 
-        for (String regionName : engineConfig.regions().value().namedListKeys()) {

Review Comment:
   Actually, no. When creating an Ignite instance, listeners get notified on start, please see the `IgniteImpl#notifyConfigurationListeners` method
   



-- 
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 #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

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


##########
examples/src/main/java/org/apache/ignite/example/storage/RocksDbStorageExample.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+/**
+ * This example demonstrates a usage of the RocksDB storage engine.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for running an Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite bootstrap}
+ *     </li>
+ *     <li>
+ *         Start an Ignite 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>

Review Comment:
   found that myself too)



-- 
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] SammyVimes commented on pull request #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

Posted by GitBox <gi...@apache.org>.
SammyVimes commented on PR #868:
URL: https://github.com/apache/ignite-3/pull/868#issuecomment-1150347272

   Thank you for the contribution, merged:
   
   `main` branch – d25a08941a3a415d5586af5a456d3ffaf25afa8d
   `ignite-3.0.0-alpha5` branch – 61649d2942bbeb99ef29e615b42d83d548d9b242


-- 
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] rpuch commented on a diff in pull request #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

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


##########
examples/src/main/java/org/apache/ignite/example/storage/RocksDbStorageExample.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+/**
+ * This example demonstrates a usage of the RocksDB storage engine.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>

Review Comment:
   you -> your



##########
examples/src/main/java/org/apache/ignite/example/storage/RocksDbStorageExample.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+/**
+ * This example demonstrates a usage of the RocksDB storage engine.
+ *
+ * <p>To run the example, do the following:
+ * <ol>
+ *     <li>Import the examples project into you IDE.</li>
+ *     <li>
+ *         Download and prepare artifacts for running an Ignite node using the CLI tool (if not done yet):<br>
+ *         {@code ignite bootstrap}
+ *     </li>
+ *     <li>
+ *         Start an Ignite 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>

Review Comment:
   'of of' -> of



##########
examples/src/main/java/org/apache/ignite/example/storage/StorageEngineExample.java:
##########
@@ -0,0 +1,147 @@
+/*
+ * 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.SQLException;
+import java.sql.Statement;
+
+/**
+ * Base class for executing examples that demonstrate working with different storage engines.

Review Comment:
   'Base' often means that it's a class intended for subclassing, but here it's not the case. How about removing this word?



-- 
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] SammyVimes commented on a diff in pull request #868: IGNITE-17139 Fix creation of new RocksDB data regions and add examples

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


##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbStorageEngine.java:
##########
@@ -75,19 +78,27 @@ public RocksDbStorageEngine(RocksDbStorageEngineConfiguration engineConfig, Path
     /** {@inheritDoc} */
     @Override
     public void start() throws StorageException {
-        RocksDbDataRegion defaultRegion = new RocksDbDataRegion(engineConfig.defaultRegion());
+        registerDataRegion(engineConfig.defaultRegion());
+
+        // TODO: IGNITE-17066 Add handling deleting/updating data regions configuration
+        engineConfig.regions().listenElements(new ConfigurationNamedListListener<>() {
+            @Override
+            public CompletableFuture<?> onCreate(ConfigurationNotificationEvent<RocksDbDataRegionView> ctx) {
+                registerDataRegion(ctx.config(RocksDbDataRegionConfiguration.class));
 
-        defaultRegion.start();
+                return CompletableFuture.completedFuture(null);
+            }
+        });
+    }
 
-        regions.put(DEFAULT_DATA_REGION_NAME, defaultRegion);
+    private void registerDataRegion(RocksDbDataRegionConfiguration dataRegionConfig) {
+        var region = new RocksDbDataRegion(dataRegionConfig);
 
-        for (String regionName : engineConfig.regions().value().namedListKeys()) {

Review Comment:
   This shouldn't be removed, we still need to create preconfigured regions



-- 
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