Class FullQueryLogger

  • All Implemented Interfaces:
    QueryEvents.Listener

    public class FullQueryLogger
    extends java.lang.Object
    implements QueryEvents.Listener
    A logger that logs entire query contents after the query finishes (or times out).
    • Constructor Detail

      • FullQueryLogger

        public FullQueryLogger()
    • Method Detail

      • enable

        public void enable​(java.nio.file.Path path,
                           java.lang.String rollCycle,
                           boolean blocking,
                           int maxQueueWeight,
                           long maxLogSize,
                           java.lang.String archiveCommand,
                           int maxArchiveRetries)
      • enableWithoutClean

        public void enableWithoutClean​(java.nio.file.Path path,
                                       java.lang.String rollCycle,
                                       boolean blocking,
                                       int maxQueueWeight,
                                       long maxLogSize,
                                       java.lang.String archiveCommand,
                                       int maxArchiveRetries)
      • stop

        public void stop()
      • reset

        public void reset​(java.lang.String fullQueryLogPath)
        Need the path as a parameter as well because if the process is restarted the config file might be the only location for retrieving the path to the full query log files, but JMX also allows you to specify a path that isn't persisted anywhere so we have to clean that one as well.
      • isEnabled

        public boolean isEnabled()
      • batchSuccess

        public void batchSuccess​(BatchStatement.Type type,
                                 java.util.List<? extends CQLStatement> statements,
                                 java.util.List<java.lang.String> queries,
                                 java.util.List<java.util.List<java.nio.ByteBuffer>> values,
                                 QueryOptions queryOptions,
                                 QueryState queryState,
                                 long batchTimeMillis,
                                 Message.Response response)
        Log an invocation of a batch of queries
        Specified by:
        batchSuccess in interface QueryEvents.Listener
        Parameters:
        type - The type of the batch
        statements - the prepared cql statements (unused here)
        queries - CQL text of the queries
        values - Values to bind to as parameters for the queries
        queryOptions - Options associated with the query invocation
        queryState - Timestamp state associated with the query invocation
        batchTimeMillis - Approximate time in milliseconds since the epoch since the batch was invoked
        response - the response from the batch query
      • querySuccess

        public void querySuccess​(CQLStatement statement,
                                 java.lang.String query,
                                 QueryOptions queryOptions,
                                 QueryState queryState,
                                 long queryTimeMillis,
                                 Message.Response response)
        Log a single CQL query
        Specified by:
        querySuccess in interface QueryEvents.Listener
        Parameters:
        query - CQL query text
        queryOptions - Options associated with the query invocation
        queryState - Timestamp state associated with the query invocation
        queryTimeMillis - Approximate time in milliseconds since the epoch since the batch was invoked
        response - the response from this query