/** * Waits until the specified region has completed assignment, or the deadline is reached. */ protected boolean waitForAssignment(final Collection<HRegionInfo> regionSet, final boolean waitTillAllAssigned, final int reassigningRegions, final long minEndTime) throws InterruptedException { long deadline = minEndTime + bulkPerRegionOpenTimeGuesstimate * (reassigningRegions + 1); return waitForAssignment(regionSet, waitTillAllAssigned, deadline); }
/** * Waits until the specified region has completed assignment. * <p> * If the region is already assigned, returns immediately. Otherwise, method * blocks until the region is assigned. * @param regionInfo region to wait on assignment for * @return true if the region is assigned false otherwise. * @throws InterruptedException */ public boolean waitForAssignment(HRegionInfo regionInfo) throws InterruptedException { ArrayList<HRegionInfo> regionSet = new ArrayList<HRegionInfo>(1); regionSet.add(regionInfo); return waitForAssignment(regionSet, true, Long.MAX_VALUE); }
private void waitForRootAssignment() throws InterruptedException { this.catalogTracker.waitForRoot(); // This guarantees that the transition has completed this.assignmentManager.waitForAssignment(HRegionInfo.ROOT_REGIONINFO); }
private void enableSSHandWaitForMeta() throws IOException, InterruptedException { enableServerShutdownHandler(); this.catalogTracker.waitForMeta(); // Above check waits for general meta availability but this does not // guarantee that the transition has completed this.assignmentManager .waitForAssignment(HRegionInfo.FIRST_META_REGIONINFO); }
reassigningRegions = reassignFailedPlans(); assignmentManager.waitForAssignment(regionSet, waitTillAllAssigned, reassigningRegions, Math.max(System.currentTimeMillis(), rpcWaitTime));
if (!waitForAssignment(userRegionSet, true, userRegionSet.size(), System.currentTimeMillis())) { LOG.debug("some user regions are still in transition: " + userRegionSet);
private void enableCrashedServerProcessing(final boolean waitForMeta) throws IOException, InterruptedException { // If crashed server processing is disabled, we enable it and expire those dead but not expired // servers. This is required so that if meta is assigning to a server which dies after // assignMeta starts assignment, ServerCrashProcedure can re-assign it. Otherwise, we will be // stuck here waiting forever if waitForMeta is specified. if (!isServerCrashProcessingEnabled()) { setServerCrashProcessingEnabled(true); this.serverManager.processQueuedDeadServers(); } if (waitForMeta) { metaTableLocator.waitMetaRegionLocation(this.getZooKeeper()); // Above check waits for general meta availability but this does not // guarantee that the transition has completed this.assignmentManager.waitForAssignment(HRegionInfo.FIRST_META_REGIONINFO); } }
if (!waitForAssignment(userRegionSet, true, userRegionSet.size(), System.currentTimeMillis())) { LOG.debug("some user regions are still in transition: " + userRegionSet);