void restart(RestartCallback callback) throws Exception { assert callback != null; if (!node.isClosed()) { node.close(); } Settings newSettings = callback.onNodeStopped(name); if (newSettings == null) { newSettings = ImmutableSettings.EMPTY; } if (callback.clearData(name)) { NodeEnvironment nodeEnv = getInstanceFromNode(NodeEnvironment.class, node); if (nodeEnv.hasNodeFile()) { FileSystemUtils.deleteRecursively(nodeEnv.nodeDataLocations()); } } node = (InternalNode) nodeBuilder().settings(node.settings()).settings(newSettings).node(); resetClient(); }