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


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -326,7 +329,7 @@ public CompletableFuture<Void> 
createZone(DistributionZoneConfigurationParameter
                                     ConfigurationValidationException.class)
                     );
                 } else {
-                    fut.complete(null);
+                    fut.complete(zoneIdContainer[0]);

Review Comment:
   You can probably just read the value from the configuration, but ok.
   Why not `AtomicInteger` by the way?



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -118,9 +116,9 @@ public class DdlSqlToCommandConverter {
     private final Map<String, Map<String, DdlOptionInfo<CreateZoneCommand, 
?>>> dataStorageOptionInfos;
 
     /** Mapping: Zone option ID -> DDL option info. */
-    private final Map<IgniteSqlZoneOptionEnum, 
DdlOptionInfo<CreateZoneCommand, ?>> zoneOptionInfos;
+    private final Map<ZoneOptionEnum, DdlOptionInfo<CreateZoneCommand, ?>> 
zoneOptionInfos;

Review Comment:
   Unrelated question, but why don't we use `EnumMap` here? Using hash maps for 
enum keys is a little silly



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -519,7 +517,7 @@ private CreateZoneCommand 
convertCreateZone(IgniteSqlCreateZone createZoneNode,
 
         Map<String, DdlOptionInfo<CreateZoneCommand, ?>> dsOptInfos = 
dataStorageOptionInfos.get(dataStorageName);
 
-        Set<String> knownOptionNames = 
EnumSet.allOf(IgniteSqlZoneOptionEnum.class).stream().map(Enum::name).collect(Collectors.toSet());
+        Set<String> knownOptionNames = 
EnumSet.allOf(ZoneOptionEnum.class).stream().map(Enum::name).collect(Collectors.toSet());

Review Comment:
   This could be a constant, why do we calculate it every time?



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

Reply via email to