@Override public String register() throws IOException { updateEndpoint(srv, PASSIVE_ENDPOINT); return registerServiceRecord(srv, uniqueId); }
@Override public String toString() { String result = "instanceId: " + getWorkerIdentity() + " isLeader: " + isLeader + " host: " + getHost() + " port: " + getRpcPort() + " transportMode: " + transportMode; if (httpEndpoint != null) { result += " httpEndpoint: " + httpEndpoint; } return result; } }
@Override public void run() { hiveServer2.stop(); } };
@Override public Thread newThread(Runnable runnable) { Thread newThread = new ThreadWithGarbageCleanup(runnable); newThread.setName(namePrefix + ": Thread-" + newThread.getId()); return newThread; }
@Override public HiveServer2Instance getInstance(final String instanceId) { for (HiveServer2Instance hs2Instance : getAll()) { if (hs2Instance.getWorkerIdentity().equals(instanceId)) { return hs2Instance; } } return null; }
private void addActiveEndpointToServiceRecord() throws IOException { addEndpointToServiceRecord(getNewServiceRecord(), ACTIVE_ENDPOINT); }
private void addEndpointToServiceRecord( final ServiceRecord srv, final String endpointName) throws IOException { updateEndpoint(srv, endpointName); updateServiceRecord(srv, doCheckAcls, true); }
private void populateCache() throws IOException { PathChildrenCache pcc = ensureInstancesCache(0); populateCache(pcc, false); }
public String getHiveServer2HostName() throws Exception { if (hiveServer2 == null) { return null; } return hiveServer2.getServerHost(); }
@Override public void failover() throws Exception { hs2HARegistry.failover(); } }
@Override public int size() { return sizeInternal(); }
@Override public Collection<HiveServer2Instance> getAll() { return getAllInternal(); }
@Override public Set<HiveServer2Instance> getByHost(final String host) { return getByHostInternal(host); }
@Override public void unregister() { CloseableUtils.closeQuietly(leaderLatch); unregisterInternal(); }
private void stopHiveServer() { if (server != null) { // kill server server.stop(); } }
private void addPassiveEndpointToServiceRecord() throws IOException { addEndpointToServiceRecord(getNewServiceRecord(), PASSIVE_ENDPOINT); }
protected static void stopHiveServer2() throws Exception { if (hiveServer2 != null) { hiveServer2.stop(); } }
protected static void stopHiveServer2() throws Exception { if (hiveServer2 != null) { hiveServer2.stop(); } }
@AfterClass public static void afterTests() throws Exception { hiveServer2.stop(); } }