class NetScheduler extends SchedulerBase {

    protected final NetEventLoop netEventLoop;

    public NetScheduler(int id, String name, int schedulerCount, Map<String, String> config,
            boolean isThreadSafe) {
        super(id, name, schedulerCount, config);
        netEventLoop = NetFactory.getFactory(config).createNetEventLoop(loopInterval, isThreadSafe);
        netEventLoop.setScheduler(this);
    }

    @Override
    public DataBufferFactory getDataBufferFactory() {
        return netEventLoop.getDataBufferFactory();
    }

    @Override
    public NetEventLoop getNetEventLoop() {
        return netEventLoop;
    }

    @Override
    public Selector getSelector() {
        return netEventLoop.getSelector();
    }

    @Override
    public void registerAccepter(ProtocolServer server, ServerSocketChannel serverChannel) {
        DbException.throwInternalError();
    }

    // --------------------- 网络事件循环 ---------------------

    @Override
    public void wakeUp() {
        netEventLoop.wakeup();
    }

    @Override
    protected void runEventLoop() {<FILL_FUNCTION_BODY>}

    @Override
    protected void onStopped() {
        super.onStopped();
        netEventLoop.close();
    }
}

        try {
            netEventLoop.write();
            netEventLoop.select();
            netEventLoop.handleSelectedKeys();
        } catch (Throwable t) {
            getLogger().warn("Failed to runEventLoop", t);
        }
    
<methods>public void <init>(int, java.lang.String, int, Map<java.lang.String,java.lang.String>) ,public void accept(java.nio.channels.SelectionKey) ,public void addPendingTransaction(com.lealone.transaction.PendingTransaction) ,public void addPeriodicTask(com.lealone.db.async.AsyncPeriodicTask) ,public void addSession(com.lealone.db.session.Session) ,public void addSessionInfo(java.lang.Object) ,public void addSessionInitTask(java.lang.Object) ,public void addWaitingScheduler(com.lealone.db.scheduler.Scheduler) ,public SchedulerListener<R> createSchedulerListener() ,public void executeNextStatement() ,public com.lealone.db.session.Session getCurrentSession() ,public com.lealone.db.DataBufferFactory getDataBufferFactory() ,public com.lealone.storage.fs.FileStorage getFsyncingFileStorage() ,public int getId() ,public long getLoad() ,public java.lang.String getName() ,public java.lang.Object getNetEventLoop() ,public com.lealone.transaction.PendingTransaction getPendingTransaction() ,public com.lealone.db.scheduler.SchedulerFactory getSchedulerFactory() ,public java.nio.channels.Selector getSelector() ,public com.lealone.db.scheduler.SchedulerThread getThread() ,public void handlePageOperation(com.lealone.storage.page.PageOperation) ,public boolean isFsyncDisabled() ,public boolean isStarted() ,public boolean isStopped() ,public void registerAccepter(com.lealone.server.ProtocolServer, java.nio.channels.ServerSocketChannel) ,public void removePeriodicTask(com.lealone.db.async.AsyncPeriodicTask) ,public void removeSession(com.lealone.db.session.Session) ,public void removeSessionInfo(java.lang.Object) ,public void setCurrentSession(com.lealone.db.session.Session) ,public void setFsyncDisabled(boolean) ,public void setFsyncingFileStorage(com.lealone.storage.fs.FileStorage) ,public void setSchedulerFactory(com.lealone.db.scheduler.SchedulerFactory) ,public synchronized void start() ,public synchronized void stop() ,public java.lang.String toString() ,public void validateSession(boolean) ,public void wakeUpWaitingSchedulers() ,public void wakeUpWaitingSchedulers(boolean) ,public boolean yieldIfNeeded(com.lealone.sql.PreparedSQLStatement) <variables>protected com.lealone.db.session.Session currentSession,protected boolean fsyncDisabled,protected com.lealone.storage.fs.FileStorage fsyncingFileStorage,protected final java.util.concurrent.atomic.AtomicBoolean hasWaitingSchedulers,protected final non-sealed int id,protected final non-sealed long loopInterval,protected final non-sealed java.lang.String name,protected final LinkableList<com.lealone.transaction.PendingTransaction> pendingTransactions,protected final LinkableList<com.lealone.db.async.AsyncPeriodicTask> periodicTasks,protected com.lealone.db.scheduler.SchedulerFactory schedulerFactory,protected boolean started,protected boolean stopped,protected com.lealone.db.scheduler.SchedulerThread thread,protected final non-sealed AtomicReferenceArray<com.lealone.db.scheduler.Scheduler> waitingSchedulers