kgusakov commented on a change in pull request #157:
URL: https://github.com/apache/ignite-3/pull/157#discussion_r645660045



##########
File path: 
modules/vault/src/main/java/org/apache/ignite/internal/vault/VaultManager.java
##########
@@ -171,6 +175,31 @@ public boolean bootstrapped() {
         }
     }
 
+    /**
+     * Persist node name to the vault.
+     *
+     * @param name Node name to persist.
+     * @return Future representing pending completion of the operation. 
Couldn't be {@code null}.
+     */
+    @NotNull public CompletableFuture<Void> putName(@NotNull String name) {
+        return put(NODE_NAME, name.getBytes(StandardCharsets.UTF_8));
+    }
+
+    /**
+     * @return Node name, if was stored earlier.
+     * @throws IgniteInternalCheckedException If couldn't get node name from 
the vault.
+     */
+    public String name() throws IgniteInternalCheckedException {
+        synchronized (mux) {
+            try {
+                return new String(vaultService.get(NODE_NAME).get().value());

Review comment:
       Looks like this change can break some invariants, which were the causes 
for mutex in general. As we discussed earlier - this pattern of waiting is used 
in all methods of VaultManager.




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