add static close methods to main class entry point
This commit is contained in:
parent
bfb4666b3d
commit
325064c7aa
|
@ -57,9 +57,10 @@ public class Bootstrap {
|
|||
private Node node;
|
||||
|
||||
private static volatile Thread keepAliveThread;
|
||||
|
||||
private static volatile CountDownLatch keepAliveLatch;
|
||||
|
||||
private static Bootstrap bootstrap;
|
||||
|
||||
private void setup(boolean addShutdownHook, Tuple<Settings, Environment> tuple) throws Exception {
|
||||
// Loggers.getLogger(Bootstrap.class, tuple.v1().get("name")).info("heap_size {}/{}", JvmStats.jvmStats().mem().heapCommitted(), JvmInfo.jvmInfo().mem().heapMax());
|
||||
if (tuple.v1().getAsBoolean("bootstrap.mlockall", false)) {
|
||||
|
@ -137,10 +138,14 @@ public class Bootstrap {
|
|||
node.close();
|
||||
}
|
||||
|
||||
public static void close(String[] args) {
|
||||
bootstrap.destroy();
|
||||
keepAliveLatch.countDown();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("es.logger.prefix", "");
|
||||
Bootstrap bootstrap = new Bootstrap();
|
||||
bootstrap = new Bootstrap();
|
||||
String pidFile = System.getProperty("es-pidfile");
|
||||
|
||||
// enable jline by default when running form "main" (and not on windows)
|
||||
|
|
|
@ -24,6 +24,10 @@ package org.elasticsearch.bootstrap;
|
|||
*/
|
||||
public class ElasticSearch extends Bootstrap {
|
||||
|
||||
public static void close(String[] args) {
|
||||
Bootstrap.close(args);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Bootstrap.main(args);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue