alievmirza commented on a change in pull request #157:
URL: https://github.com/apache/ignite-3/pull/157#discussion_r646485089
##########
File path:
modules/runner/src/main/java/org/apache/ignite/internal/app/IgnitionImpl.java
##########
@@ -80,11 +82,14 @@
private static final String VER_KEY = "version";
/** {@inheritDoc} */
- @Override public synchronized Ignite start(String jsonStrBootstrapCfg) {
+ @Override public synchronized Ignite start(@NotNull String nodeName,
@Nullable String jsonStrBootstrapCfg) {
+ assert !StringUtil.isNullOrEmpty(nodeName) : "Node local name is
empty";
+
ackBanner();
// Vault Component startup.
VaultManager vaultMgr = new VaultManager(new VaultServiceImpl());
+ vaultMgr.putName(nodeName).join();
Review comment:
empty line
##########
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(),
StandardCharsets.UTF_8);
Review comment:
`vaultService.get(NODE_NAME).get().value()` could be null
##########
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.
Review comment:
```suggestion
* @param name Node name to persist. Couldn't be null.
```
--
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]