You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2022/08/18 10:56:11 UTC
[kylin] branch kylin5 updated: KYLIN-5232 fix checkstyle
This is an automated email from the ASF dual-hosted git repository.
xxyu pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/kylin5 by this push:
new cfc55f348b KYLIN-5232 fix checkstyle
cfc55f348b is described below
commit cfc55f348bfb1b87533c8ed8637e19f91a26b4e0
Author: Mukvin <bo...@163.com>
AuthorDate: Thu Aug 18 18:23:56 2022 +0800
KYLIN-5232 fix checkstyle
---
dev-support/checkstyle-apache-suppressions.xml | 14 +++++++++++++-
src/query-common/pom.xml | 2 +-
.../kap => org/apache/kylin}/query/util/.gitignore | 0
.../apache/kylin}/query/util/EscapeParser.jj | 0
.../apache/kylin}/query/util/RawSqlParser.jj | 0
.../org/apache/kylin/rest/service/QueryService.java | 5 +++--
.../engine/spark/job/BuildLayoutWithUpdate.java | 2 +-
.../apache/kylin/engine/spark/job/DFBuildJob.java | 7 +++----
.../spark/job/ResourceDetectBeforeMergingJob.java | 2 +-
.../spark/job/ResourceDetectBeforeSampling.java | 20 +++++++++++++++++++-
.../kylin/engine/spark/job/SparkJobConstants.java | 18 ++++++++++++++++++
.../engine/spark/streaming/util/MetricsManager.java | 17 +++++++++++++++++
.../engine/spark/utils/SparkConfRuleConstants.java | 18 ++++++++++++++++++
.../kylin/query/mask/QueryDependentColumnMask.java | 1 +
.../org/apache/kylin/query/runtime/MockEngine.java | 18 ++++++++++++++++++
15 files changed, 113 insertions(+), 11 deletions(-)
diff --git a/dev-support/checkstyle-apache-suppressions.xml b/dev-support/checkstyle-apache-suppressions.xml
index dd57da25ee..0272f7fdd8 100644
--- a/dev-support/checkstyle-apache-suppressions.xml
+++ b/dev-support/checkstyle-apache-suppressions.xml
@@ -62,5 +62,17 @@
files="UHCDictionaryReducer.java"/>
<suppress checks="IllegalImport" files="FragmentData.java"/>
+ <suppress checks="LeftCurly" files="(RawSqlParserTokenManager|EscapeParserTokenManager|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="RightCurly" files="(RawSqlParserTokenManager|EscapeParserTokenManager|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="MissingSwitchDefault" files="(RawSqlParserTokenManager|EscapeParserTokenManager|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="Header" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="SingleSpaceSeparator" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="MethodLength" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="RedundantImport" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="UnusedImports" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="OperatorWrap" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="ArrayTypeStyle" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="WhitespaceAfter" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
+ <suppress checks="EmptyStatement" files="(RawSqlParserTokenManager|EscapeParserTokenManager|EscapeParserConstants|Token|SimpleCharStream|RawSqlParser|TokenMgrError|ParseException|RawSqlParserConstants|EscapeParser).java" />
-</suppressions>
\ No newline at end of file
+</suppressions>
diff --git a/src/query-common/pom.xml b/src/query-common/pom.xml
index 69a24da9f1..a4ebe774e4 100644
--- a/src/query-common/pom.xml
+++ b/src/query-common/pom.xml
@@ -50,7 +50,7 @@
<goal>javacc</goal>
</goals>
<configuration>
- <sourceDirectory>src/main/codegen/javacc/io/kyligence/kap/query/util/
+ <sourceDirectory>src/main/codegen/javacc/org/apache/kylin/query/util/
</sourceDirectory>
<includes>
<include>*.jj</include>
diff --git a/src/query-common/src/main/codegen/javacc/io/kyligence/kap/query/util/.gitignore b/src/query-common/src/main/codegen/javacc/org/apache/kylin/query/util/.gitignore
similarity index 100%
rename from src/query-common/src/main/codegen/javacc/io/kyligence/kap/query/util/.gitignore
rename to src/query-common/src/main/codegen/javacc/org/apache/kylin/query/util/.gitignore
diff --git a/src/query-common/src/main/codegen/javacc/io/kyligence/kap/query/util/EscapeParser.jj b/src/query-common/src/main/codegen/javacc/org/apache/kylin/query/util/EscapeParser.jj
similarity index 100%
rename from src/query-common/src/main/codegen/javacc/io/kyligence/kap/query/util/EscapeParser.jj
rename to src/query-common/src/main/codegen/javacc/org/apache/kylin/query/util/EscapeParser.jj
diff --git a/src/query-common/src/main/codegen/javacc/io/kyligence/kap/query/util/RawSqlParser.jj b/src/query-common/src/main/codegen/javacc/org/apache/kylin/query/util/RawSqlParser.jj
similarity index 100%
rename from src/query-common/src/main/codegen/javacc/io/kyligence/kap/query/util/RawSqlParser.jj
rename to src/query-common/src/main/codegen/javacc/org/apache/kylin/query/util/RawSqlParser.jj
diff --git a/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java b/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java
index 336539b546..e4c2ce7203 100644
--- a/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java
+++ b/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java
@@ -501,10 +501,11 @@ public class QueryService extends BasicService implements CacheSignatureQuerySup
}
try (SetThreadName ignored = new SetThreadName("Query %s", queryContext.getQueryId());
SetLogCategory ignored2 = new SetLogCategory("query")) {
- if (sqlRequest.getExecuteAs() != null)
+ if (sqlRequest.getExecuteAs() != null) {
sqlRequest.setUsername(sqlRequest.getExecuteAs());
- else
+ } else {
sqlRequest.setUsername(getUsername());
+ }
QueryLimiter.tryAcquire();
SQLResponse response = doQueryWithCache(sqlRequest);
response.setTraces(QueryContext.currentTrace().spans().stream().map(span -> {
diff --git a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/BuildLayoutWithUpdate.java b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/BuildLayoutWithUpdate.java
index de0f89814f..da44d15714 100644
--- a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/BuildLayoutWithUpdate.java
+++ b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/BuildLayoutWithUpdate.java
@@ -88,7 +88,7 @@ public class BuildLayoutWithUpdate {
}
public long updateSingleLayout(NDataSegment seg, KylinConfig config, String project) {
- long indexId = -1l;
+ long indexId = -1L;
try {
logger.info("Wait to take job result.");
JobResult result = completionService.take().get();
diff --git a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/DFBuildJob.java b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/DFBuildJob.java
index dbafbc0092..26a51464d5 100644
--- a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/DFBuildJob.java
+++ b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/DFBuildJob.java
@@ -360,10 +360,9 @@ public class DFBuildJob extends SparkApplication {
}
// decided and construct the next layer.
- protected List<NBuildSourceInfo> constructTheNextLayerBuildInfos( //
- NSpanningTree st, //
- NDataSegment seg, //
- Collection<IndexEntity> allIndexesInCurrentLayer) { //
+ protected List<NBuildSourceInfo> constructTheNextLayerBuildInfos(NSpanningTree st, NDataSegment seg,
+ Collection<IndexEntity> allIndexesInCurrentLayer
+ ) {
val childrenBuildSourceInfos = new ArrayList<NBuildSourceInfo>();
for (IndexEntity index : allIndexesInCurrentLayer) {
diff --git a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeMergingJob.java b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeMergingJob.java
index 39511740d6..a432509485 100644
--- a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeMergingJob.java
+++ b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeMergingJob.java
@@ -68,7 +68,7 @@ public class ResourceDetectBeforeMergingJob extends SparkApplication implements
List<Path> paths = JavaConversions
.seqAsJavaList(ResourceDetectUtils.getPaths(afterMerge.queryExecution().sparkPlan()));
resourceSize.put(String.valueOf(entry.getKey()),
- ResourceDetectUtils.getResourceSize(SparderEnv.getHadoopConfiguration(),config.isConcurrencyFetchDataSourceSize(),
+ ResourceDetectUtils.getResourceSize(SparderEnv.getHadoopConfiguration(), config.isConcurrencyFetchDataSourceSize(),
JavaConverters.asScalaIteratorConverter(paths.iterator()).asScala().toSeq()));
}
ResourceDetectUtils.write(new Path(config.getJobTmpShareDir(project, jobId),
diff --git a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeSampling.java b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeSampling.java
index dc8d707425..78760c4f58 100644
--- a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeSampling.java
+++ b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/ResourceDetectBeforeSampling.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.kylin.engine.spark.job;
import java.util.List;
@@ -45,7 +63,7 @@ public class ResourceDetectBeforeSampling extends SparkApplication implements Re
Map<String, Long> resourceSize = Maps.newHashMap();
resourceSize.put(String.valueOf(tableName),
- ResourceDetectUtils.getResourceSize(SparderEnv.getHadoopConfiguration(),config.isConcurrencyFetchDataSourceSize(),
+ ResourceDetectUtils.getResourceSize(SparderEnv.getHadoopConfiguration(), config.isConcurrencyFetchDataSourceSize(),
JavaConverters.asScalaIteratorConverter(paths.iterator()).asScala().toSeq()));
Map<String, String> tableLeafTaskNums = Maps.newHashMap();
diff --git a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/SparkJobConstants.java b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/SparkJobConstants.java
index 559efe7a4b..9b04e6fbdb 100644
--- a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/SparkJobConstants.java
+++ b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/job/SparkJobConstants.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.kylin.engine.spark.job;
public final class SparkJobConstants {
diff --git a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/streaming/util/MetricsManager.java b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/streaming/util/MetricsManager.java
index e69de29bb2..2379ddac12 100644
--- a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/streaming/util/MetricsManager.java
+++ b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/streaming/util/MetricsManager.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
diff --git a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/utils/SparkConfRuleConstants.java b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/utils/SparkConfRuleConstants.java
index b3b1b54d4f..d6c66b9dbc 100644
--- a/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/utils/SparkConfRuleConstants.java
+++ b/src/spark-project/engine-spark/src/main/scala/org/apache/kylin/engine/spark/utils/SparkConfRuleConstants.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.kylin.engine.spark.utils;
public final class SparkConfRuleConstants {
diff --git a/src/spark-project/sparder/src/main/java/org/apache/kylin/query/mask/QueryDependentColumnMask.java b/src/spark-project/sparder/src/main/java/org/apache/kylin/query/mask/QueryDependentColumnMask.java
index bb99e9440a..4e425190b5 100644
--- a/src/spark-project/sparder/src/main/java/org/apache/kylin/query/mask/QueryDependentColumnMask.java
+++ b/src/spark-project/sparder/src/main/java/org/apache/kylin/query/mask/QueryDependentColumnMask.java
@@ -100,6 +100,7 @@ public class QueryDependentColumnMask implements QueryResultMask {
}
}
+ @Override
public Dataset<Row> doMaskResult(Dataset<Row> df) {
if (dependentInfo == null || rootRelNode == null || !dependentInfo.needMask()) {
return df;
diff --git a/src/spark-project/sparder/src/main/scala/org/apache/kylin/query/runtime/MockEngine.java b/src/spark-project/sparder/src/main/scala/org/apache/kylin/query/runtime/MockEngine.java
index 402c511315..2f546c7333 100644
--- a/src/spark-project/sparder/src/main/scala/org/apache/kylin/query/runtime/MockEngine.java
+++ b/src/spark-project/sparder/src/main/scala/org/apache/kylin/query/runtime/MockEngine.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.kylin.query.runtime;
import java.util.List;