HBASE-424 Should be able to enable/disable .META. table
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@677684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d6522ebe2d
commit
d5f2595cee
|
@ -193,6 +193,7 @@ Trunk (unreleased changes)
|
||||||
HBASE-34 Set memcache flush size per column (Andrew Purtell via Stack)
|
HBASE-34 Set memcache flush size per column (Andrew Purtell via Stack)
|
||||||
HBASE-42 Set region split size on table creation (Andrew Purtell via Stack)
|
HBASE-42 Set region split size on table creation (Andrew Purtell via Stack)
|
||||||
HBASE-43 Add a read-only attribute to columns (Andrew Purtell via Stack)
|
HBASE-43 Add a read-only attribute to columns (Andrew Purtell via Stack)
|
||||||
|
HBASE-424 Should be able to enable/disable .META. table
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-559 MR example job to count table rows
|
HBASE-559 MR example job to count table rows
|
||||||
|
|
|
@ -312,7 +312,6 @@ public class HBaseAdmin {
|
||||||
if (this.master == null) {
|
if (this.master == null) {
|
||||||
throw new MasterNotRunningException("master has been shut down");
|
throw new MasterNotRunningException("master has been shut down");
|
||||||
}
|
}
|
||||||
HTableDescriptor.isLegalTableName(tableName);
|
|
||||||
try {
|
try {
|
||||||
this.master.enableTable(tableName);
|
this.master.enableTable(tableName);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
@ -373,7 +372,6 @@ public class HBaseAdmin {
|
||||||
if (this.master == null) {
|
if (this.master == null) {
|
||||||
throw new MasterNotRunningException("master has been shut down");
|
throw new MasterNotRunningException("master has been shut down");
|
||||||
}
|
}
|
||||||
HTableDescriptor.isLegalTableName(tableName);
|
|
||||||
try {
|
try {
|
||||||
this.master.disableTable(tableName);
|
this.master.disableTable(tableName);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|
|
@ -519,15 +519,21 @@ class RegionManager implements HConstants {
|
||||||
byte [] firstMetaRegion = null;
|
byte [] firstMetaRegion = null;
|
||||||
Set<MetaRegion> metaRegions = new HashSet<MetaRegion>();
|
Set<MetaRegion> metaRegions = new HashSet<MetaRegion>();
|
||||||
|
|
||||||
synchronized (onlineMetaRegions) {
|
if (Bytes.equals(tableName, HConstants.META_TABLE_NAME)) {
|
||||||
if (onlineMetaRegions.size() == 1) {
|
metaRegions.add(new MetaRegion(rootRegionLocation.get(),
|
||||||
firstMetaRegion = onlineMetaRegions.firstKey();
|
HRegionInfo.ROOT_REGIONINFO.getRegionName()));
|
||||||
} else if (onlineMetaRegions.containsKey(tableName)) {
|
|
||||||
firstMetaRegion = tableName;
|
} else {
|
||||||
} else {
|
synchronized (onlineMetaRegions) {
|
||||||
firstMetaRegion = onlineMetaRegions.headMap(tableName).lastKey();
|
if (onlineMetaRegions.size() == 1) {
|
||||||
|
firstMetaRegion = onlineMetaRegions.firstKey();
|
||||||
|
} else if (onlineMetaRegions.containsKey(tableName)) {
|
||||||
|
firstMetaRegion = tableName;
|
||||||
|
} else {
|
||||||
|
firstMetaRegion = onlineMetaRegions.headMap(tableName).lastKey();
|
||||||
|
}
|
||||||
|
metaRegions.addAll(onlineMetaRegions.tailMap(firstMetaRegion).values());
|
||||||
}
|
}
|
||||||
metaRegions.addAll(onlineMetaRegions.tailMap(firstMetaRegion).values());
|
|
||||||
}
|
}
|
||||||
return metaRegions;
|
return metaRegions;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue