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:
parent
a2fe91696b
commit
997ca2a89a
|
@ -147,6 +147,8 @@ Release 0.20.0 - Unreleased
|
||||||
(Nitay Joffe via Andrew Purtell)
|
(Nitay Joffe via Andrew Purtell)
|
||||||
HBASE-1309 HFile rejects key in Memcache with empty value
|
HBASE-1309 HFile rejects key in Memcache with empty value
|
||||||
HBASE-1331 Lower the default scanner caching 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
|
Release 0.19.0 - 01/21/2009
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -13,14 +13,14 @@ module Formatter
|
||||||
|
|
||||||
attr_reader :rowCount
|
attr_reader :rowCount
|
||||||
|
|
||||||
def header(args = [])
|
def header(args = [], widths = [])
|
||||||
row(args, false) if args.length > 0
|
row(args, false, widths) if args.length > 0
|
||||||
@rowCount = 0
|
@rowCount = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# Output a row.
|
# Output a row.
|
||||||
# Inset is whether or not to offset row by a space.
|
# 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
|
if not args or args.length == 0
|
||||||
# Print out nothing
|
# Print out nothing
|
||||||
return
|
return
|
||||||
|
@ -38,8 +38,8 @@ module Formatter
|
||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
elsif args.length == 2
|
elsif args.length == 2
|
||||||
col1width = @maxWidth / 4
|
col1width = (not widths or widths.length == 0) ? @maxWidth / 4 : @maxWidth * widths[0] / 100
|
||||||
col2width = @maxWidth - col1width - 2
|
col2width = (not widths or widths.length < 2) ? @maxWidth - col1width - 2 : @maxWidth * widths[1] / 100 - 2
|
||||||
splits1 = split(col1width, dump(args[0]))
|
splits1 = split(col1width, dump(args[0]))
|
||||||
splits2 = split(col2width, dump(args[1]))
|
splits2 = split(col2width, dump(args[1]))
|
||||||
biggest = (splits2.length > splits1.length)? splits2.length: splits1.length
|
biggest = (splits2.length > splits1.length)? splits2.length: splits1.length
|
||||||
|
|
|
@ -57,13 +57,13 @@ module HBase
|
||||||
|
|
||||||
def describe(tableName)
|
def describe(tableName)
|
||||||
now = Time.now
|
now = Time.now
|
||||||
@formatter.header(["FAMILIES", "ENABLED"])
|
@formatter.header(["DESCRIPTION", "ENABLED"], [64])
|
||||||
found = false
|
found = false
|
||||||
tables = @admin.listTables().to_a
|
tables = @admin.listTables().to_a
|
||||||
tables.push(HTableDescriptor::META_TABLEDESC, HTableDescriptor::ROOT_TABLEDESC)
|
tables.push(HTableDescriptor::META_TABLEDESC, HTableDescriptor::ROOT_TABLEDESC)
|
||||||
for t in tables
|
for t in tables
|
||||||
if t.getNameAsString() == tableName
|
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
|
found = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue