import org.apache.zookeeper.ZooKeeper;
public class Shutdown {
public static void main(String[] args) throws IOException, KeeperException, InterruptedException {
BlurConfiguration configuration = new BlurConfiguration();
String zkConnectionStr = ThriftServer.isEmpty(configuration.get(BLUR_ZOOKEEPER_CONNECTION),
BLUR_ZOOKEEPER_CONNECTION);
int sessionTimeout = configuration.getInt(BLUR_ZOOKEEPER_TIMEOUT, BLUR_ZOOKEEPER_TIMEOUT_DEFAULT);
final ZooKeeper zooKeeper = ZkUtils.newZooKeeper(zkConnectionStr, sessionTimeout);
String cluster = configuration.get(BLUR_CLUSTER_NAME, BLUR_CLUSTER);
String shutdownPath = ZookeeperPathConstants.getShutdownPath(cluster);
zooKeeper.create(shutdownPath, null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {