MetaEntry m = new MetaEntry(metaLocation.getRegionInfo(), sn, EnvironmentEdgeManager.currentTime()); HbckInfo hbckInfo = regionInfoMap.get(metaLocation.getRegionInfo().getEncodedName()); if (hbckInfo == null) {
/** * Record the location of the ROOT region as found in ZooKeeper, * as if it were in a META table. This is so that we can check * deployment of ROOT. */ private boolean recordRootRegion() throws IOException { HRegionLocation rootLocation = connection.locateRegion( HConstants.ROOT_TABLE_NAME, HConstants.EMPTY_START_ROW); // Check if Root region is valid and existing if (rootLocation == null || rootLocation.getRegionInfo() == null || rootLocation.getHostname() == null) { errors.reportError(ERROR_CODE.NULL_ROOT_REGION, "Root Region or some of its attributes are null."); return false; } ServerName sn; try { sn = getRootRegionServerName(); } catch (InterruptedException e) { throw new IOException("Interrupted", e); } MetaEntry m = new MetaEntry(rootLocation.getRegionInfo(), sn, System.currentTimeMillis()); HbckInfo hbInfo = new HbckInfo(m); regionInfoMap.put(rootLocation.getRegionInfo().getEncodedName(), hbInfo); return true; }
MetaEntry m = new MetaEntry(hri, sn, ts, daughters.getFirst(), daughters.getSecond()); HbckInfo hbInfo = new HbckInfo(m); HbckInfo previous = regionInfoMap.put(hri.getEncodedName(), hbInfo);
MetaEntry m = new MetaEntry(hri, sn, ts, daughters.getFirst(), daughters.getSecond()); HbckInfo hbInfo = new HbckInfo(m); HbckInfo previous = regionInfoMap.put(hri.getEncodedName(), hbInfo);
/** * Record the location of the hbase:meta region as found in ZooKeeper. */ private boolean recordMetaRegion() throws IOException { RegionLocations rl = ((ClusterConnection)connection).locateRegion(TableName.META_TABLE_NAME, HConstants.EMPTY_START_ROW, false, false); if (rl == null) { errors.reportError(ERROR_CODE.NULL_META_REGION, "META region or some of its attributes are null."); return false; } for (HRegionLocation metaLocation : rl.getRegionLocations()) { // Check if Meta region is valid and existing if (metaLocation == null || metaLocation.getRegionInfo() == null || metaLocation.getHostname() == null) { errors.reportError(ERROR_CODE.NULL_META_REGION, "META region or some of its attributes are null."); return false; } ServerName sn = metaLocation.getServerName(); MetaEntry m = new MetaEntry(metaLocation.getRegionInfo(), sn, EnvironmentEdgeManager.currentTime()); HbckInfo hbckInfo = regionInfoMap.get(metaLocation.getRegionInfo().getEncodedName()); if (hbckInfo == null) { regionInfoMap.put(metaLocation.getRegionInfo().getEncodedName(), new HbckInfo(m)); } else { hbckInfo.metaEntry = m; } } return true; }
static HbckInfo genHbckInfo(TableName table, byte[] start, byte[] end, int time) { return new HbckInfo(new MetaEntry(new HRegionInfo(table, start, end), null, time)); }
static HbckInfo genHbckInfo(TableName table, byte[] start, byte[] end, int time) { return new HbckInfo(new MetaEntry(new HRegionInfo(table, start, end), null, time)); }