private void addPassiveEndpointToServiceRecord() throws IOException { addEndpointToServiceRecord(getNewServiceRecord(), PASSIVE_ENDPOINT); }
private void addActiveEndpointToServiceRecord() throws IOException { addEndpointToServiceRecord(getNewServiceRecord(), ACTIVE_ENDPOINT); }
@Override public void start() throws IOException { super.start(); if (!isClient) { this.srv = getNewServiceRecord(); register(); registerLeaderLatchListener(new HS2LeaderLatchListener(), null); try { // all participating instances uses the same latch path, and curator randomly chooses one instance to be leader // which can be verified via leaderLatch.hasLeadership() leaderLatch.start(); } catch (Exception e) { throw new IOException(e); } LOG.info("Registered HS2 with ZK. service record: {}", srv); } else { populateCache(); LOG.info("Populating instances cache for client"); } }
private void addActiveEndpointToServiceRecord() throws IOException { addEndpointToServiceRecord(getNewServiceRecord(), ACTIVE_ENDPOINT); }
private void addPassiveEndpointToServiceRecord() throws IOException { addEndpointToServiceRecord(getNewServiceRecord(), PASSIVE_ENDPOINT); }
@Override public void start() throws IOException { super.start(); if (!isClient) { this.srv = getNewServiceRecord(); register(); registerLeaderLatchListener(new HS2LeaderLatchListener(), null); try { // all participating instances uses the same latch path, and curator randomly chooses one instance to be leader // which can be verified via leaderLatch.hasLeadership() leaderLatch.start(); } catch (Exception e) { throw new IOException(e); } LOG.info("Registered HS2 with ZK. service record: {}", srv); } else { populateCache(); LOG.info("Populating instances cache for client"); } }