You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/07/08 09:03:08 UTC
[kylin] 02/06: KYLIN-3390 QueryInterceptorUtil.queryInterceptors is
not thread safe
This is an automated email from the ASF dual-hosted git repository.
shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit fdbe369d1187dae8c7157ef90234e6855c9eee60
Author: yiming.xu <10...@qq.com>
AuthorDate: Mon May 28 21:16:27 2018 +0800
KYLIN-3390 QueryInterceptorUtil.queryInterceptors is not thread safe
Signed-off-by: shaofengshi <sh...@apache.org>
---
.../org/apache/kylin/query/security/QueryInterceptorUtil.java | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/query/src/main/java/org/apache/kylin/query/security/QueryInterceptorUtil.java b/query/src/main/java/org/apache/kylin/query/security/QueryInterceptorUtil.java
index 6ce4c8e..3641483 100644
--- a/query/src/main/java/org/apache/kylin/query/security/QueryInterceptorUtil.java
+++ b/query/src/main/java/org/apache/kylin/query/security/QueryInterceptorUtil.java
@@ -26,11 +26,7 @@ import org.apache.kylin.common.util.ClassUtil;
public class QueryInterceptorUtil {
private static List<QueryInterceptor> queryInterceptors = new ArrayList<>();
-
- private static void setQueryInterceptor() {
- if (queryInterceptors.size() > 0) {
- return;
- }
+ static {
String[] classes = KylinConfig.getInstanceFromEnv().getQueryInterceptors();
for (String clz : classes) {
try {
@@ -43,8 +39,6 @@ public class QueryInterceptorUtil {
}
public static List<QueryInterceptor> getQueryInterceptors() {
- setQueryInterceptor();
return queryInterceptors;
}
-
}
\ No newline at end of file