Class PrepareExecutePacket

    • Constructor Detail

      • PrepareExecutePacket

        public PrepareExecutePacket​(java.lang.String sql,
                                    Parameters parameters,
                                    ServerPreparedStatement prep,
                                    java.io.InputStream localInfileInputStream)
        Construct prepare packet
        Parameters:
        sql - sql
        parameters - parameter
        prep - prepare
        localInfileInputStream - local infile input stream
    • Method Detail

      • encode

        public int encode​(Writer writer,
                          Context context,
                          Prepare newPrepareResult)
                   throws java.io.IOException,
                          java.sql.SQLException
        Description copied from interface: RedoableWithPrepareClientMessage
        encoder method in case of failover, passing new prepared object
        Specified by:
        encode in interface RedoableClientMessage
        Specified by:
        encode in interface RedoableWithPrepareClientMessage
        Parameters:
        writer - socket writer
        context - connection context
        newPrepareResult - new prepare result
        Returns:
        number of command sent
        Throws:
        java.io.IOException - if a socket exception occurs
        java.sql.SQLException - for any other kind of error
      • readPacket

        public Completion readPacket​(Statement stmt,
                                     int fetchSize,
                                     long maxRows,
                                     int resultSetConcurrency,
                                     int resultSetType,
                                     boolean closeOnCompletion,
                                     Reader reader,
                                     Writer writer,
                                     Context context,
                                     ExceptionFactory exceptionFactory,
                                     ClosableLock lock,
                                     boolean traceEnable,
                                     ClientMessage message,
                                     java.util.function.Consumer<java.lang.String> redirectFct)
                              throws java.io.IOException,
                                     java.sql.SQLException
        Description copied from interface: ClientMessage
        default packet resultset parser
        Specified by:
        readPacket in interface ClientMessage
        Parameters:
        stmt - caller
        fetchSize - fetch size
        maxRows - maximum number of rows
        resultSetConcurrency - resultset concurrency
        resultSetType - resultset type
        closeOnCompletion - must close caller on result parsing end
        reader - packet reader
        writer - packet writer
        context - connection context
        exceptionFactory - connection exception factory
        lock - thread safe locks
        traceEnable - is logging trace enable
        message - client message
        redirectFct - redirect consumer
        Returns:
        results
        Throws:
        java.io.IOException - if any socket error occurs
        java.sql.SQLException - for other kind of errors
      • ensureReplayable

        public void ensureReplayable​(Context context)
                              throws java.io.IOException,
                                     java.sql.SQLException
        Description copied from interface: RedoableClientMessage
        Ensure that command can be replayed
        Specified by:
        ensureReplayable in interface RedoableClientMessage
        Parameters:
        context - connection context
        Throws:
        java.io.IOException - If socket error occurs
        java.sql.SQLException - for other type of issue
      • canSkipMeta

        public boolean canSkipMeta()
        Description copied from interface: ClientMessage
        Can skip metadata
        Specified by:
        canSkipMeta in interface ClientMessage
        Returns:
        can skip metadata
      • description

        public java.lang.String description()
        Description copied from interface: ClientMessage
        Message description
        Specified by:
        description in interface ClientMessage
        Returns:
        description
      • batchUpdateLength

        public int batchUpdateLength()
        Description copied from interface: ClientMessage
        Number of parameter rows, and so expected return length
        Specified by:
        batchUpdateLength in interface ClientMessage
        Returns:
        batch update length
      • getLocalInfileInputStream

        public java.io.InputStream getLocalInfileInputStream()
        Description copied from interface: ClientMessage
        Get current local infile input stream.
        Specified by:
        getLocalInfileInputStream in interface ClientMessage
        Returns:
        default to null
      • binaryProtocol

        public boolean binaryProtocol()
        Description copied from interface: ClientMessage
        Are return value encoded in binary protocol
        Specified by:
        binaryProtocol in interface ClientMessage
        Returns:
        use binary protocol
      • validateLocalFileName

        public boolean validateLocalFileName​(java.lang.String fileName,
                                             Context context)
        Description copied from interface: ClientMessage
        Request for local file to be validated from current query.
        Specified by:
        validateLocalFileName in interface ClientMessage
        Parameters:
        fileName - server file request path
        context - current connection context
        Returns:
        true if file name correspond to demand and query is a load local infile