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


##########
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/DataStorageModules.java:
##########
@@ -112,12 +104,50 @@ public Map<String, StorageEngine> createStorageEngines(
     /**
      * Collects {@link DataStorageConfigurationSchema data storage schema} 
fields (with {@link Value}).
      *
+     * @param polymorphicSchemaExtensions {@link PolymorphicConfigInstance 
Polymorphic schema extensions} that contain extensions of {@link
+     * DataStorageConfigurationSchema}.
      * @return Mapping: {@link DataStorageModule#name Data storage name} -> 
filed name -> field type.
+     * @throws IllegalStateException If the {@link 
DataStorageConfigurationSchema data storage schemas} are not valid.
      */
-    public Map<String, Map<String, Class<?>>> collectSchemasFields() {
+    public Map<String, Map<String, Class<?>>> 
collectSchemasFields(Collection<Class<?>> polymorphicSchemaExtensions) {
+        Map<String, Class<? extends DataStorageConfigurationSchema>> schemas = 
polymorphicSchemaExtensions.stream()
+                .filter(DataStorageConfigurationSchema.class::isAssignableFrom)
+                .collect(toUnmodifiableMap(
+                        schemaCls -> schemaName((Class<? extends 
DataStorageConfigurationSchema>) schemaCls),
+                        schemaCls -> (Class<? extends 
DataStorageConfigurationSchema>) schemaCls
+                ));
+
+        Set<String> dataStorageNames = modules.stream()
+                .map(DataStorageModule::name)
+                .collect(toSet());
+
+        if (!dataStorageNames.equals(schemas.keySet())) {
+            List<String> dataStorageWithoutSchema = dataStorageNames.stream()
+                    .filter(not(schemas.keySet()::contains))

Review Comment:
   **containsKey** is fine, correct 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to