Package org.apache.drill.exec.rpc
Class AbstractServerConnection<S extends ServerConnection<S>>
java.lang.Object
org.apache.drill.exec.rpc.AbstractRemoteConnection
org.apache.drill.exec.rpc.AbstractServerConnection<S>
- All Implemented Interfaces:
AutoCloseable,ConnectionThrottle,EncryptionContext,RemoteConnection,ServerConnection<S>
- Direct Known Subclasses:
ControlConnection,DataServerConnection,UserServer.BitToUserConnection
public abstract class AbstractServerConnection<S extends ServerConnection<S>>
extends AbstractRemoteConnection
implements ServerConnection<S>
-
Field Summary
Fields inherited from class org.apache.drill.exec.rpc.AbstractRemoteConnection
saslCodec -
Constructor Summary
ConstructorsConstructorDescriptionAbstractServerConnection(io.netty.channel.socket.SocketChannel channel, String name, ConnectionConfig config, RequestHandler<S> handler) AbstractServerConnection(io.netty.channel.socket.SocketChannel channel, ConnectionConfig config, RequestHandler<S> handler) -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeHandlerTo(RequestHandler<S> handler) voidCalled from the RpcBus's channel close handler to close all remaining resources associated with this connection.voidvoidprotected abstract org.slf4j.LoggervoidinitSaslServer(String mechanismName) voidsetEncryption(boolean encrypted) voidsetMaxWrappedSize(int maxWrappedSize) Methods inherited from class org.apache.drill.exec.rpc.AbstractRemoteConnection
addSecurityHandlers, blockOnNotWritable, close, createNewRpcListener, decConnectionCounter, getAndRemoveRpcOutcome, getChannel, getEncryptionCtxtString, getMaxWrappedSize, getName, getRemoteAddress, getWrapSizeLimit, incConnectionCounter, inEventLoop, isActive, isEncryptionEnabled, recordRemoteFailure, setAutoRead, setWrapSizeLimitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.drill.exec.rpc.ConnectionThrottle
setAutoReadMethods inherited from interface org.apache.drill.exec.rpc.EncryptionContext
getEncryptionCtxtString, getMaxWrappedSize, getWrapSizeLimit, isEncryptionEnabled, setWrapSizeLimitMethods inherited from interface org.apache.drill.exec.rpc.RemoteConnection
addSecurityHandlers, blockOnNotWritable, close, createNewRpcListener, getAndRemoveRpcOutcome, getChannel, getName, getRemoteAddress, inEventLoop, isActive, recordRemoteFailure
-
Constructor Details
-
AbstractServerConnection
public AbstractServerConnection(io.netty.channel.socket.SocketChannel channel, String name, ConnectionConfig config, RequestHandler<S> handler) -
AbstractServerConnection
public AbstractServerConnection(io.netty.channel.socket.SocketChannel channel, ConnectionConfig config, RequestHandler<S> handler)
-
-
Method Details
-
getAllocator
- Specified by:
getAllocatorin interfaceRemoteConnection
-
getLogger
protected abstract org.slf4j.Logger getLogger() -
initSaslServer
- Specified by:
initSaslServerin interfaceServerConnection<S extends ServerConnection<S>>- Throws:
SaslException
-
getSaslServer
- Specified by:
getSaslServerin interfaceServerConnection<S extends ServerConnection<S>>
-
finalizeSaslSession
- Specified by:
finalizeSaslSessionin interfaceServerConnection<S extends ServerConnection<S>>- Throws:
IOException
-
getCurrentHandler
- Specified by:
getCurrentHandlerin interfaceServerConnection<S extends ServerConnection<S>>
-
changeHandlerTo
- Specified by:
changeHandlerToin interfaceServerConnection<S extends ServerConnection<S>>
-
setEncryption
public void setEncryption(boolean encrypted) - Specified by:
setEncryptionin interfaceEncryptionContext- Overrides:
setEncryptionin classAbstractRemoteConnection
-
setMaxWrappedSize
public void setMaxWrappedSize(int maxWrappedSize) - Specified by:
setMaxWrappedSizein interfaceEncryptionContext- Overrides:
setMaxWrappedSizein classAbstractRemoteConnection
-
disposeSaslServer
public void disposeSaslServer()- Specified by:
disposeSaslServerin interfaceServerConnection<S extends ServerConnection<S>>
-
channelClosed
Description copied from class:AbstractRemoteConnectionCalled from the RpcBus's channel close handler to close all remaining resources associated with this connection. Ensures that any pending back-pressure items are also unblocked so they can be thrown away.- Specified by:
channelClosedin interfaceRemoteConnection- Overrides:
channelClosedin classAbstractRemoteConnection- Parameters:
ex- The exception that caused the channel to close.
-