Interface Client

    • Method Detail

      • execute

        java.util.List<Completion> execute​(ClientMessage message,
                                           boolean canRedo)
                                    throws java.sql.SQLException
        Send client message and read result
        Parameters:
        message - client message
        canRedo - can client message be redone in case of failover
        Returns:
        results
        Throws:
        java.sql.SQLException - if execution fails
      • execute

        java.util.List<Completion> execute​(ClientMessage message,
                                           Statement stmt,
                                           boolean canRedo)
                                    throws java.sql.SQLException
        Send client message and read result
        Parameters:
        message - client message
        stmt - statement
        canRedo - can client message be redone in case of failover
        Returns:
        results
        Throws:
        java.sql.SQLException - if execution fails
      • execute

        java.util.List<Completion> execute​(ClientMessage message,
                                           Statement stmt,
                                           int fetchSize,
                                           long maxRows,
                                           int resultSetConcurrency,
                                           int resultSetType,
                                           boolean closeOnCompletion,
                                           boolean canRedo)
                                    throws java.sql.SQLException
        Send client message and read result
        Parameters:
        message - client message
        stmt - statement
        fetchSize - fetch size
        maxRows - maximum number of rows. 0 = all
        resultSetConcurrency - concurrency
        resultSetType - result-set type
        closeOnCompletion - close statement on completion
        canRedo - can client message be redone in case of failover
        Returns:
        results
        Throws:
        java.sql.SQLException - if any error occurs
      • executePipeline

        java.util.List<Completion> executePipeline​(ClientMessage[] messages,
                                                   Statement stmt,
                                                   int fetchSize,
                                                   long maxRows,
                                                   int resultSetConcurrency,
                                                   int resultSetType,
                                                   boolean closeOnCompletion,
                                                   boolean canRedo)
                                            throws java.sql.SQLException
        Send client messages pipelining and read result
        Parameters:
        messages - client message
        stmt - statement
        fetchSize - fetch size
        maxRows - maximum number of rows. 0 = all
        resultSetConcurrency - concurrency
        resultSetType - result-set type
        closeOnCompletion - close statement on completion
        canRedo - can client message be redone in case of failover
        Returns:
        results
        Throws:
        java.sql.SQLException - if any error occurs
      • readStreamingResults

        void readStreamingResults​(java.util.List<Completion> completions,
                                  int fetchSize,
                                  long maxRows,
                                  int resultSetConcurrency,
                                  int resultSetType,
                                  boolean closeOnCompletion)
                           throws java.sql.SQLException
        Read results
        Parameters:
        completions - List that will have the new results
        fetchSize - fetch size
        maxRows - maximum number of rows. 0 = all
        resultSetConcurrency - concurrency
        resultSetType - result-set type
        closeOnCompletion - close statement on completion
        Throws:
        java.sql.SQLException - if any error occurs
      • closePrepare

        void closePrepare​(Prepare prepare)
                   throws java.sql.SQLException
        Close prepare command
        Parameters:
        prepare - prepare command
        Throws:
        java.sql.SQLException - if any error occurs
      • abort

        void abort​(java.util.concurrent.Executor executor)
            throws java.sql.SQLException
        Abort current connection
        Parameters:
        executor - executor
        Throws:
        java.sql.SQLException - if any error occurs
      • close

        void close()
            throws java.sql.SQLException
        Close client
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.sql.SQLException - if any error occurs
      • setReadOnly

        void setReadOnly​(boolean readOnly)
                  throws java.sql.SQLException
        Switch to a writer/read-only connection, no effet on mono-connection
        Parameters:
        readOnly - must use read-only connection
        Throws:
        java.sql.SQLException - if any error occurs
      • getSocketTimeout

        int getSocketTimeout()
        get socket timeout
        Returns:
        socket timeout
      • setSocketTimeout

        void setSocketTimeout​(int milliseconds)
                       throws java.sql.SQLException
        Set socket timeout
        Parameters:
        milliseconds - timeout
        Throws:
        java.sql.SQLException - if any error occurs
      • isClosed

        boolean isClosed()
        Is client closed
        Returns:
        close flag
      • reset

        void reset()
        Reset connection
      • isPrimary

        boolean isPrimary()
        is current client writer or read-only
        Returns:
        is primary
      • getContext

        Context getContext()
        Get connection context
        Returns:
        connection context
      • getExceptionFactory

        ExceptionFactory getExceptionFactory()
        Get connection exception factory
        Returns:
        connection exception factory
      • getHostAddress

        HostAddress getHostAddress()
        Get connection host
        Returns:
        connection host
      • getSocketIp

        java.lang.String getSocketIp()
        Get current socket IP or null (for Pipe / unix socket)
        Returns:
        Socket current IP