Search in sources :

Example 1 with OkCommand

use of io.mycat.mysqlclient.command.OkCommand in project Mycat2 by MyCATApache.

the class VertxConnection method update.

public Future<SqlResult> update(String sql) {
    synchronized (VertxConnection.this) {
        Future<SqlResult> sqlResultFuture = future.transform(unused -> Future.future(promise -> {
            checkException();
            OkCommand queryCommand = new OkCommand(sql, netSocket, promise);
            netSocket.handler(queryCommand);
            queryCommand.write();
            promise.future().onSuccess(event -> VertxConnection.this.serverstatus = queryCommand.serverstatus);
        }));
        future = sqlResultFuture.mapEmpty();
        return sqlResultFuture;
    }
}
Also used : Logger(org.slf4j.Logger) Getter(lombok.Getter) Promise(io.vertx.core.Promise) LoggerFactory(org.slf4j.LoggerFactory) NewMycatConnectionConfig(io.mycat.newquery.NewMycatConnectionConfig) ByteArrayDecoder(io.mycat.mysqlclient.decoder.ByteArrayDecoder) SqlResult(io.mycat.newquery.SqlResult) Future(io.vertx.core.Future) Function(java.util.function.Function) QueryCommand(io.mycat.mysqlclient.command.QueryCommand) Buffer(io.vertx.core.buffer.Buffer) MySQLServerStatusFlags(io.mycat.beans.mysql.MySQLServerStatusFlags) Observable(io.reactivex.rxjava3.core.Observable) OkCommand(io.mycat.mysqlclient.command.OkCommand) ResponseBufferCommand(io.mycat.mysqlclient.command.ResponseBufferCommand) AsyncResult(io.vertx.core.AsyncResult) Handler(io.vertx.core.Handler) StringArrayDecoder(io.mycat.mysqlclient.decoder.StringArrayDecoder) NetSocket(io.vertx.core.net.NetSocket) SqlResult(io.mycat.newquery.SqlResult) OkCommand(io.mycat.mysqlclient.command.OkCommand)

Aggregations

MySQLServerStatusFlags (io.mycat.beans.mysql.MySQLServerStatusFlags)1 OkCommand (io.mycat.mysqlclient.command.OkCommand)1 QueryCommand (io.mycat.mysqlclient.command.QueryCommand)1 ResponseBufferCommand (io.mycat.mysqlclient.command.ResponseBufferCommand)1 ByteArrayDecoder (io.mycat.mysqlclient.decoder.ByteArrayDecoder)1 StringArrayDecoder (io.mycat.mysqlclient.decoder.StringArrayDecoder)1 NewMycatConnectionConfig (io.mycat.newquery.NewMycatConnectionConfig)1 SqlResult (io.mycat.newquery.SqlResult)1 Observable (io.reactivex.rxjava3.core.Observable)1 AsyncResult (io.vertx.core.AsyncResult)1 Future (io.vertx.core.Future)1 Handler (io.vertx.core.Handler)1 Promise (io.vertx.core.Promise)1 Buffer (io.vertx.core.buffer.Buffer)1 NetSocket (io.vertx.core.net.NetSocket)1 Function (java.util.function.Function)1 Getter (lombok.Getter)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1