HBASE-3756 Can't move META or ROOT from shell

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1090372 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-04-08 18:04:54 +00:00
parent 420cbdfd9d
commit 29f7c71726
5 changed files with 28 additions and 5 deletions

View File

@ -69,6 +69,7 @@ Release 0.91.0 - Unreleased
HMasterInterface and HMasterRegionInterface versions
HBASE-3723 Major compact should be done when there is only one storefile
and some keyvalue is outdated (Zhou Shuaifeng via Stack)
HBASE-3756 Can't move META or ROOT from shell
IMPROVEMENTS
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
@ -143,6 +144,8 @@ Release 0.91.0 - Unreleased
(Doug Meil via Stack)
HBASE-3587 Eliminate use of read-write lock to guard loaded
coprocessor collection
HBASE-3729 Get cells via shell with a time range predicate
(Ted Yu via Stack)
TASK
HBASE-3559 Move report of split to master OFF the heartbeat channel

View File

@ -195,8 +195,9 @@ public class AssignmentManager extends ZooKeeperListener {
* transition. Presumes <code>.META.</code> and <code>-ROOT-</code> deployed.
* @throws KeeperException
* @throws IOException
* @throws InterruptedException
*/
void processFailover() throws KeeperException, IOException {
void processFailover() throws KeeperException, IOException, InterruptedException {
// Concurrency note: In the below the accesses on regionsInTransition are
// outside of a synchronization block where usually all accesses to RIT are
// synchronized. The presumption is that in this case it is safe since this
@ -206,6 +207,14 @@ public class AssignmentManager extends ZooKeeperListener {
// TODO: Regions that have a null location and are not in regionsInTransitions
// need to be handled.
// Add -ROOT- and .META. on regions map. They must be deployed if we got
// this far. Caller takes care of it.
HServerInfo hsi =
this.serverManager.getHServerInfo(this.catalogTracker.getMetaLocation());
regionOnline(HRegionInfo.FIRST_META_REGIONINFO, hsi);
hsi = this.serverManager.getHServerInfo(this.catalogTracker.getRootLocation());
regionOnline(HRegionInfo.ROOT_REGIONINFO, hsi);
// Scan META to build list of existing regions, servers, and assignment
// Returns servers who have not checked in (assumed dead) and their regions
Map<HServerInfo,List<Pair<HRegionInfo,Result>>> deadServers =

View File

@ -36,6 +36,7 @@ module HBaseConstants
COLUMN = "COLUMN"
COLUMNS = "COLUMNS"
TIMESTAMP = "TIMESTAMP"
TIMERANGE = "TIMERANGE"
NAME = org.apache.hadoop.hbase.HConstants::NAME
VERSIONS = org.apache.hadoop.hbase.HConstants::VERSIONS
IN_MEMORY = org.apache.hadoop.hbase.HConstants::IN_MEMORY

View File

@ -120,6 +120,11 @@ module Hbase
unless args.empty?
columns = args[COLUMN] || args[COLUMNS]
if args[VERSIONS]
vers = args[VERSIONS]
else
vers = 1
end
if columns
# Normalize types, convert string to an array of strings
columns = [ columns ] if columns.is_a?(String)
@ -140,16 +145,19 @@ module Hbase
end
# Additional params
get.setMaxVersions(args[VERSIONS] || 1)
get.setMaxVersions(vers)
get.setTimeStamp(args[TIMESTAMP]) if args[TIMESTAMP]
get.setTimeRange(args[TIMERANGE][0], args[TIMERANGE][1]) if args[TIMERANGE]
else
# May have passed TIMESTAMP and row only; wants all columns from ts.
unless ts = args[TIMESTAMP]
unless ts = args[TIMESTAMP] || tr = args[TIMERANGE]
raise ArgumentError, "Failed parse of #{args.inspect}, #{args.class}"
end
# Set the timestamp
get.setTimeStamp(ts.to_i)
get.setMaxVersions(vers)
# Set the timestamp/timerange
get.setTimeStamp(ts.to_i) if args[TIMESTAMP]
get.setTimeRange(args[TIMERANGE][0], args[TIMERANGE][1]) if args[TIMERANGE]
end
end

View File

@ -27,9 +27,11 @@ Get row or cell contents; pass table name, row, and optionally
a dictionary of column(s), timestamp and versions. Examples:
hbase> get 't1', 'r1'
hbase> get 't1', 'r1', {TIMERANGE => [ts1, ts2]}
hbase> get 't1', 'r1', {COLUMN => 'c1'}
hbase> get 't1', 'r1', {COLUMN => ['c1', 'c2', 'c3']}
hbase> get 't1', 'r1', {COLUMN => 'c1', TIMESTAMP => ts1}
hbase> get 't1', 'r1', {COLUMN => 'c1', TIMERANGE => [ts1, ts2], VERSIONS => 4}
hbase> get 't1', 'r1', {COLUMN => 'c1', TIMESTAMP => ts1, VERSIONS => 4}
hbase> get 't1', 'r1', 'c1'
hbase> get 't1', 'r1', 'c1', 'c2'