diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-28 11:13:40 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-28 11:13:40 +0200 |
commit | e5de1e735aa181dc27968f4edf932753ee430220 (patch) | |
tree | 1eb36f1c96387e1f6866de04db1540602f73073a /node-repository | |
parent | 7ada3f35324a0fd19a79c3d9247c312e7ff22f1a (diff) |
Better javadoc
Diffstat (limited to 'node-repository')
2 files changed, 10 insertions, 3 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java index d7a5594659f..c90fea04e46 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java @@ -94,7 +94,7 @@ public class NodeRepository extends AbstractComponent { * Finds and returns the nodes of the given type in any of the given states. * * @param type the node type to return - * @param inState the states to return nodes from. If no states are given, all nodes of the given type is returned + * @param inState the states to return nodes from. If no states are given, all nodes of the given type are returned * @return the node, or empty if it was not found in any of the given states */ public List<Node> getNodes(Node.Type type, Node.State ... inState) { diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDatabaseClient.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDatabaseClient.java index 751d93c8235..3152db59427 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDatabaseClient.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDatabaseClient.java @@ -27,6 +27,7 @@ import java.util.logging.Logger; /** * Client which reads and writes nodes to a curator database. * Nodes are stored in files named <code>/provision/v1/[nodestate]/[hostname]</code>. + * * The responsibility of this class is to turn operations on the level of node states, applications and nodes * into operations on the level of file paths and bytes. * @@ -194,14 +195,20 @@ public class CuratorDatabaseClient { return nodes; } - /** Returns all nodes allocated to the given application which are in one of the given states */ + /** + * Returns all nodes allocated to the given application which are in one of the given states + * If no states are given this returns all nodes. + */ public List<Node> getNodes(ApplicationId applicationId, Node.State ... states) { List<Node> nodes = getNodes(states); nodes.removeIf(node -> ! node.allocation().isPresent() || ! node.allocation().get().owner().equals(applicationId)); return nodes; } - /** Returns a particular node, or empty if there is no such node in this state */ + /** + * Returns a particular node, or empty if this noe is not in any of the given states. + * If no states are given this returns the node if it is present in any state. + */ public Optional<Node> getNode(String hostname, Node.State ... states) { if (states.length == 0) states = Node.State.values(); |