public static String getExpStatePath(String experimentId) throws ApplicationSettingsException { return AiravataZKUtils.getExpZnodePath(experimentId) + File.separator + "state"; }
public void run() { try { AiravataZKUtils.runZKFromConfig(fServerConfig,fserverCnxnFactory); } catch (IOException e) { logger.error("Error while starting embedded Zookeeper", e); System.exit(3); } } }).start();
public static long getDeliveryTag(String experimentID, CuratorFramework curatorClient, String experimentNode, String pickedChild) throws Exception { String deliveryTagPath = experimentNode + File.separator + pickedChild + File.separator + experimentID + DELIVERY_TAG_POSTFIX; Stat exists = curatorClient.checkExists().forPath(deliveryTagPath); if(exists==null) { logger.error("Cannot find delivery Tag in path:" + deliveryTagPath + " for this experiment"); return -1; } return bytesToLong(curatorClient.getData().storingStatIn(exists).forPath(deliveryTagPath)); } public static byte[] longToBytes(long x) {
public static String getExpState(CuratorFramework curatorClient, String expId) throws Exception { Stat exists = curatorClient.checkExists().forPath(getExpStatePath(expId)); if (exists != null) { return new String(curatorClient.getData().storingStatIn(exists).forPath(getExpStatePath(expId))); } return null; }
public static void main(String args[]) throws ParseException, IOException { CommandLineParameters commandLineParameters = StringUtil.getCommandLineParser(args); if (commandLineParameters.getArguments().contains(STOP_COMMAND_STR)){ performServerStopRequest(commandLineParameters); }else{ AiravataZKUtils.startEmbeddedZK(cnxnFactory); performServerStart(args); } }
public static long getCancelDeliveryTagIfExist(String experimentId, CuratorFramework curatorClient, String experimentNode, String pickedChild) throws Exception { String cancelDeliveryTagPath = experimentNode + File.separator + pickedChild + File.separator + experimentId + AiravataZKUtils.CANCEL_DELIVERY_TAG_POSTFIX; Stat exists = curatorClient.checkExists().forPath(cancelDeliveryTagPath); if (exists == null) { return -1; // no cancel deliverytag found } else { return bytesToLong(curatorClient.getData().storingStatIn(exists).forPath(cancelDeliveryTagPath)); } } }