[ 
https://issues.apache.org/jira/browse/HBASE-24010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126832#comment-17126832
 ] 

Elliot Miller commented on HBASE-24010:
---------------------------------------

The code change from HBase 1.x to 2.x relevant to this issue was to return an 
ArrayList with the peers (instead of nil) _in addition_ to printing the peers 
in a human-readable format. This change allows for further manipulation in the 
shell. For example, you could assign it: {{hbase(main):001:0> x = list_peers}}. 
The reason you cannot see any pretty-printed peers in [~songxincun]'s original 
posting is that 0 peers were returned.

If you interested, compare the list_peers code in 
[1.6.0|https://github.com/apache/hbase/blob/4b3df0f926f6ec64bd6e071b1ae18ff635b4cc98/hbase-shell/src/main/ruby/shell/commands/list_peers.rb#L47]
 against 
[2.2.5|https://github.com/apache/hbase/blob/rel/2.2.5/hbase-shell/src/main/ruby/shell/commands/list_peers.rb#L63].

If you look at Stack's comment, you can see an example of the human readable 
peers listed by 2.x.

All this being said, we could try altering the shell to pretty-print returned 
values like this ArrayList. I'm open to suggestions!

> HBase shell list_peers command is displayed incorrectly
> -------------------------------------------------------
>
>                 Key: HBASE-24010
>                 URL: https://issues.apache.org/jira/browse/HBASE-24010
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>            Reporter: song XinCun
>            Assignee: song XinCun
>            Priority: Major
>
> In 2.X version, I found hbase shell list_peers command displays java object 
> id not the human readable peer messages
> {code:java}
> hbase(main):002:0> list_peers
>  PEER_ID CLUSTER_KEY ENDPOINT_CLASSNAME STATE REPLICATE_ALL NAMESPACES 
> TABLE_CFS BANDWIDTH SERIAL
> 0 row(s)
> Took 0.3336 seconds 
> => #<Java::JavaUtil::ArrayList:0x308a9264>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to