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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]