/** * returns the unique uuid describing this node. The uuid is persistent in the data folder of this node * and remains across restarts. **/ public String nodeId() { // we currently only return the ID and hide the underlying nodeMetaData implementation in order to avoid // confusion with other "metadata" like node settings found in elasticsearch.yml. In future // we can encapsulate both (and more) in one NodeMetaData (or NodeSettings) object ala IndexSettings return nodeMetaData.nodeId(); }
/** * returns the unique uuid describing this node. The uuid is persistent in the data folder of this node * and remains across restarts. **/ public String nodeId() { // we currently only return the ID and hide the underlying nodeMetaData implementation in order to avoid // confusion with other "metadata" like node settings found in elasticsearch.yml. In future // we can encapsulate both (and more) in one NodeMetaData (or NodeSettings) object ala IndexSettings return nodeMetaData.nodeId(); }
/** * returns the unique uuid describing this node. The uuid is persistent in the data folder of this node * and remains across restarts. **/ public String nodeId() { // we currently only return the ID and hide the underlying nodeMetaData implementation in order to avoid // confusion with other "metadata" like node settings found in elasticsearch.yml. In future // we can encapsulate both (and more) in one NodeMetaData (or NodeSettings) object ala IndexSettings return nodeMetaData.nodeId(); }
private void printRerouteCommand(ShardPath shardPath, Terminal terminal, boolean allocateStale) throws IOException { final IndexMetaData indexMetaData = IndexMetaData.FORMAT.loadLatestState(logger, namedXContentRegistry, shardPath.getDataPath().getParent()); final Path nodePath = getNodePath(shardPath); final NodeMetaData nodeMetaData = NodeMetaData.FORMAT.loadLatestState(logger, namedXContentRegistry, nodePath); if (nodeMetaData == null) { throw new ElasticsearchException("No node meta data at " + nodePath); } final String nodeId = nodeMetaData.nodeId(); final String index = indexMetaData.getIndex().getName(); final int id = shardPath.getShardId().id(); final AllocationCommands commands = new AllocationCommands( allocateStale ? new AllocateStalePrimaryAllocationCommand(index, id, nodeId, false) : new AllocateEmptyPrimaryAllocationCommand(index, id, nodeId, false)); terminal.println(""); terminal.println("POST /_cluster/reroute'\n" + Strings.toString(commands, true, true) + "'"); terminal.println(""); terminal.println("You must accept the possibility of data loss by changing parameter `accept_data_loss` to `true`."); terminal.println(""); }
this.logger = Loggers.getLogger(getClass(), Node.addNodeNameIfNeeded(settings, this.nodeMetaData.nodeId()));
private void printRerouteCommand(ShardPath shardPath, Terminal terminal, boolean allocateStale) throws IOException { final IndexMetaData indexMetaData = IndexMetaData.FORMAT.loadLatestState(logger, namedXContentRegistry, shardPath.getDataPath().getParent()); final Path nodePath = getNodePath(shardPath); final NodeMetaData nodeMetaData = NodeMetaData.FORMAT.loadLatestState(logger, namedXContentRegistry, nodePath); if (nodeMetaData == null) { throw new ElasticsearchException("No node meta data at " + nodePath); } final String nodeId = nodeMetaData.nodeId(); final String index = indexMetaData.getIndex().getName(); final int id = shardPath.getShardId().id(); final AllocationCommands commands = new AllocationCommands( allocateStale ? new AllocateStalePrimaryAllocationCommand(index, id, nodeId, false) : new AllocateEmptyPrimaryAllocationCommand(index, id, nodeId, false)); terminal.println(""); terminal.println("POST /_cluster/reroute'\n" + Strings.toString(commands, true, true) + "'"); terminal.println(""); terminal.println("You must accept the possibility of data loss by changing parameter `accept_data_loss` to `true`."); terminal.println(""); }
private void printRerouteCommand(ShardPath shardPath, Terminal terminal, boolean allocateStale) throws IOException { final IndexMetaData indexMetaData = IndexMetaData.FORMAT.loadLatestState(logger, namedXContentRegistry, shardPath.getDataPath().getParent()); final Path nodePath = getNodePath(shardPath); final NodeMetaData nodeMetaData = NodeMetaData.FORMAT.loadLatestState(logger, namedXContentRegistry, nodePath); if (nodeMetaData == null) { throw new ElasticsearchException("No node meta data at " + nodePath); } final String nodeId = nodeMetaData.nodeId(); final String index = indexMetaData.getIndex().getName(); final int id = shardPath.getShardId().id(); final AllocationCommands commands = new AllocationCommands( allocateStale ? new AllocateStalePrimaryAllocationCommand(index, id, nodeId, false) : new AllocateEmptyPrimaryAllocationCommand(index, id, nodeId, false)); terminal.println(""); terminal.println("POST /_cluster/reroute'\n" + Strings.toString(commands, true, true) + "'"); terminal.println(""); terminal.println("You must accept the possibility of data loss by changing parameter `accept_data_loss` to `true`."); terminal.println(""); }