Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface ClusterHandle extends Closeable {
* Stops the node at a given index.
* @param index of the node to stop
*/
void stopNode(int index);
void stopNode(int index, boolean forcibly);

/**
* Restarts the cluster. Effectively the same as calling {@link #stop(boolean)} followed by {@link #start()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public void stop(boolean forcibly) {
}

@Override
public void stopNode(int index) {
public void stopNode(int index, boolean forcibly) {
checkHandle();
handle.stopNode(index);
handle.stopNode(index, forcibly);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void start() {
public void stop(boolean forcibly) {
if (started.getAndSet(false)) {
LOGGER.info("Stopping Elasticsearch test cluster '{}', forcibly: {}", name, forcibly);
execute(() -> nodes.parallelStream().forEach(n -> n.stop(forcibly)));
execute(() -> nodes.parallelStream().forEach(n -> stopNode(nodes.indexOf(n), forcibly)));
} else {
// Make sure the process is stopped, otherwise wait
execute(() -> nodes.parallelStream().forEach(Node::waitForExit));
Expand Down Expand Up @@ -167,7 +167,7 @@ public long getPid(int index) {
return nodes.get(index).getPid();
}

public void stopNode(int index) {
public void stopNode(int index, boolean forcibly) {
nodes.get(index).stop(false);
}

Expand Down