[ 
https://issues.apache.org/jira/browse/HBASE-9173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Daniel Cryans updated HBASE-9173:
--------------------------------------

    Attachment: HBASE-9173.patch

Well that got ugly pretty fast. In the patch I'm attaching I tried to break as 
few things as possible.

The first problem I encountered is that you cannot call 
getStatusOfConnectedPeer() without being connected to it (duh) but as a client 
like ReplicationAdmin it doesn't make much sense to connect like this, I'd 
rather be lightweight and just read from ZK. For the moment I connect 
automagically in ReplicationAdmin.getPeerState if we're not already connected.

The second problem is that doing ReplicationAdmin.enablePeer (and 
ReplicationPeers.enablePeer), you can't read back the state and expect it to be 
changed already because we rely on ReplicationPeer.PeerStateTracker to notice 
the znode changed and then come back async-style and update the state. So I had 
to add a method to wait until the state was changed internally when 
enabling/disabling in ReplicationPeersZKImpl. I rather do it at that point 
since it means the client knows the state was changed for sure.

[~ctrezzo], what do you think? Should we add lightweight checks or do something 
like my patch does? BTW I'm about to review HBASE-8441 so rest assured that 
you're not in an abusive relationship ;)
                
> replication_admin#get_peer_state(id) in ruby script pointing to undefined 
> method `getPeerState'
> -----------------------------------------------------------------------------------------------
>
>                 Key: HBASE-9173
>                 URL: https://issues.apache.org/jira/browse/HBASE-9173
>             Project: HBase
>          Issue Type: Bug
>          Components: scripts
>            Reporter: rajeshbabu
>            Assignee: rajeshbabu
>            Priority: Critical
>             Fix For: 0.98.0, 0.95.2
>
>         Attachments: HBASE-9173.patch
>
>
> list_peers is failing because replication_admin#get_peer_state(id) pointing 
> to the method removed from ReplicationAdmin. We need to read peer state from 
> ReplicationPeer.
> {code}
> hbase(main):003:0> list_peers
>  PEER_ID CLUSTER_KEY STATE
> ERROR: undefined method `getPeerState' for 
> #<Java::OrgApacheHadoopHbaseClientReplication::ReplicationAdmin:0x7e299629>
> Here is some help for this command:
> List all replication peer clusters.
>   hbase> list_peers
> {code}
> {code}
>     # Get peer cluster state
>     def get_peer_state(id)
>       @replication_admin.getPeerState(id)
>     end
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to