Search in sources :

Example 1 with NonBlockingSession

use of com.alibaba.cobar.server.session.NonBlockingSession in project cobar by alibaba.

the class ServerConnectionFactory method getConnection.

@Override
protected FrontendConnection getConnection(SocketChannel channel) {
    SystemConfig sys = CobarServer.getInstance().getConfig().getSystem();
    ServerConnection c = new ServerConnection(channel);
    c.setPrivileges(new CobarPrivileges());
    c.setQueryHandler(new ServerQueryHandler(c));
    // c.setPrepareHandler(new ServerPrepareHandler(c)); TODO prepare
    c.setTxIsolation(sys.getTxIsolation());
    c.setSession(new BlockingSession(c));
    c.setSession2(new NonBlockingSession(c));
    return c;
}
Also used : SystemConfig(com.alibaba.cobar.config.model.SystemConfig) BlockingSession(com.alibaba.cobar.server.session.BlockingSession) NonBlockingSession(com.alibaba.cobar.server.session.NonBlockingSession) CobarPrivileges(com.alibaba.cobar.CobarPrivileges) NonBlockingSession(com.alibaba.cobar.server.session.NonBlockingSession)

Aggregations

CobarPrivileges (com.alibaba.cobar.CobarPrivileges)1 SystemConfig (com.alibaba.cobar.config.model.SystemConfig)1 BlockingSession (com.alibaba.cobar.server.session.BlockingSession)1 NonBlockingSession (com.alibaba.cobar.server.session.NonBlockingSession)1