tsuna / gohbase

Pure-Go HBase client
Apache License 2.0
736 stars 213 forks source link

Refactor for batch #225

Closed aaronbee closed 1 year ago

aaronbee commented 1 year ago

This change pulls out some of the refactoring that is being done for adding batch support into its own PR.

*client.handleResultError checks the error on an RPC response and takes action such as marking a client connection down or re-establishing a region.

getRegionAndClientForRPC finds the region and region client for an RPC and similarly handles the case of establishing/re-establishing a region.

SendRPC and sendRPCToRegion (now sendRPCToRegionClient), are shorter and simpler because the error handling has been pulled out. There should be no significant behavior changes. If I could easily, I would have deleted sendRPCToRegionClient and inlined its code in SendRPC, but it would have made testing it a bit harder.