HBASE-1235 Add table enabled status to shell and UI

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@767624 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-04-22 19:14:15 +00:00
parent a2fe91696b
commit 997ca2a89a
3 changed files with 9 additions and 7 deletions

View File

@ -147,6 +147,8 @@ Release 0.20.0 - Unreleased
(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

View File

@ -13,14 +13,14 @@ module Formatter
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 @@ module Formatter
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

View File

@ -57,13 +57,13 @@ module HBase
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