sanpwc commented on a change in pull request #114:
URL: https://github.com/apache/ignite-3/pull/114#discussion_r627763245



##########
File path: 
modules/runner/src/main/java/org/apache/ignite/internal/storage/LocalConfigurationStorage.java
##########
@@ -49,47 +70,122 @@ public LocalConfigurationStorage(VaultManager vaultMgr) {
         this.vaultMgr = vaultMgr;
     }
 
-    /** Map to store values. */
-    private Map<String, Serializable> map = new ConcurrentHashMap<>();
-
     /** Change listeners. */
     private List<ConfigurationStorageListener> listeners = new 
CopyOnWriteArrayList<>();
 
     /** Storage version. */
-    private AtomicLong version = new AtomicLong(0);
+    private AtomicLong ver = new AtomicLong(0);
+
+    /** Start key in range for searching local configuration keys. */
+    private static final ByteArray locKeysStartRange = 
ByteArray.fromString(LOC_PREFIX + ".");
+
+    /** End key in range for searching local configuration keys. */
+    private static final ByteArray locKeysEndRange = 
ByteArray.fromString(LOC_PREFIX + (char)('.' + 1));
 
     /** {@inheritDoc} */
     @Override public synchronized Data readAll() throws StorageException {
-        return new Data(new HashMap<>(map), version.get(), 0);
+        Iterator<Entry> iter =
+            vaultMgr.range(locKeysStartRange, locKeysEndRange);
+
+        HashMap<String, Serializable> data = new HashMap<>();
+
+        while (iter.hasNext()) {
+            Entry val = iter.next();
+
+            data.put(val.key().toString().replaceFirst(LOC_PREFIX + ".", ""),
+                (Serializable)ByteUtils.fromBytes(val.value()));
+        }
+
+        // TODO: Need to restore version from pds when restart will be 
developed

Review comment:
       ticket




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

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


Reply via email to