Search in sources :

Example 16 with NIOProcessor

use of com.actiontech.dble.net.NIOProcessor in project dble by actiontech.

the class FrontendAuthenticator method isDegrade.

// frontend connection reached the user threshold. service degrade
protected boolean isDegrade(String user) {
    int benchmark = source.getPrivileges().getBenchmark(user);
    if (benchmark > 0) {
        int frontendsLength = 0;
        NIOProcessor[] processors = DbleServer.getInstance().getFrontProcessors();
        for (NIOProcessor p : processors) {
            frontendsLength += p.getFrontendsLength();
        }
        if (frontendsLength >= benchmark) {
            return true;
        }
    }
    return false;
}
Also used : NIOProcessor(com.actiontech.dble.net.NIOProcessor)

Aggregations

NIOProcessor (com.actiontech.dble.net.NIOProcessor)16 FrontendConnection (com.actiontech.dble.net.FrontendConnection)8 RowDataPacket (com.actiontech.dble.net.mysql.RowDataPacket)8 EOFPacket (com.actiontech.dble.net.mysql.EOFPacket)6 FieldPacket (com.actiontech.dble.net.mysql.FieldPacket)6 ByteBuffer (java.nio.ByteBuffer)6 BackendConnection (com.actiontech.dble.backend.BackendConnection)4 MySQLConnection (com.actiontech.dble.backend.mysql.nio.MySQLConnection)4 ServerConnection (com.actiontech.dble.server.ServerConnection)3 PhysicalDBPool (com.actiontech.dble.backend.datasource.PhysicalDBPool)1 PhysicalDatasource (com.actiontech.dble.backend.datasource.PhysicalDatasource)1 RouteResultsetNode (com.actiontech.dble.route.RouteResultsetNode)1 NonBlockingSession (com.actiontech.dble.server.NonBlockingSession)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Entry (java.util.Map.Entry)1