public abstract class NioPipeline extends Object implements MigratablePipeline, Runnable
Modifier and Type | Field and Description |
---|---|
protected NioChannel |
channel |
protected static int |
LOAD_BALANCING_BYTE |
protected static int |
LOAD_BALANCING_FRAME |
protected static int |
LOAD_BALANCING_HANDLE |
protected int |
loadType |
protected ILogger |
logger |
protected NioThread |
owner |
protected SwCounter |
processCount |
protected SelectionKey |
selectionKey |
protected SocketChannel |
socketChannel |
Modifier and Type | Method and Description |
---|---|
Channel |
getChannel() |
protected abstract Iterable<? extends ChannelHandler> |
handlers()
Returns an Iterable that can iterate over each
ChannelHandler of
the pipeline. |
void |
onError(Throwable error)
|
NioThread |
owner()
Get NioThread currently owning this pipeline.
|
protected void |
requestClose() |
void |
requestMigration(NioThread newOwner)
Migrates this pipeline to a different owner.
|
void |
run() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
load
protected static final int LOAD_BALANCING_HANDLE
protected static final int LOAD_BALANCING_BYTE
protected static final int LOAD_BALANCING_FRAME
protected final int loadType
protected final SwCounter processCount
protected final ILogger logger
protected final NioChannel channel
protected final SocketChannel socketChannel
protected volatile NioThread owner
protected SelectionKey selectionKey
public Channel getChannel()
public NioThread owner()
MigratablePipeline
IOBalancer
can decide to migrate
a pipeline to another owner.owner
in interface MigratablePipeline
public void onError(Throwable error)
process()
throws a Throwable
.
This method should only be called by the current owner
.
The idiom to use a pipeline is:
try{
pipeline.process();
} catch(Throwable t) {
pipeline.onError(t);
}
error
- protected abstract Iterable<? extends ChannelHandler> handlers()
ChannelHandler
of
the pipeline.
This method is called only by the onError(Throwable)
.public final void requestMigration(NioThread newOwner)
requestMigration
in interface MigratablePipeline
newOwner
- target NioThread this handler migrates toprotected void requestClose()
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.