Package org.kitesdk.minicluster

Examples of org.kitesdk.minicluster.MiniCluster$Builder


      }
    }
    for (Entry<String, String> serviceParam : serviceParams.entrySet()) {
      builder.setServiceConfig(serviceParam.getKey(), serviceParam.getValue());
    }
    final MiniCluster miniCluster = builder.build();

    // Create an exit thread that listens for a kill command, and notifies the
    // main thread to exit.
    final CountDownLatch doneSignal = new CountDownLatch(1);
    Thread exitThread = new Thread() {
      @Override
      public void run() {
        try {
          miniCluster.stop();
        } catch (Throwable e) {
          console.error("Error stopping mini cluster. Exiting anyways...", e);
        }
        doneSignal.countDown();
      }
    };
    Runtime.getRuntime().addShutdownHook(exitThread);

    // Start the mini cluster, and wait for the exit notification.
    try {
      miniCluster.start();
      doneSignal.await();
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      return 1;
    }
View Full Code Here

TOP

Related Classes of org.kitesdk.minicluster.MiniCluster$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.