You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/02/15 12:41:20 UTC

[GitHub] [iotdb] sunjincheng121 opened a new pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

sunjincheng121 opened a new pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684


   ## Description
   This PR includes two commits, one is the POM configuration of the Spotless plug-in, the other is format the code by using spotless / Google Java format. 
   
   Note: 
   - We also need a PR (Web site) to explain how the IDE is configured, which will be opened in a separate PR.
   - When this PR is merged, other PRS can be merged according to the following steps(take pull/2667 for example):
   `asf` is repo of Apache IoTDB
    ```
   gf asf pull/2667/head:PR2667
   gck PR2667
   git cherry-pick 80de95b7 
   mvn spotless:check
   mvn spotless:apply
   git add .
   git commit -m 'Apply spotless'
   git rebase asf_master
   // Resolve your conflict
   git rebase --continue
   // After squash your commits
   gck asf_master
   git merge PR2667
   git push asf asf_master:master
   
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 removed a comment on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 removed a comment on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-781113386


   Thanks for your review @liutaohua !
   I have update the PR accordingly in `fixup` commit. and rebase the code in another commit. 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-779492310


   I have checked this CI error, and ensure that this error is not caused by the current PR. the same problem occurred in [1][2]. I created JIRA[3] to focus on tracking.
   [1] https://github.com/apache/iotdb/pull/2677/checks?check_run_id=1892946112
   [2] https://github.com/apache/iotdb/pull/2667/checks?check_run_id=1863611951
   [3] https://issues.apache.org/jira/browse/IOTDB-1157


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] liutaohua commented on a change in pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
liutaohua commented on a change in pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#discussion_r578166613



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/AlignByDevicePlan.java
##########
@@ -18,18 +18,21 @@
  */
 package org.apache.iotdb.db.qp.physical.crud;
 
-import java.util.List;
-import java.util.Map;
 import org.apache.iotdb.db.metadata.PartialPath;
 import org.apache.iotdb.db.qp.logical.Operator;
 import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.read.expression.IExpression;
 
+import java.util.List;
+import java.util.Map;
+
 public class AlignByDevicePlan extends QueryPlan {
 
-  private List<String> measurements; // to record result measurement columns, e.g. temperature, status, speed
-  private Map<String, String> measurementAliasMap; // select s1, s2 as speed from root, then s2 -> speed
+  private List<String>
+      measurements; // to record result measurement columns, e.g. temperature, status, speed
+  private Map<String, String>

Review comment:
       okay




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 removed a comment on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 removed a comment on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-781126659






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-781185197


   I have squash the commits, and Keep 2 commits due to the first commit can help us to rebase other PRs.
   BTW: I'd like to add .git-blame-ignore-revs for ignore this big code format refactor after this PR has been merged.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] jixuan1989 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
jixuan1989 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-779548450


   > https://issues.apache.org/jira/browse/IOTDB-1157
   
   It is not caused by sonar version.
   
   If you want to avoid warnings, see [1] , by using 
   ```
   - uses: actions/checkout@v2
     with:
       fetch-depth: 0
   ```
   
   If you want to solve NullPointer issues, I have no idea. If you check the sonar command, you will find the problem is `sonar.login` is null, 
   ![image](https://user-images.githubusercontent.com/1021782/108012809-4b1a4800-7045-11eb-860b-adbec0ab4aec.png)
   
   see [2] and [3] for why. and that is why I open PR #2681 
   
   [1] https://community.sonarsource.com/t/sonarcloud-with-github-actions/22713
   [2] https://www.google.com/url?q=https://help.github.com/en/articles/events-that-trigger-workflows%23pull-request-events-for-forked-repositories&source=gmail&ust=1613530497486000&usg=AFQjCNEfebNVY_hNI4Gtz41Cba39YTgLhw
   [3] https://lists.apache.org/thread.html/rffca7a170b1e982c050279bf80802660b2c18131963b34c22122fb95%40%3Cbuilds.apache.org%3E


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-780386561


   should add one improvement fixup commit later before merged.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-781126659


   I would like to do the last check before merging...


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-781132019


   Thanks for your review @liutaohua 
   I have update the PR accordingly in `fixup` commit. and rebase the code in another commit.
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] jixuan1989 merged pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
jixuan1989 merged pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-780449114


   I have update the PR by the follows changes:
   - Fix incorrect license headers, i.e., `/**` to `/*` in License header.
   - Turn special class comments into multiline comments for ensure example readability.
   
    


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-781113386


   Thanks for your review @liutaohua !
   I have update the PR accordingly in `fixup` commit. and rebase the code in another commit. 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-779576634


   > > https://issues.apache.org/jira/browse/IOTDB-1157
   > 
   > It is not caused by sonar version.
   > 
   > If you want to avoid warnings, see [1] , by using
   > 
   > ```
   > - uses: actions/checkout@v2
   >   with:
   >     fetch-depth: 0
   > ```
   > 
   > If you want to solve NullPointer issues, I have no idea. If you check the sonar command, you will find the problem is `sonar.login` is null,
   > ![image](https://user-images.githubusercontent.com/1021782/108012809-4b1a4800-7045-11eb-860b-adbec0ab4aec.png)
   > 
   > see [2] and [3] for why. and that is why I open PR #2681
   > 
   > [1] https://community.sonarsource.com/t/sonarcloud-with-github-actions/22713
   > [2] https://www.google.com/url?q=https://help.github.com/en/articles/events-that-trigger-workflows%23pull-request-events-for-forked-repositories&source=gmail&ust=1613530497486000&usg=AFQjCNEfebNVY_hNI4Gtz41Cba39YTgLhw
   > [3] https://lists.apache.org/thread.html/rffca7a170b1e982c050279bf80802660b2c18131963b34c22122fb95%40%3Cbuilds.apache.org%3E
   
   Opened the PR for Correct the config of `sonar.java.checkstyle.reportPaths`. https://github.com/apache/iotdb/pull/2685


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-779310819


   Add one commit about upgrade the sonar-maven-plugin version to 3.7.0.1746 due to ubuntu(11) CI check error: https://github.com/apache/iotdb/runs/1904211046#step:8:11596


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] liutaohua commented on a change in pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
liutaohua commented on a change in pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#discussion_r578103765



##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/datapoint/IntDataPoint.java
##########
@@ -32,12 +34,10 @@
 public class IntDataPoint extends DataPoint {
 
   private static final Logger LOG = LoggerFactory.getLogger(IntDataPoint.class);
-  /** actual value. **/
+  /** actual value. * */

Review comment:
       redundant `*`

##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/datapoint/FloatDataPoint.java
##########
@@ -32,12 +34,10 @@
 public class FloatDataPoint extends DataPoint {
 
   private static final Logger LOG = LoggerFactory.getLogger(FloatDataPoint.class);
-  /** actual value. **/
+  /** actual value. * */

Review comment:
       redundant `*`

##########
File path: pom.xml
##########
@@ -598,6 +599,34 @@
                         </excludes>
                     </configuration>
                 </plugin>
+                <plugin>
+                    <groupId>com.diffplug.spotless</groupId>
+                    <artifactId>spotless-maven-plugin</artifactId>
+                    <version>${spotless.version}</version>
+                    <configuration>
+                        <java>
+                            <googleJavaFormat>
+                                <version>1.7</version>
+                                <style>GOOGLE</style>
+                            </googleJavaFormat>
+
+                            <importOrder>
+                                <order>org.apache.iotdb,,javax,java,\#</order>

Review comment:
       why double `,`  , typo ?

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/AlignByDevicePlan.java
##########
@@ -18,18 +18,21 @@
  */
 package org.apache.iotdb.db.qp.physical.crud;
 
-import java.util.List;
-import java.util.Map;
 import org.apache.iotdb.db.metadata.PartialPath;
 import org.apache.iotdb.db.qp.logical.Operator;
 import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.read.expression.IExpression;
 
+import java.util.List;
+import java.util.Map;
+
 public class AlignByDevicePlan extends QueryPlan {
 
-  private List<String> measurements; // to record result measurement columns, e.g. temperature, status, speed
-  private Map<String, String> measurementAliasMap; // select s1, s2 as speed from root, then s2 -> speed
+  private List<String>
+      measurements; // to record result measurement columns, e.g. temperature, status, speed
+  private Map<String, String>

Review comment:
       Don't use end-of-line comments?

##########
File path: session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
##########
@@ -328,16 +388,12 @@ public void insertTablet(Tablet tablet)
 
   /**
    * insert the data of a device. For each timestamp, the number of measurements is the same.
-   * <p>
-   * a Tablet example:
    *
-   *      device1

Review comment:
       same

##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/utils/Murmur128Hash.java
##########
@@ -44,25 +44,29 @@ public static int hash(String value, int seed) {
    * @return hashcode of value
    */
   public static int hash(String value1, long value2, int seed) {
-    return (int) innerHash(
-        BytesUtils.concatByteArray(value1.getBytes(), BytesUtils.longToBytes(value2)), 0,
-        value1.length() + 8, seed);
+    return (int)
+        innerHash(
+            BytesUtils.concatByteArray(value1.getBytes(), BytesUtils.longToBytes(value2)),
+            0,
+            value1.length() + 8,
+            seed);
   }
 
-  /**************************************
-   * Methods to perform murmur 128 hash.
-   **************************************/
+  /**
+   * ************************************ Methods to perform murmur 128 hash.

Review comment:
       redundant `*`

##########
File path: example/udf/src/main/java/org/apache/iotdb/udf/UDTFExample.java
##########
@@ -1,56 +1,54 @@
-/*
- * 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.iotdb.udf;
-
-import java.io.IOException;
-import org.apache.iotdb.db.query.udf.api.UDTF;
-import org.apache.iotdb.db.query.udf.api.access.Row;
-import org.apache.iotdb.db.query.udf.api.collector.PointCollector;
-import org.apache.iotdb.db.query.udf.api.customizer.config.UDTFConfigurations;
-import org.apache.iotdb.db.query.udf.api.customizer.parameter.UDFParameters;
-import org.apache.iotdb.db.query.udf.api.customizer.strategy.RowByRowAccessStrategy;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-
-/**
- * SET STORAGE GROUP TO root.sg1;
- * CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN;
- * CREATE TIMESERIES root.sg1.d1.s2 WITH DATATYPE=INT32, ENCODING=PLAIN;
- * INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (0, -1, 1);
- * INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (1, -2, 2);
- * INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (2, -3, 3);
- *
- * CREATE FUNCTION example AS "org.apache.iotdb.udf.UDTFExample";
- * SHOW FUNCTIONS;
- * SELECT s1, example(s1), s2, example(s2) FROM root.sg1.d1;
- */
-public class UDTFExample implements UDTF {
-
-  @Override
-  public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations) {
-    configurations
-        .setAccessStrategy(new RowByRowAccessStrategy())
-        .setOutputDataType(TSDataType.INT32);
-  }
-
-  @Override
-  public void transform(Row row, PointCollector collector) throws IOException {
-    collector.putInt(row.getTime(), -row.getInt(0));
-  }
-}
+/*
+ * 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.iotdb.udf;
+
+import org.apache.iotdb.db.query.udf.api.UDTF;
+import org.apache.iotdb.db.query.udf.api.access.Row;
+import org.apache.iotdb.db.query.udf.api.collector.PointCollector;
+import org.apache.iotdb.db.query.udf.api.customizer.config.UDTFConfigurations;
+import org.apache.iotdb.db.query.udf.api.customizer.parameter.UDFParameters;
+import org.apache.iotdb.db.query.udf.api.customizer.strategy.RowByRowAccessStrategy;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+
+import java.io.IOException;
+
+/**

Review comment:
       `/*`

##########
File path: session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
##########
@@ -289,35 +351,33 @@ private void closeSession(Session session) {
       try {
         session.close();
       } catch (Exception e2) {
-        //do nothing. We just want to guarantee the session is closed.
+        // do nothing. We just want to guarantee the session is closed.
         logger.warn(CLOSE_THE_SESSION_FAILED, e2);
       }
     }
   }
 
-  private void cleanSessionAndMayThrowConnectionException(Session session, int times,
-      IoTDBConnectionException e) throws IoTDBConnectionException {
+  private void cleanSessionAndMayThrowConnectionException(
+      Session session, int times, IoTDBConnectionException e) throws IoTDBConnectionException {
     closeSession(session);
     removeSession();
     if (times == FINAL_RETRY) {
       throw new IoTDBConnectionException(
-          String.format("retry to execute statement on %s:%s failed %d times: %s", ip, port,
-              RETRY, e.getMessage()), e);
+          String.format(
+              "retry to execute statement on %s:%s failed %d times: %s",
+              ip, port, RETRY, e.getMessage()),
+          e);
     }
   }
 
   /**
    * insert the data of a device. For each timestamp, the number of measurements is the same.
    *
-   *  a Tablet example:
+   * <p>a Tablet example:
    *
-   *        device1

Review comment:
       use `/*` to show

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -257,15 +270,11 @@ private static void insertRecords() throws IoTDBConnectionException, StatementEx
   /**
    * insert the data of a device. For each timestamp, the number of measurements is the same.
    *
-   * a Tablet example:
+   * <p>a Tablet example:
    *
-   *      device1

Review comment:
       use `/*` to show

##########
File path: example/udf/pom.xml
##########
@@ -60,6 +60,34 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>com.diffplug.spotless</groupId>
+                <artifactId>spotless-maven-plugin</artifactId>
+                <version>2.4.2</version>
+                <configuration>
+                    <java>
+                        <googleJavaFormat>
+                            <version>1.7</version>
+                            <style>GOOGLE</style>
+                        </googleJavaFormat>
+
+                        <importOrder>
+                            <order>org.apache.iotdb,,javax,java,\#</order>

Review comment:
       why need two `,` here?  typo?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 removed a comment on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 removed a comment on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-781138980


   I have squash the commits, and Keep 2 commits due to the first commit can help to rebase other PRs.
   
   BTW: I'd like to add .git-blame-ignore-revs for ignore this big code format refactor after this PR has been merged.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on a change in pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on a change in pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#discussion_r578154933



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/AlignByDevicePlan.java
##########
@@ -18,18 +18,21 @@
  */
 package org.apache.iotdb.db.qp.physical.crud;
 
-import java.util.List;
-import java.util.Map;
 import org.apache.iotdb.db.metadata.PartialPath;
 import org.apache.iotdb.db.qp.logical.Operator;
 import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.read.expression.IExpression;
 
+import java.util.List;
+import java.util.Map;
+
 public class AlignByDevicePlan extends QueryPlan {
 
-  private List<String> measurements; // to record result measurement columns, e.g. temperature, status, speed
-  private Map<String, String> measurementAliasMap; // select s1, s2 as speed from root, then s2 -> speed
+  private List<String>
+      measurements; // to record result measurement columns, e.g. temperature, status, speed
+  private Map<String, String>

Review comment:
       At present, we have a lot of end of line comments, which are very convenient. If we want to prohibit the use of end of line comments, we need to initiate a discussion. due to we 
    may  need  modify Google-Java-format. I suggest solving it in another PR after discussion. What do you think?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on a change in pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on a change in pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#discussion_r578164243



##########
File path: pom.xml
##########
@@ -598,6 +599,34 @@
                         </excludes>
                     </configuration>
                 </plugin>
+                <plugin>
+                    <groupId>com.diffplug.spotless</groupId>
+                    <artifactId>spotless-maven-plugin</artifactId>
+                    <version>${spotless.version}</version>
+                    <configuration>
+                        <java>
+                            <googleJavaFormat>
+                                <version>1.7</version>
+                                <style>GOOGLE</style>
+                            </googleJavaFormat>
+
+                            <importOrder>
+                                <order>org.apache.iotdb,,javax,java,\#</order>

Review comment:
       This affects the order in which packages are imported. 
   
   ```
   import org.slf4j.Logger;
   import org.slf4j.LoggerFactory;
   import org.apache.commons.io.FileUtils;
   ```
   vs 
   
   ```
   import org.apache.commons.io.FileUtils;
   import org.slf4j.Logger;
   import org.slf4j.LoggerFactory;
   ```
   We are in the latter order at present. :)




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 commented on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 commented on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-780986410


   Rebase code from master...


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [iotdb] sunjincheng121 edited a comment on pull request #2684: [IOTDB-1156] Improve the quality and efficiency of code formatting

Posted by GitBox <gi...@apache.org>.
sunjincheng121 edited a comment on pull request #2684:
URL: https://github.com/apache/iotdb/pull/2684#issuecomment-780986410


   Rebase code according to master...


----------------------------------------------------------------
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:
users@infra.apache.org