Class ControllerImpl

java.lang.Object
org.apache.drill.exec.rpc.control.ControllerImpl
All Implemented Interfaces:
AutoCloseable, Controller

public class ControllerImpl extends Object implements Controller
Manages communication tunnels between nodes.
  • Constructor Details

  • Method Details

    • start

      public CoordinationProtos.DrillbitEndpoint start(CoordinationProtos.DrillbitEndpoint partialEndpoint, boolean allowPortHunting)
      Specified by:
      start in interface Controller
    • getTunnel

      Description copied from interface: Controller
      Get a Bit to Bit communication tunnel. If the BitCom doesn't have a tunnel attached to the node already, it will start creating one. This create the connection asynchronously.
      Specified by:
      getTunnel in interface Controller
      Returns:
    • registerCustomHandler

      public <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)
      Description copied from interface: Controller
      Register a new handler for custom message types. Should be done before any messages. This is threadsafe as this method manages locking internally.
      Specified by:
      registerCustomHandler in interface Controller
      Parameters:
      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.
    • registerCustomHandler

      public <REQUEST, RESPONSE> void registerCustomHandler(int messageTypeId, Controller.CustomMessageHandler<REQUEST,RESPONSE> handler, Controller.CustomSerDe<REQUEST> requestSerde, Controller.CustomSerDe<RESPONSE> responseSerde)
      Description copied from interface: Controller
      Register a new handler for custom message types. Should be done before any messages. This is threadsafe as this method manages locking internally.
      Specified by:
      registerCustomHandler in interface Controller
      Parameters:
      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.
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception