HBASE-1977 Add ts and allow setting VERSIONS when scanning in shell

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@835761 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-11-13 07:04:11 +00:00
parent efef11e2dc
commit bbb6ce9d34
2 changed files with 4 additions and 1 deletions

View File

@ -110,6 +110,7 @@ Release 0.21.0 - Unreleased
HBASE-1841 If multiple of same key in an hfile and they span blocks, may
miss the earlier keys on a lookup
(Schubert Zhang via Stack)
HBASE-1977 Add ts and allow setting VERSIONS when scanning in shell
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -384,6 +384,7 @@ module HBase
timestamp = args["TIMESTAMP"] || nil
columns = args["COLUMNS"] || getAllColumns()
cache = args["CACHE_BLOCKS"] || true
versions = args["VERSIONS"] || 1
if columns.class == String
columns = [columns]
@ -410,6 +411,7 @@ module HBase
scan.setTimeStamp(timestamp)
end
scan.setCacheBlocks(cache)
scan.setMaxVersions(versions) if versions > 1
else
scan = Scan.new()
end
@ -429,7 +431,7 @@ module HBase
qualifier = String.from_java_bytes kv.getQualifier()
column = family + ':' + qualifier
cell = toString(column, kv, maxlength)
@formatter.row([row, "column=%s, %s" % [column, cell]])
@formatter.row([row, "column=%s, ts=%d, %s" % [column, kv.getTimestamp(), cell]])
end
end
@formatter.footer(now, count)