public interface Controller extends AutoCloseable
Modifier and Type | Interface and Description |
---|---|
static interface |
Controller.CustomMessageHandler<REQUEST,RESPONSE>
Defines how the Controller should handle custom messages.
|
static interface |
Controller.CustomResponse<RESPONSE>
A simple interface that describes the nature of the response to the custom incoming message.
|
static interface |
Controller.CustomSerDe<MSG>
Interface for defining how to serialize and deserialize custom message for consumer who want to use something other
than Protobuf messages.
|
Modifier and Type | Method and Description |
---|---|
ControlTunnel |
getTunnel(CoordinationProtos.DrillbitEndpoint node)
Get a Bit to Bit communication tunnel.
|
<REQUEST,RESPONSE> |
registerCustomHandler(int messageTypeId,
Controller.CustomMessageHandler<REQUEST,RESPONSE> handler,
Controller.CustomSerDe<REQUEST> requestSerde,
Controller.CustomSerDe<RESPONSE> responseSerde)
Register a new handler for custom message types.
|
<REQUEST extends com.google.protobuf.MessageLite,RESPONSE extends com.google.protobuf.MessageLite> |
registerCustomHandler(int messageTypeId,
Controller.CustomMessageHandler<REQUEST,RESPONSE> handler,
com.google.protobuf.Parser<REQUEST> parser)
Register a new handler for custom message types.
|
CoordinationProtos.DrillbitEndpoint |
start(CoordinationProtos.DrillbitEndpoint partialEndpoint,
boolean allowPortHunting) |
close
ControlTunnel getTunnel(CoordinationProtos.DrillbitEndpoint node)
node
- CoordinationProtos.DrillbitEndpoint start(CoordinationProtos.DrillbitEndpoint partialEndpoint, boolean allowPortHunting) throws DrillbitStartupException
DrillbitStartupException
<REQUEST extends com.google.protobuf.MessageLite,RESPONSE extends com.google.protobuf.MessageLite> void registerCustomHandler(int messageTypeId, Controller.CustomMessageHandler<REQUEST,RESPONSE> handler, com.google.protobuf.Parser<REQUEST> parser)
messageTypeId
- The type of message id to handle. This corresponds to the CustomMessage.type field. Note that only a
single handler for a particular type of message can be registered within a particular Drillbit.handler
- The handler that should be used to handle this type of message.parser
- The parser used to handle the types of messages the handler above handles.<REQUEST,RESPONSE> void registerCustomHandler(int messageTypeId, Controller.CustomMessageHandler<REQUEST,RESPONSE> handler, Controller.CustomSerDe<REQUEST> requestSerde, Controller.CustomSerDe<RESPONSE> responseSerde)
messageTypeId
- The type of message id to handle. This corresponds to the CustomMessage.type field. Note that only a
single handler for a particular type of message can be registered within a particular Drillbit.handler
- The handler that should be used to handle this type of message.requestSerde
- CustomSerDe for incoming requests.responseSerde
- CustomSerDe for serializing responses.Copyright © 1970 The Apache Software Foundation. All rights reserved.