public final class NioChannelWriter extends AbstractHandler implements Runnable
Modifier and Type | Field and Description |
---|---|
Queue<OutboundFrame> |
urgentWriteQueue |
Queue<OutboundFrame> |
writeQueue |
channel, completedMigrations, handleCount, ioThread, LOAD_BALANCING_BYTE, LOAD_BALANCING_FRAME, LOAD_BALANCING_HANDLE, LOAD_TYPE, logger, selectionKey
Constructor and Description |
---|
NioChannelWriter(NioChannel channel,
NioThread ioThread,
ILogger logger,
IOBalancer balancer,
ChannelInitializer initializer) |
Modifier and Type | Method and Description |
---|---|
long |
bytesPending() |
void |
close() |
void |
flush() |
long |
getLoad()
Get 'load' recorded by the current handler.
|
void |
handle()
Called when there are bytes available for reading, or space available to write.
|
long |
lastWriteTimeMillis() |
long |
priorityBytesPending() |
protected void |
publish() |
void |
requestMigration(NioThread newOwner)
Requests the MigratableHandler to move to the new NioThread.
|
void |
run() |
String |
toString() |
int |
totalFramesPending() |
void |
write(OutboundFrame frame) |
getChannel, getOwner, onFailure, start
public final Queue<OutboundFrame> writeQueue
public final Queue<OutboundFrame> urgentWriteQueue
public NioChannelWriter(NioChannel channel, NioThread ioThread, ILogger logger, IOBalancer balancer, ChannelInitializer initializer)
public long getLoad()
MigratableHandler
NioThread
getLoad
in interface MigratableHandler
public int totalFramesPending()
public long lastWriteTimeMillis()
public long bytesPending()
public long priorityBytesPending()
public void flush()
public void write(OutboundFrame frame)
public void handle() throws Exception
SelectionHandler
handle
in interface SelectionHandler
Exception
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void requestMigration(NioThread newOwner)
MigratableHandler
IOBalancer
.
Call is ignored when handler is moving to the same NioThread.requestMigration
in interface MigratableHandler
newOwner
- the NioThread that is going to own this MigratableHandlerprotected void publish()
publish
in class AbstractHandler
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.