/** * Instantiates a new endpoint node. * * @param nodeInfo the node info * @param zkClient Zookeeper client */ public OperationsNode(OperationsNodeInfo nodeInfo, CuratorFramework zkClient) { super(zkClient); this.nodeInfo = nodeInfo; this.nodeInfo.setTimeStarted(System.currentTimeMillis()); }
/** * Instantiates a new endpoint node. * * @param nodeInfo the node info */ public OperationsNode(OperationsNodeInfo nodeInfo) { super(); this.nodeInfo = nodeInfo; this.nodeInfo.setTimeStarted(System.currentTimeMillis()); }
@Override public void doWithZkClient(CuratorFramework client) throws Exception { nodeInfo.setTimeStarted(System.currentTimeMillis()); nodePath = client .create() .creatingParentsIfNeeded() .withMode(CreateMode.EPHEMERAL_SEQUENTIAL) .forPath(OPERATIONS_SERVER_NODE_PATH + OPERATIONS_SERVER_NODE_PATH, operationsNodeAvroConverter.get().toByteArray(nodeInfo)); LOG.info("Created node with path: " + nodePath); } });