|
In HBase, HBaseRPC is the class that facilitates HBase to use RPC among the components. It is based on the Java dynamic proxy pattern. It uses an invoker class that implements InvocationHandler to intercept client-side method calls, and then it marshalls the method name and argument through HBaseClient. The communication between client and server using RPC works as follows:
1. The client contacts ZooKeeper to find who the active HMaster is and what the location of the root RegionServer is.
2. Then, the client communicates RegionServer using HRegionInterface to read/write the table.
3. Client applications talk to HMaster using HMasterInterface in order to dynamically create a table, add a column family, and for other operations.
4. Then, HMaster communicates to RegionServers using HRegionInterface to open, close, move, split, or flush the region.
5. Active HMaster data and the root RegionServer location are cached into ZooKeepers by HMaster.
6. RegionServer then reads the data from ZooKeeper to get information about log-splitting tasks, which is updated to fetch a task report status.
7. RegionServer then communicates with HMaster using HMasterRegionInterface to convey information such as the loading of RegionServer, errors with RegionServer, and the start up process of RegionServers. |
|