korlov42 commented on code in PR #783:
URL: https://github.com/apache/ignite-3/pull/783#discussion_r855215222


##########
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/DataStorageManager.java:
##########
@@ -99,12 +109,13 @@ public Consumer<DataStorageChange> 
defaultTableDataStorageConsumer(String defaul
     /**
      * Returns the default data storage.
      *
-     * @param defaultDataStorageView View of {@link 
TablesConfigurationSchema#defaultDataStorage}. For the case {@link
+     * <p>{@link TablesConfigurationSchema#defaultDataStorage} is used. For 
the case {@link
      * UnknownDataStorageConfigurationSchema#UNKNOWN_DATA_STORAGE} and there 
is only one engine, then it will be the default.
      */
-    public String defaultDataStorage(String defaultDataStorageView) {
-        return !defaultDataStorageView.equals(UNKNOWN_DATA_STORAGE) || 
engines.size() > 1
-                ? defaultDataStorageView : first(engines.keySet());
+    public String defaultDataStorage() {
+        String defaultDataStorage = defaultDataStorageConfig.value();
+
+        return !defaultDataStorage.equals(UNKNOWN_DATA_STORAGE) || 
engines.size() > 1 ? defaultDataStorage : first(engines.keySet());

Review Comment:
   I don't sure it's safe to return the first value of a set. If there is a 
such invariant like `either engines.size() == 1 or defaultDataStorage is not 
unknown`, let's validate this first.



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