You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2009/04/22 21:14:16 UTC

svn commit: r767624 - in /hadoop/hbase/trunk: CHANGES.txt bin/Formatter.rb bin/HBase.rb

Author: stack
Date: Wed Apr 22 19:14:15 2009
New Revision: 767624

URL: http://svn.apache.org/viewvc?rev=767624&view=rev
Log:
HBASE-1235 Add table enabled status to shell and UI

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/bin/Formatter.rb
    hadoop/hbase/trunk/bin/HBase.rb

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=767624&r1=767623&r2=767624&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Apr 22 19:14:15 2009
@@ -147,6 +147,8 @@
                (Nitay Joffe via Andrew Purtell)
    HBASE-1309  HFile rejects key in Memcache with empty value
    HBASE-1331  Lower the default scanner caching value
+   HBASE-1235  Add table enabled status to shell and UI
+               (Lars George via Stack)
 
 Release 0.19.0 - 01/21/2009
   INCOMPATIBLE CHANGES

Modified: hadoop/hbase/trunk/bin/Formatter.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/Formatter.rb?rev=767624&r1=767623&r2=767624&view=diff
==============================================================================
--- hadoop/hbase/trunk/bin/Formatter.rb (original)
+++ hadoop/hbase/trunk/bin/Formatter.rb Wed Apr 22 19:14:15 2009
@@ -13,14 +13,14 @@
 
     attr_reader :rowCount
 
-    def header(args = [])
-      row(args, false) if args.length > 0
+    def header(args = [], widths = [])
+      row(args, false, widths) if args.length > 0
       @rowCount = 0
     end
     
     # Output a row.
     # Inset is whether or not to offset row by a space.
-    def row(args = [], inset = true)
+    def row(args = [], inset = true, widths = [])
       if not args or args.length == 0
         # Print out nothing
         return
@@ -38,8 +38,8 @@
           puts
         end
       elsif args.length == 2
-        col1width = @maxWidth / 4
-        col2width = @maxWidth - col1width - 2
+        col1width = (not widths or widths.length == 0) ? @maxWidth / 4 : @maxWidth * widths[0] / 100
+        col2width = (not widths or widths.length < 2) ? @maxWidth - col1width - 2 : @maxWidth * widths[1] / 100 - 2
         splits1 = split(col1width, dump(args[0]))
         splits2 = split(col2width, dump(args[1]))
         biggest = (splits2.length > splits1.length)? splits2.length: splits1.length

Modified: hadoop/hbase/trunk/bin/HBase.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/HBase.rb?rev=767624&r1=767623&r2=767624&view=diff
==============================================================================
--- hadoop/hbase/trunk/bin/HBase.rb (original)
+++ hadoop/hbase/trunk/bin/HBase.rb Wed Apr 22 19:14:15 2009
@@ -57,13 +57,13 @@
 
     def describe(tableName)
       now = Time.now 
-      @formatter.header(["FAMILIES", "ENABLED"])
+      @formatter.header(["DESCRIPTION", "ENABLED"], [64])
       found = false
       tables = @admin.listTables().to_a
       tables.push(HTableDescriptor::META_TABLEDESC, HTableDescriptor::ROOT_TABLEDESC)
       for t in tables
         if t.getNameAsString() == tableName
-          @formatter.row([t.to_s, "%s" % [@admin.isTableEnabled(tableName)]])
+          @formatter.row([t.to_s, "%s" % [@admin.isTableEnabled(tableName)]], true, [64])
           found = true
         end
       end