HBASE-9234 Rebuilding user regions should ignore system tables

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1515137 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jxiang 2013-08-18 15:33:24 +00:00
parent c4ad6a6b1e
commit 1b890d3ecd
2 changed files with 9 additions and 1 deletions

View File

@ -84,6 +84,7 @@ public final class TableName implements Comparable<TableName> {
private String namespaceAsString;
private byte[] qualifier;
private String qualifierAsString;
private boolean systemTable;
private TableName() {}
@ -209,6 +210,10 @@ public final class TableName implements Comparable<TableName> {
return name;
}
public boolean isSystemTable() {
return systemTable;
}
@Override
public String toString() {
return nameAsString;
@ -251,6 +256,8 @@ public final class TableName implements Comparable<TableName> {
tableName.nameAsString =
createFullyQualified(tableName.namespaceAsString, tableName.qualifierAsString);
tableName.name = Bytes.toBytes(tableName.nameAsString);
tableName.systemTable = Bytes.equals(
tableName.namespace, NamespaceDescriptor.SYSTEM_NAMESPACE_NAME);
}
public static TableName valueOf(byte[] name) {

View File

@ -2655,6 +2655,8 @@ public class AssignmentManager extends ZooKeeperListener {
HRegionInfo regionInfo = region.getFirst();
ServerName regionLocation = region.getSecond();
if (regionInfo == null) continue;
TableName tableName = regionInfo.getTableName();
if (tableName.isSystemTable()) continue;
regionStates.createRegionState(regionInfo);
if (regionStates.isRegionInState(regionInfo, State.SPLIT)) {
// Split is considered to be completed. If the split znode still
@ -2663,7 +2665,6 @@ public class AssignmentManager extends ZooKeeperListener {
+ " split is completed. Hence need not add to regions list");
continue;
}
TableName tableName = regionInfo.getTableName();
if (regionLocation == null) {
// regionLocation could be null if createTable didn't finish properly.
// When createTable is in progress, HMaster restarts.