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
ConstructorDescriptionAbstractServerConnection
(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 TypeMethodDescriptionvoid
changeHandlerTo
(RequestHandler<S> handler) void
Called from the RpcBus's channel close handler to close all remaining resources associated with this connection.void
void
protected abstract org.slf4j.Logger
void
initSaslServer
(String mechanismName) void
setEncryption
(boolean encrypted) void
setMaxWrappedSize
(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, setWrapSizeLimit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.rpc.ConnectionThrottle
setAutoRead
Methods inherited from interface org.apache.drill.exec.rpc.EncryptionContext
getEncryptionCtxtString, getMaxWrappedSize, getWrapSizeLimit, isEncryptionEnabled, setWrapSizeLimit
Methods 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:
getAllocator
in interfaceRemoteConnection
-
getLogger
protected abstract org.slf4j.Logger getLogger() -
initSaslServer
- Specified by:
initSaslServer
in interfaceServerConnection<S extends ServerConnection<S>>
- Throws:
SaslException
-
getSaslServer
- Specified by:
getSaslServer
in interfaceServerConnection<S extends ServerConnection<S>>
-
finalizeSaslSession
- Specified by:
finalizeSaslSession
in interfaceServerConnection<S extends ServerConnection<S>>
- Throws:
IOException
-
getCurrentHandler
- Specified by:
getCurrentHandler
in interfaceServerConnection<S extends ServerConnection<S>>
-
changeHandlerTo
- Specified by:
changeHandlerTo
in interfaceServerConnection<S extends ServerConnection<S>>
-
setEncryption
public void setEncryption(boolean encrypted) - Specified by:
setEncryption
in interfaceEncryptionContext
- Overrides:
setEncryption
in classAbstractRemoteConnection
-
setMaxWrappedSize
public void setMaxWrappedSize(int maxWrappedSize) - Specified by:
setMaxWrappedSize
in interfaceEncryptionContext
- Overrides:
setMaxWrappedSize
in classAbstractRemoteConnection
-
disposeSaslServer
public void disposeSaslServer()- Specified by:
disposeSaslServer
in interfaceServerConnection<S extends ServerConnection<S>>
-
channelClosed
Description copied from class:AbstractRemoteConnection
Called 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:
channelClosed
in interfaceRemoteConnection
- Overrides:
channelClosed
in classAbstractRemoteConnection
- Parameters:
ex
- The exception that caused the channel to close.
-