HBASE-2035 Binary values are formatted wrong in shell
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@896738 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5e65d6ee2f
commit
73aa65deb3
|
@ -286,6 +286,7 @@ Release 0.21.0 - Unreleased
|
|||
(Erik Rozendaal and Dave Latham via Stack)
|
||||
HBASE-2090 findbugs issues (Kay Kay via Stack)
|
||||
HBASE-2089 HBaseConfiguration() ctor. deprecated (Kay Kay via Stack)
|
||||
HBASE-2035 Binary values are formatted wrong in shell
|
||||
|
||||
NEW FEATURES
|
||||
HBASE-1901 "General" partitioner for "hbase-48" bulk (behind the api, write
|
||||
|
|
|
@ -96,7 +96,7 @@ module Formatter
|
|||
return
|
||||
end
|
||||
# Remove double-quotes added by 'dump'.
|
||||
return str.dump[1..-2]
|
||||
return str
|
||||
end
|
||||
|
||||
def output(width, str)
|
||||
|
|
|
@ -425,13 +425,13 @@ module HBase
|
|||
i = s.iterator()
|
||||
while i.hasNext()
|
||||
r = i.next()
|
||||
row = String.from_java_bytes r.getRow()
|
||||
row = Bytes::toStringBinary(r.getRow())
|
||||
if limit != -1 and count >= limit
|
||||
break
|
||||
end
|
||||
for kv in r.list
|
||||
family = String.from_java_bytes kv.getFamily()
|
||||
qualifier = String.from_java_bytes kv.getQualifier()
|
||||
qualifier = Bytes::toStringBinary(kv.getQualifier())
|
||||
column = family + ':' + qualifier
|
||||
cell = toString(column, kv, maxlength)
|
||||
@formatter.row([row, "column=%s, %s" % [column, cell]])
|
||||
|
@ -494,7 +494,7 @@ module HBase
|
|||
Bytes.toLong(kv.getValue())]
|
||||
end
|
||||
end
|
||||
val = "timestamp=" + kv.getTimestamp().to_s + ", value=" + Bytes.toStringBinary(kv.getValue())
|
||||
val = "timestamp=" + kv.getTimestamp().to_s + ", value=" + Bytes::toStringBinary(kv.getValue())
|
||||
maxlength != -1 ? val[0, maxlength] : val
|
||||
end
|
||||
|
||||
|
@ -555,7 +555,7 @@ module HBase
|
|||
if !result.isEmpty()
|
||||
for kv in result.list()
|
||||
family = String.from_java_bytes kv.getFamily()
|
||||
qualifier = String.from_java_bytes kv.getQualifier()
|
||||
qualifier = Bytes::toStringBinary(kv.getQualifier())
|
||||
column = family + ':' + qualifier
|
||||
@formatter.row([column, toString(column, kv, maxlength)])
|
||||
end
|
||||
|
|
|
@ -298,8 +298,7 @@ NAME, VERSIONS, COMPRESSION, etc. Constants do not need to be quoted. Type
|
|||
'Object.constants' to see a (messy) list of all constants in the environment.
|
||||
|
||||
In case you are using binary keys or values and need to enter them into the
|
||||
shell then use double-quotes to make use of hexadecimal or octal notations,
|
||||
for example:
|
||||
shell then use double-quotes to make use of hexadecimal for example:
|
||||
|
||||
hbase> get 't1', "key\\x03\\x3f\\xcd"
|
||||
hbase> get 't1', "key\\003\\023\\011"
|
||||
|
|
Loading…
Reference in New Issue