Skip to main content

create_datanode_client

Function create_datanode_client 

Source
async fn create_datanode_client(
    datanode: &Datanode,
    addr: &str,
    rpc_stats: Option<Arc<DatanodeRpcStats>>,
) -> (String, Client)
Expand description

Serves the region server of datanode and returns the address and the client of the address.

The returned client is always an in-process client: the frontend and the datanodes of the test process reach the region server through a duplex stream, no matter which address they use. This keeps the in-process traffic out of rpc_stats.

test_util::PEER_PLACEHOLDER_ADDR is not a real address, so it cannot be served over the network at all. Any other address is a real one: the region server is additionally served on its local TCP port (rpc_stats counts the requests of the remote nodes that reach it, e.g. the region query that a datanode sends for the regions of another datanode).