Github user xcangCRM commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/409#discussion_r238815424
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/log/QueryLogger.java ---
@@ -92,9 +92,17 @@ public boolean isSynced(){
}
};
- public static QueryLogger getInstance(PhoenixConnection connection,
boolean isSystemTable) {
- if (connection.getLogLevel() == LogLevel.OFF || isSystemTable ||
ThreadLocalRandom.current()
- .nextDouble() > connection.getLogSamplingRate()) { return
NO_OP_INSTANCE; }
+ public static QueryLogger getInstance(PhoenixConnection connection,
boolean isSystemTable,
+ boolean criticalStatement) {
+ // always log critical statements (DROP,ALTER for now)
+ // do not log anything when loglevel is off.
+ // do not log systemTable statement.
+ // do sampling on other statements based on configured
perncentage, 1% by default.
--- End diff --
fixed. Good eye.
---