phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karanmehta93 <...@git.apache.org>
Subject [GitHub] phoenix pull request #410: PHOENIX-5034 Log all critical statements in SYSTE...
Date Wed, 05 Dec 2018 00:52:21 GMT
Github user karanmehta93 commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/410#discussion_r238896548
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/log/QueryLogger.java ---
    @@ -92,9 +92,20 @@ 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 createInstance(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 percentage, 1% by default.
    +        if (connection.getLogLevel() == LogLevel.OFF) {
    --- End diff --
    
    Good work on separating out these conditions into two different ones. It looks cleaner
now.


---

Mime
View raw message