public class NIOServerCnxnFactory.SelectorThread extends ZooKeeperThread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
SelectorThread(int id) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAcceptedConnection(SocketChannel accepted)
Place new accepted connection onto a queue for adding.
|
boolean |
addInterestOpsUpdateRequest(SelectionKey sk)
Place interest op update requests onto a queue so that only the
selector thread modifies interest ops, because interest ops
reads/sets are potentially blocking operations if other select
operations are happening.
|
void |
run()
The main loop for the thread selects() on the connections and
dispatches ready I/O work requests, then registers all pending
newly accepted connections and updates any interest ops on the
queue.
|
handleException
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public SelectorThread(int id) throws IOException
IOException
public boolean addAcceptedConnection(SocketChannel accepted)
public boolean addInterestOpsUpdateRequest(SelectionKey sk)
Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.