You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/06/04 15:25:17 UTC

[GitHub] [ignite-3] kgusakov commented on a change in pull request #157: IGNITE-14413 Added start of new node from cli interface.

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 pattern 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:
users@infra.apache.org