stoty commented on a change in pull request #1210:
URL: https://github.com/apache/phoenix/pull/1210#discussion_r621471863
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatement.java
##########
@@ -1855,25 +1893,39 @@ public MutationPlan compileMutation(String sql) throws
SQLException {
return compileMutation(stmt, sql);
}
- public QueryLogger createQueryLogger(CompilableStatement stmt, String sql)
throws SQLException {
- if (connection.getLogLevel() == LogLevel.OFF) {
- return QueryLogger.NO_OP_INSTANCE;
- }
-
- boolean isSystemTable = false;
- if(stmt instanceof ExecutableSelectStatement) {
+ public boolean checkIgnoreQueryAudit(CompilableStatement stmt) {
Review comment:
This is now applies to al logs, so we shouldn't call it
checkIgnoreQuery**Audit**
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
##########
@@ -361,6 +361,8 @@
public static final boolean DEFAULT_COST_BASED_OPTIMIZER_ENABLED = false;
public static final boolean DEFAULT_WILDCARD_QUERY_DYNAMIC_COLS_ATTRIB =
false;
public static final String DEFAULT_LOGGING_LEVEL = LogLevel.OFF.name();
+ public static final String DEFAULT_AUDIT_LOGGING_LEVEL =
LogLevel.OFF.name();
+
Review comment:
nit: no need for the extra empty line
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerDisruptor.java
##########
@@ -74,12 +74,29 @@ public Thread newThread(Runnable r) {
final ExceptionHandler<RingBufferEvent> errorHandler = new
QueryLoggerDefaultExceptionHandler();
disruptor.setDefaultExceptionHandler(errorHandler);
- final QueryLogDetailsEventHandler[] handlers = { new
QueryLogDetailsEventHandler(configuration) };
- disruptor.handleEventsWith(handlers);
+ /**
+ * if LOG_HANDLER_COUNT is 1 it will work as the previous
implementation
+ * if LOG_HANDLER_COUNT is 2 or more then Multi Thread
+ */
+ int handlerCount = configuration.getInt(
+ QueryServices.LOG_HANDLER_COUNT,
DEFAULT_AUDIT_LOGGER_PROCESS_COUNT);
+
+ if (handlerCount <= 0){
+ LOGGER.error("Audit Log Handler Count must be greater than 0." +
+ "change to default value, input : " + handlerCount);
+ handlerCount = DEFAULT_AUDIT_LOGGER_PROCESS_COUNT;
+ }
+
+ QueryLogDetailsWorkHandler[] workHandlers = new
QueryLogDetailsWorkHandler[handlerCount];
Review comment:
We should remove the old handler, as it is dead code now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]