Package org.apache.cassandra.fql
Class FullQueryLogger
- java.lang.Object
-
- org.apache.cassandra.fql.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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FullQueryLogger.Batch
static class
FullQueryLogger.Query
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BATCH
static java.lang.String
BATCH_TYPE
static long
CURRENT_VERSION
static java.lang.String
GENERATED_NOW_IN_SECONDS
static java.lang.String
GENERATED_TIMESTAMP
static FullQueryLogger
instance
static java.lang.String
KEYSPACE
protected static org.slf4j.Logger
logger
static java.lang.String
PROTOCOL_VERSION
static java.lang.String
QUERIES
static java.lang.String
QUERY
static java.lang.String
QUERY_OPTIONS
static java.lang.String
QUERY_START_TIME
static java.lang.String
SINGLE_QUERY
static java.lang.String
TYPE
static java.lang.String
VALUES
static java.lang.String
VERSION
-
Constructor Summary
Constructors Constructor Description FullQueryLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 queriesvoid
enable(java.nio.file.Path path, java.lang.String rollCycle, boolean blocking, int maxQueueWeight, long maxLogSize, java.lang.String archiveCommand, int maxArchiveRetries)
void
enableWithoutClean(java.nio.file.Path path, java.lang.String rollCycle, boolean blocking, int maxQueueWeight, long maxLogSize, java.lang.String archiveCommand, int maxArchiveRetries)
void
executeSuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
FullQueryLoggerOptions
getFullQueryLoggerOptions()
boolean
isEnabled()
void
querySuccess(CQLStatement statement, java.lang.String query, QueryOptions queryOptions, QueryState queryState, long queryTimeMillis, Message.Response response)
Log a single CQL queryvoid
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.void
stop()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.QueryEvents.Listener
batchFailure, executeFailure, prepareFailure, prepareSuccess, queryFailure
-
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
CURRENT_VERSION
public static final long CURRENT_VERSION
- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
- See Also:
- Constant Field Values
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
PROTOCOL_VERSION
public static final java.lang.String PROTOCOL_VERSION
- See Also:
- Constant Field Values
-
QUERY_OPTIONS
public static final java.lang.String QUERY_OPTIONS
- See Also:
- Constant Field Values
-
QUERY_START_TIME
public static final java.lang.String QUERY_START_TIME
- See Also:
- Constant Field Values
-
GENERATED_TIMESTAMP
public static final java.lang.String GENERATED_TIMESTAMP
- See Also:
- Constant Field Values
-
GENERATED_NOW_IN_SECONDS
public static final java.lang.String GENERATED_NOW_IN_SECONDS
- See Also:
- Constant Field Values
-
KEYSPACE
public static final java.lang.String KEYSPACE
- See Also:
- Constant Field Values
-
BATCH
public static final java.lang.String BATCH
- See Also:
- Constant Field Values
-
SINGLE_QUERY
public static final java.lang.String SINGLE_QUERY
- See Also:
- Constant Field Values
-
QUERY
public static final java.lang.String QUERY
- See Also:
- Constant Field Values
-
BATCH_TYPE
public static final java.lang.String BATCH_TYPE
- See Also:
- Constant Field Values
-
QUERIES
public static final java.lang.String QUERIES
- See Also:
- Constant Field Values
-
VALUES
public static final java.lang.String VALUES
- See Also:
- Constant Field Values
-
instance
public static final FullQueryLogger instance
-
-
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)
-
getFullQueryLoggerOptions
public FullQueryLoggerOptions getFullQueryLoggerOptions()
-
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 interfaceQueryEvents.Listener
- Parameters:
type
- The type of the batchstatements
- the prepared cql statements (unused here)queries
- CQL text of the queriesvalues
- Values to bind to as parameters for the queriesqueryOptions
- Options associated with the query invocationqueryState
- Timestamp state associated with the query invocationbatchTimeMillis
- Approximate time in milliseconds since the epoch since the batch was invokedresponse
- 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 interfaceQueryEvents.Listener
- Parameters:
query
- CQL query textqueryOptions
- Options associated with the query invocationqueryState
- Timestamp state associated with the query invocationqueryTimeMillis
- Approximate time in milliseconds since the epoch since the batch was invokedresponse
- the response from this query
-
executeSuccess
public void executeSuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
- Specified by:
executeSuccess
in interfaceQueryEvents.Listener
-
-