T
- Message type.public class GridNioServer<T> extends Object
GridNioSession
object is
created and can be used in communication.
This implementation supports several selectors and several reading threads.
Modifier and Type | Class and Description |
---|---|
static class |
GridNioServer.Builder<T>
Constructs a new instance of
GridNioServer . |
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_IO_BALANCE_PERIOD |
static int |
DFLT_SEND_QUEUE_LIMIT
Default send queue limit.
|
static int |
DFLT_SES_WRITE_TIMEOUT
Default session write timeout.
|
static String |
IGNITE_IO_BALANCE_RANDOM_BALANCE |
static String |
OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC |
static String |
OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME |
static String |
RECEIVED_BYTES_METRIC_DESC |
static String |
RECEIVED_BYTES_METRIC_NAME |
static int |
RECOVERY_DESC_META_KEY
Session future meta key.
|
static String |
SENT_BYTES_METRIC_DESC |
static String |
SENT_BYTES_METRIC_NAME |
Modifier and Type | Method and Description |
---|---|
static <T> GridNioServer.Builder<T> |
builder()
Creates and returns a builder for a new instance of this class.
|
GridNioFuture<GridNioSession> |
cancelConnect(SocketChannel ch,
Map<Integer,?> meta) |
GridNioFuture<Boolean> |
close(GridNioSession ses) |
void |
closeFromWorkerThread(GridNioSession ses) |
GridNioFuture<GridNioSession> |
createSession(SocketChannel ch,
@Nullable Map<Integer,Object> meta,
boolean async,
@Nullable IgniteInClosure<? super IgniteInternalFuture<GridNioSession>> lsnr)
Establishes a session.
|
IgniteInternalFuture<String> |
dumpNodeStats(String msg,
IgnitePredicate<GridNioSession> p) |
IgniteInternalFuture<String> |
dumpStats() |
IgniteInternalFuture<String> |
dumpStats(String msg,
IgnitePredicate<GridNioSession> p) |
long |
idleTimeout()
Gets configurable idle timeout for this session.
|
void |
idleTimeout(long idleTimeout)
Sets configurable idle timeout for session.
|
InetSocketAddress |
localAddress()
Gets the address server is bound to.
|
int |
outboundMessagesQueueSize()
Gets outbound messages queue size.
|
int |
port() |
long |
readerMoveCount() |
void |
resend(GridNioSession ses) |
long |
selectorSpins() |
void |
sendSystem(GridNioSession ses,
Message msg)
Adds message at the front of the queue without acquiring back pressure semaphore.
|
void |
sendSystem(GridNioSession ses,
Message msg,
@Nullable IgniteInClosure<? super IgniteInternalFuture<?>> lsnr)
Adds message at the front of the queue without acquiring back pressure semaphore.
|
Collection<? extends GridNioSession> |
sessions() |
void |
start()
Starts all associated threads to perform accept and read activities.
|
void |
stop()
Stops all threads and releases all resources.
|
String |
toString() |
List<org.apache.ignite.internal.util.nio.GridNioServer.AbstractNioClientWorker> |
workers() |
long |
writerMoveCount() |
long |
writeTimeout()
Gets configurable write timeout for this session.
|
void |
writeTimeout(long writeTimeout)
Sets configurable write timeout for session.
|
public static final String IGNITE_IO_BALANCE_RANDOM_BALANCE
public static final int DFLT_SES_WRITE_TIMEOUT
public static final int DFLT_SEND_QUEUE_LIMIT
public static final int RECOVERY_DESC_META_KEY
public static final int DFLT_IO_BALANCE_PERIOD
public static final String OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME
public static final String OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC
public static final String RECEIVED_BYTES_METRIC_NAME
public static final String RECEIVED_BYTES_METRIC_DESC
public static final String SENT_BYTES_METRIC_NAME
public static final String SENT_BYTES_METRIC_DESC
public long readerMoveCount()
public long writerMoveCount()
public int port()
public static <T> GridNioServer.Builder<T> builder()
public void start()
public void stop()
public InetSocketAddress localAddress()
public long selectorSpins()
public GridNioFuture<Boolean> close(GridNioSession ses)
ses
- Session to close.public void closeFromWorkerThread(GridNioSession ses)
ses
- Session.public void sendSystem(GridNioSession ses, Message msg) throws IgniteCheckedException
ses
- Session.msg
- Message.IgniteCheckedException
- If session was closed.public void sendSystem(GridNioSession ses, Message msg, @Nullable @Nullable IgniteInClosure<? super IgniteInternalFuture<?>> lsnr) throws IgniteCheckedException
ses
- Session.msg
- Message.lsnr
- Future listener notified from the session thread.IgniteCheckedException
- If session was closed.public void resend(GridNioSession ses)
ses
- Session.public Collection<? extends GridNioSession> sessions()
public List<org.apache.ignite.internal.util.nio.GridNioServer.AbstractNioClientWorker> workers()
public IgniteInternalFuture<String> dumpStats()
public IgniteInternalFuture<String> dumpStats(String msg, IgnitePredicate<GridNioSession> p)
msg
- Message to add.p
- Session predicate.public IgniteInternalFuture<String> dumpNodeStats(String msg, IgnitePredicate<GridNioSession> p)
msg
- Message to add.p
- Session predicate.public GridNioFuture<GridNioSession> createSession(SocketChannel ch, @Nullable @Nullable Map<Integer,Object> meta, boolean async, @Nullable @Nullable IgniteInClosure<? super IgniteInternalFuture<GridNioSession>> lsnr)
ch
- Channel to register within the server and create session for.meta
- Optional meta for new session.async
- Async connection.lsnr
- Listener that should be invoked in NIO thread.public GridNioFuture<GridNioSession> cancelConnect(SocketChannel ch, Map<Integer,?> meta)
ch
- Channel.meta
- Session meta.public long writeTimeout()
DFLT_SES_WRITE_TIMEOUT
.public void writeTimeout(long writeTimeout)
writeTimeout
- Write timeout in milliseconds.public long idleTimeout()
ConnectorConfiguration.DFLT_IDLE_TIMEOUT
.public void idleTimeout(long idleTimeout)
idleTimeout
- Idle timeout in milliseconds.public int outboundMessagesQueueSize()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021