hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1090372 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java src/main/ruby/hbase.rb src/main/ruby/hbase/table.rb src/main/ruby/shell/commands/get.rb
Date Fri, 08 Apr 2011 18:04:55 GMT
Author: stack
Date: Fri Apr  8 18:04:54 2011
New Revision: 1090372

URL: http://svn.apache.org/viewvc?rev=1090372&view=rev
Log:
HBASE-3756 Can't move META or ROOT from shell

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/src/main/ruby/hbase.rb
    hbase/trunk/src/main/ruby/hbase/table.rb
    hbase/trunk/src/main/ruby/shell/commands/get.rb

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1090372&r1=1090371&r2=1090372&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Fri Apr  8 18:04:54 2011
@@ -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

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1090372&r1=1090371&r2=1090372&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Fri Apr
 8 18:04:54 2011
@@ -195,8 +195,9 @@ public class AssignmentManager extends Z
    * 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 Z
     // 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 =

Modified: hbase/trunk/src/main/ruby/hbase.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/ruby/hbase.rb?rev=1090372&r1=1090371&r2=1090372&view=diff
==============================================================================
--- hbase/trunk/src/main/ruby/hbase.rb (original)
+++ hbase/trunk/src/main/ruby/hbase.rb Fri Apr  8 18:04:54 2011
@@ -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

Modified: hbase/trunk/src/main/ruby/hbase/table.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/ruby/hbase/table.rb?rev=1090372&r1=1090371&r2=1090372&view=diff
==============================================================================
--- hbase/trunk/src/main/ruby/hbase/table.rb (original)
+++ hbase/trunk/src/main/ruby/hbase/table.rb Fri Apr  8 18:04:54 2011
@@ -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
 

Modified: hbase/trunk/src/main/ruby/shell/commands/get.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/ruby/shell/commands/get.rb?rev=1090372&r1=1090371&r2=1090372&view=diff
==============================================================================
--- hbase/trunk/src/main/ruby/shell/commands/get.rb (original)
+++ hbase/trunk/src/main/ruby/shell/commands/get.rb Fri Apr  8 18:04:54 2011
@@ -27,9 +27,11 @@ Get row or cell contents; pass table nam
 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'



Mime
View raw message