Skip to content

Notes on Implementation

Xiao Meng edited this page Aug 12, 2014 · 5 revisions

ASIO

Comments on functions

// Read messages from `_buf` to msg, and use allocatedBuffer to track the lifetime of buffer allocated inside the function.
status_t DrillClientImpl::readMsg(
        ByteBuf_t _buf,
        AllocatedBufferPtr* allocatedBuffer,
        InBoundRpcMessage& msg,
        boost::system::error_code& error)

The magic of Bind

Understand RPC protocol

Link: https://github.com/apache/incubator-drill/blob/master/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserRpcConfig.java

public static RpcConfig MAPPING = RpcConfig.newBuilder("USER-RPC-MAPPING") //
      .add(RpcType.HANDSHAKE, UserToBitHandshake.class, RpcType.HANDSHAKE, BitToUserHandshake.class) //user to bit.
      .add(RpcType.RUN_QUERY, RunQuery.class, RpcType.QUERY_HANDLE, QueryId.class) //user to bit
      .add(RpcType.CANCEL_QUERY, QueryId.class, RpcType.ACK, Ack.class) //user to bit
      .add(RpcType.QUERY_RESULT, QueryResult.class, RpcType.ACK, Ack.class) //bit to user
      .build();

Clone this wiki locally