use of com.yahoo.path.Path in project vespa by vespa-engine.
the class CuratorDatabaseClient method lockPath.
/**
* Creates an returns the path to the lock for this application
*/
private Path lockPath(ApplicationId application) {
Path lockPath = root.append("locks").append(application.tenant().value()).append(application.application().value()).append(application.instance().value());
curatorDatabase.create(lockPath);
return lockPath;
}
use of com.yahoo.path.Path in project vespa by vespa-engine.
the class CuratorDatabaseClient method removeNodes.
/**
* Removes multiple nodes in a single transaction.
*
* @param nodes list of the nodes to remove
*/
public void removeNodes(List<Node> nodes) {
NestedTransaction transaction = new NestedTransaction();
for (Node node : nodes) {
Path path = toPath(node.state(), node.hostname());
CuratorTransaction curatorTransaction = curatorDatabase.newCuratorTransactionIn(transaction);
curatorTransaction.add(CuratorOperations.delete(path.getAbsolute()));
}
transaction.commit();
nodes.forEach(node -> log.log(LogLevel.INFO, "Removed node " + node.hostname() + " in state " + node.state()));
}
Aggregations