/** * Verify <code>hbase:meta</code> is deployed and accessible. * @param hConnection * @param zkw * @param timeout How long to wait on zk for meta address (passed through to * @param replicaId * @return True if the <code>hbase:meta</code> location is healthy. * @throws InterruptedException * @throws IOException */ public boolean verifyMetaRegionLocation(HConnection hConnection, ZooKeeperWatcher zkw, final long timeout, int replicaId) throws InterruptedException, IOException { AdminProtos.AdminService.BlockingInterface service = null; try { service = getMetaServerConnection(hConnection, zkw, timeout, replicaId); } catch (NotAllMetaRegionsOnlineException e) { // Pass } catch (ServerNotRunningYetException e) { // Pass -- remote server is not up so can't be carrying root } catch (UnknownHostException e) { // Pass -- server name doesn't resolve so it can't be assigned anything. } catch (RegionServerStoppedException e) { // Pass -- server name sends us to a server that is dying or already dead. } return (service != null) && verifyRegionLocation(service, getMetaRegionLocation(zkw, replicaId), RegionReplicaUtil.getRegionInfoForReplica( HRegionInfo.FIRST_META_REGIONINFO, replicaId).getRegionName()); }
/** * Verify <code>hbase:meta</code> is deployed and accessible. * * @param connection the connection to use * @param zkw reference to the {@link ZKWatcher} which also contains configuration and operation * @param timeout How long to wait on zk for meta address (passed through to * @param replicaId the ID of the replica * @return True if the <code>hbase:meta</code> location is healthy. * @throws InterruptedException if waiting for the socket operation fails * @throws IOException if the number of retries for getting the connection is exceeded */ public boolean verifyMetaRegionLocation(ClusterConnection connection, ZKWatcher zkw, final long timeout, int replicaId) throws InterruptedException, IOException { AdminProtos.AdminService.BlockingInterface service = null; try { service = getMetaServerConnection(connection, zkw, timeout, replicaId); } catch (NotAllMetaRegionsOnlineException e) { // Pass } catch (ServerNotRunningYetException e) { // Pass -- remote server is not up so can't be carrying root } catch (UnknownHostException e) { // Pass -- server name doesn't resolve so it can't be assigned anything. } catch (RegionServerStoppedException e) { // Pass -- server name sends us to a server that is dying or already dead. } return (service != null) && verifyRegionLocation(connection, service, getMetaRegionLocation(zkw, replicaId), RegionReplicaUtil.getRegionInfoForReplica( RegionInfoBuilder.FIRST_META_REGIONINFO, replicaId).getRegionName()); }