aboutsummaryrefslogtreecommitdiffstats
path: root/zkfacade/src/main/java/com/yahoo/vespa
diff options
context:
space:
mode:
Diffstat (limited to 'zkfacade/src/main/java/com/yahoo/vespa')
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java11
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java2
2 files changed, 9 insertions, 4 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java
index 169aee416e5..ba597d177c4 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java
@@ -228,7 +228,9 @@ public class Curator extends AbstractComponent implements AutoCloseable {
/** @see #create(Path, Duration) */
- public boolean create(Path path) { return create(path, null); }
+ public boolean create(Path path) {
+ return create(path, null);
+ }
/**
* Creates an empty node at a path, creating any parents as necessary.
@@ -238,6 +240,7 @@ public class Curator extends AbstractComponent implements AutoCloseable {
public boolean create(Path path, Duration ttl) {
return create(path, ttl, null);
}
+
private boolean create(Path path, Duration ttl, Stat stat) {
if (exists(path)) return false;
@@ -261,7 +264,9 @@ public class Curator extends AbstractComponent implements AutoCloseable {
}
/**
- * Creates all the given paths in a single transaction. Any paths which already exists are ignored.
+ * Creates all the given paths in a single transaction. Any paths which already exists are ignored.<br>
+ * <em>No, this is <strong>NOT</strong> atomic, when viewed from other ZK clients!</em> Maybe it once was, but it is not anymore,
+ * unless ZK is configured to run commits and read in a single thread, which is not the default.
*/
public void createAtomically(Path... paths) {
try {
@@ -271,7 +276,7 @@ public class Curator extends AbstractComponent implements AutoCloseable {
transaction = transaction.create().forPath(path.getAbsolute(), new byte[0]).and();
}
}
- ((CuratorTransactionFinal)transaction).commit();
+ ((CuratorTransactionFinal) transaction).commit();
} catch (Exception e) {
throw new RuntimeException("Could not create " + Arrays.toString(paths), e);
}
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java
index 01db658594f..fd6008ac4f9 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LatencyMetrics.java
@@ -59,7 +59,7 @@ public class LatencyMetrics {
/** Returns the average number of intervals that ended in the period per second. */
public double endHz() { return roundTo3DecimalPlaces(endHz); }
- /** Returns the average load of the implied time periond, for each thread with non-zero load, with 3 decimal places precision. */
+ /** Returns the average load of the implied time period, for each thread with non-zero load, with 3 decimal places precision. */
public Map<String, Double> loadByThread() {
Map<String, Double> result = new TreeMap<>();
loadByThread.forEach((name, load) -> result.put(name, roundTo3DecimalPlaces(load)));