Class FullQueryLogger

java.lang.Object
org.apache.cassandra.fql.FullQueryLogger
All Implemented Interfaces:
QueryEvents.Listener

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

  • Constructor Details

    • FullQueryLogger

      public FullQueryLogger()
  • Method Details

    • enable

      public void enable(Path path, String rollCycle, boolean blocking, int maxQueueWeight, long maxLogSize, String archiveCommand, int maxArchiveRetries)
    • enableWithoutClean

      public void enableWithoutClean(Path path, String rollCycle, boolean blocking, int maxQueueWeight, long maxLogSize, String archiveCommand, int maxArchiveRetries)
    • getFullQueryLoggerOptions

      public FullQueryLoggerOptions getFullQueryLoggerOptions()
    • stop

      public void stop()
    • reset

      public void reset(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, List<? extends CQLStatement> statements, List<String> queries, List<List<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, 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
    • executeSuccess

      public void executeSuccess(CQLStatement statement, String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
      Specified by:
      executeSuccess in interface QueryEvents.Listener