本文整理匯總了Java中org.apache.hadoop.hbase.HRegionInfo.isMetaRegion方法的典型用法代碼示例。如果您正苦於以下問題:Java HRegionInfo.isMetaRegion方法的具體用法?Java HRegionInfo.isMetaRegion怎麽用?Java HRegionInfo.isMetaRegion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hbase.HRegionInfo
的用法示例。
在下文中一共展示了HRegionInfo.isMetaRegion方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: OpenedRegionHandler
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
public OpenedRegionHandler(Server server,
AssignmentManager assignmentManager, HRegionInfo regionInfo,
OpenRegionCoordination coordination,
OpenRegionCoordination.OpenRegionDetails ord) {
super(server, EventType.RS_ZK_REGION_OPENED);
this.assignmentManager = assignmentManager;
this.regionInfo = regionInfo;
this.coordination = coordination;
this.ord = ord;
if(regionInfo.isMetaRegion()) {
priority = OpenedPriority.META;
} else if(regionInfo.getTable()
.getNamespaceAsString().equals(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR)) {
priority = OpenedPriority.SYSTEM;
} else {
priority = OpenedPriority.USER;
}
}
示例2: closeMetaTableRegions
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
/**
* Close meta region if we carry it
*
* @param abort Whether we're running an abort.
*/
void closeMetaTableRegions(final boolean abort) {
Region meta = null;
this.lock.writeLock().lock();
try {
for (Map.Entry<String, Region> e : onlineRegions.entrySet()) {
HRegionInfo hri = e.getValue().getRegionInfo();
if (hri.isMetaRegion()) {
meta = e.getValue();
}
if (meta != null) break;
}
} finally {
this.lock.writeLock().unlock();
}
if (meta != null) closeRegionIgnoreErrors(meta.getRegionInfo(), abort);
}
示例3: regionOffline
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
/**
* A region is offline, won't be in transition any more. Its state
* should be the specified expected state, which can only be
* Split/Merged/Offline/null(=Offline)/SplittingNew/MergingNew.
*/
public void regionOffline(
final HRegionInfo hri, final State expectedState) {
Preconditions.checkArgument(expectedState == null
|| RegionState.isUnassignable(expectedState),
"Offlined region should not be " + expectedState);
if (isRegionInState(hri, State.SPLITTING_NEW, State.MERGING_NEW)) {
// Remove it from all region maps
deleteRegion(hri);
return;
}
State newState =
expectedState == null ? State.OFFLINE : expectedState;
updateRegionState(hri, newState);
String encodedName = hri.getEncodedName();
synchronized (this) {
regionsInTransition.remove(encodedName);
ServerName oldServerName = regionAssignments.remove(hri);
if (oldServerName != null && serverHoldings.containsKey(oldServerName)) {
if (newState == State.MERGED || newState == State.SPLIT
|| hri.isMetaRegion() || tableStateManager.isTableState(hri.getTable(),
ZooKeeperProtos.Table.State.DISABLED, ZooKeeperProtos.Table.State.DISABLING)) {
// Offline the region only if it's merged/split, or the table is disabled/disabling.
// Otherwise, offline it from this server only when it is online on a different server.
LOG.info("Offlined " + hri.getShortNameToLog() + " from " + oldServerName);
removeFromServerHoldings(oldServerName, hri);
removeFromReplicaMapping(hri);
} else {
// Need to remember it so that we can offline it from this
// server when it is online on a different server.
oldAssignments.put(encodedName, oldServerName);
}
}
}
}
示例4: ClosedRegionHandler
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
public ClosedRegionHandler(Server server, AssignmentManager assignmentManager,
HRegionInfo regionInfo) {
super(server, EventType.RS_ZK_REGION_CLOSED);
this.assignmentManager = assignmentManager;
this.regionInfo = regionInfo;
if(regionInfo.isMetaRegion()) {
priority = ClosedPriority.META;
} else {
priority = ClosedPriority.USER;
}
}
示例5: getLog
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
/**
* @return the WAL associated with the given region
* @throws IOException e
*/
public synchronized WAL getLog(HRegionInfo info) throws IOException {
if (this.walFactory == null) {
String logName =
HConstants.HREGION_LOGDIR_NAME + "_" + System.currentTimeMillis();
final Configuration walConf = new Configuration(this.conf);
FSUtils.setRootDir(walConf, fs.getHomeDirectory());
this.walFactory = new WALFactory(walConf, null, logName);
}
final byte[] region = info.getEncodedNameAsBytes();
return info.isMetaRegion() ? walFactory.getMetaWAL(region) : walFactory.getWAL(region);
}
示例6: getNonMetaRegion
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
private HRegionInfo getNonMetaRegion(final Collection<HRegionInfo> regions) {
HRegionInfo hri = null;
for (HRegionInfo i: regions) {
LOG.info(i.getRegionNameAsString());
if (!i.isMetaRegion()) {
hri = i;
break;
}
}
return hri;
}
示例7: shouldPersistStateChange
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
/**
* Check if we should persist a state change in meta. Generally it's
* better to persist all state changes. However, we should not do that
* if the region is not in meta at all. Based on the state and the
* previous state, we can identify if a user region has an entry
* in meta. For example, merged regions are deleted from meta;
* New merging parents, or splitting daughters are
* not created in meta yet.
*/
private boolean shouldPersistStateChange(
HRegionInfo hri, RegionState state, RegionState oldState) {
return !hri.isMetaRegion() && !RegionStates.isOneOfStates(
state, State.MERGING_NEW, State.SPLITTING_NEW, State.MERGED)
&& !(RegionStates.isOneOfStates(state, State.OFFLINE)
&& RegionStates.isOneOfStates(oldState, State.MERGING_NEW,
State.SPLITTING_NEW, State.MERGED));
}