[GitHub] [incubator-iotdb] vesense opened a new pull request #809: [IOTDB-486] Correct typo and broken link in `example/ rocketmq/readme…

2020-02-14 Thread GitBox
vesense opened a new pull request #809: [IOTDB-486] Correct typo and broken 
link in `example/ rocketmq/readme…
URL: https://github.com/apache/incubator-iotdb/pull/809
 
 
   ….md`


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] vesense opened a new pull request #808: [IOTDB-485] Fix the broken link for `Client/Shell tools`

2020-02-14 Thread GitBox
vesense opened a new pull request #808: [IOTDB-485] Fix the broken link for 
`Client/Shell tools`
URL: https://github.com/apache/incubator-iotdb/pull/808
 
 
   Fix the broken link for `Client/Shell tools` in `Chapter 5: Operation Manual
   DML`


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] vesense opened a new pull request #807: Added maven status badge

2020-02-14 Thread GitBox
vesense opened a new pull request #807: Added maven status badge
URL: https://github.com/apache/incubator-iotdb/pull/807
 
 
   Added maven status badge for tracking latest jar version and linking to 
maven central repo.
   
   
![image](https://user-images.githubusercontent.com/6711230/74583501-93ea8b80-5002-11ea-921f-335c9beac8a8.png)
   
   
![image](https://user-images.githubusercontent.com/6711230/74583497-86cd9c80-5002-11ea-9ea5-13999d576d8f.png)
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #806: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #806: [IOTDB-467] The CLI 
displays query results in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/806#discussion_r379714277
 
 

 ##
 File path: client/src/main/java/org/apache/iotdb/client/AbstractClient.java
 ##
 @@ -106,6 +110,7 @@
   static ServerProperties properties = null;
 
   private static final PrintStream SCREEN_PRINTER = new 
PrintStream(System.out);
+  private static boolean curserBeforeFirst = true;
 
 Review comment:
   ```suggestion
 private static boolean cursorBeforeFirst = true;
   ```


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] liutaohua commented on issue #806: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
liutaohua commented on issue #806: [IOTDB-467] The CLI displays query results 
in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/806#issuecomment-586548850
 
 
   > Thank you for your contribution. But it has been done by #804
   
   welcome for new contributor ,#804 was closed


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] liutaohua closed pull request #804: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
liutaohua closed pull request #804: [IOTDB-467] The CLI displays query results 
in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/804
 
 
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #713: [IOTDB-418] New series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#issuecomment-586547383
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [17 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #713: [IOTDB-418] New series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#issuecomment-586290103
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [18 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin merged pull request #805: [IOTDB-466] group by device -> align by device && group by time range [] -> [)

2020-02-14 Thread GitBox
qiaojialin merged pull request #805: [IOTDB-466] group by device -> align by 
device && group by time range [] -> [)
URL: https://github.com/apache/incubator-iotdb/pull/805
 
 
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #804: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #804: [IOTDB-467] The CLI 
displays query results in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/804#discussion_r379712446
 
 

 ##
 File path: client/src/main/java/org/apache/iotdb/client/AbstractClient.java
 ##
 @@ -532,45 +539,61 @@ private static void executeQuery(IoTDBConnection 
connection, String cmd) {
 println(String.format("It costs %.3fs", costTime / 1000.0));
   }
 
+  private static void printNextBatchResult(ZoneId zoneId, ResultSet resultSet,
+  ResultSetMetaData resultSetMetaData, int columnLength, List 
maxSizeList,
+  int preLinesCount)
+  throws SQLException {
+maxSizeList.clear();
+List> lists = cacheResult(resultSet, maxSizeList, 
columnLength,
+resultSetMetaData, zoneId);
+output(lists, maxSizeList);
+if (isReachMaxLine) {
+  println(String.format("Reach maxPrintRowCount = %s lines, enter q to 
exit, other to continue",
 
 Review comment:
   ```suggestion
 println(String.format("Printed %s lines, enter q to exit, other to 
continue",
   ```


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] Genius-pig commented on issue #806: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
Genius-pig commented on issue #806: [IOTDB-467] The CLI displays query results 
in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/806#issuecomment-586541839
 
 
   Thank you for your contribution. But it has been done by 
https://github.com/apache/incubator-iotdb/pull/804


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] dynamicDr opened a new pull request #806: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
dynamicDr opened a new pull request #806: [IOTDB-467] The CLI displays query 
results in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/806
 
 
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request #804: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
Genius-pig commented on a change in pull request #804: [IOTDB-467] The CLI 
displays query results in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/804#discussion_r379493282
 
 

 ##
 File path: client/src/main/java/org/apache/iotdb/client/AbstractClient.java
 ##
 @@ -532,45 +539,61 @@ private static void executeQuery(IoTDBConnection 
connection, String cmd) {
 println(String.format("It costs %.3fs", costTime / 1000.0));
   }
 
+  private static void printNextBatchResult(ZoneId zoneId, ResultSet resultSet,
+  ResultSetMetaData resultSetMetaData, int columnLength, List 
maxSizeList,
+  int preLinesCount)
+  throws SQLException {
+maxSizeList.clear();
+List> lists = cacheResult(resultSet, maxSizeList, 
columnLength,
+resultSetMetaData, zoneId);
+output(lists, maxSizeList);
+if (isReachMaxLine) {
+  println(String.format("Reach maxPrintRowCount = %s lines, enter q to 
exit, other to continue",
+  maxPrintRowCount));
+}
+printCount(preLinesCount + lists.get(0).size() - 1);
+  }
+
   /**
* cache all results
-   * @param resultSet jdbc resultSet
-   * @param maxSizeList the longest result of every column
-   * @param columnCount the number of column
+   *
+   * @param resultSet jdbc resultSet
+   * @param maxSizeList   the longest result of every column
+   * @param columnCount   the number of column
* @param resultSetMetaData jdbc resultSetMetaData
-   * @param zoneId your time zone
-   * @return List> result
+   * @param zoneIdyour time zone
+   * @return List> result
* @throws SQLException throw exception
*/
   private static List> cacheResult(ResultSet resultSet, 
List maxSizeList,
   int columnCount, ResultSetMetaData resultSetMetaData, ZoneId zoneId)
   throws SQLException {
 boolean printTimestamp = !((IoTDBQueryResultSet) 
resultSet).isIgnoreTimeStamp();
 List> lists = new ArrayList<>(columnCount);
-for(int i = 1; i <= columnCount; i++) {
-  List list = new ArrayList<>(1001);
 
 Review comment:
   change it to 1001 or maxPrintRowCount + 1. It has one more line that is name 
header row.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805#issuecomment-586321013
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805#issuecomment-586337749
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #777: [IoTDB-400] Support rest api

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #777: [IoTDB-400] Support rest api
URL: https://github.com/apache/incubator-iotdb/pull/777#issuecomment-586330493
 
 
   SonarCloud Quality Gate failed.
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [1 
Bug](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 [1 Security 
Hotspot](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [37 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
 [2.7% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #777: [IoTDB-400] Support rest api

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #777: [IoTDB-400] Support rest api
URL: https://github.com/apache/incubator-iotdb/pull/777#issuecomment-586296305
 
 
   SonarCloud Quality Gate failed.
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [1 
Bug](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 [1 Security 
Hotspot](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [37 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
 [2.7% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805#issuecomment-586317081
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805#issuecomment-586321013
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805#issuecomment-586311376
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805#issuecomment-586317081
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805#issuecomment-586311376
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=805=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=805=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] Genius-pig opened a new pull request #805: [IOTDB-466] Modify sql grammar

2020-02-14 Thread GitBox
Genius-pig opened a new pull request #805: [IOTDB-466] Modify sql grammar
URL: https://github.com/apache/incubator-iotdb/pull/805
 
 
   https://issues.apache.org/jira/projects/IOTDB/issues/IOTDB-466


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #777: [IoTDB-400] Support rest api

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #777: [IoTDB-400] Support rest api
URL: https://github.com/apache/incubator-iotdb/pull/777#issuecomment-586296305
 
 
   SonarCloud Quality Gate failed.
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [1 
Bug](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 [1 Security 
Hotspot](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [37 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
 [2.7% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #777: [IoTDB-400] Support rest api

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #777: [IoTDB-400] Support rest api
URL: https://github.com/apache/incubator-iotdb/pull/777#issuecomment-585136217
 
 
   SonarCloud Quality Gate failed.
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
 [27 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=777=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
 [3.3% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=777=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #713: [IOTDB-418] New series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#issuecomment-586054107
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [17 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #713: [IOTDB-418] New series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#issuecomment-586290103
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
 [18 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=713=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=713=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #793: [IOTDB-274] Refactor MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#issuecomment-586284847
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [5 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #793: [IOTDB-274] Refactor MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#issuecomment-586179052
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [3 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin merged pull request #803: [IoTDB-475] Improve the logic of AlignByDevicePlan in PhysicalGenerator

2020-02-14 Thread GitBox
qiaojialin merged pull request #803: [IoTDB-475] Improve the logic of 
AlignByDevicePlan in PhysicalGenerator
URL: https://github.com/apache/incubator-iotdb/pull/803
 
 
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] liutaohua opened a new pull request #804: [IOTDB-467] The CLI displays query results in a batch manner

2020-02-14 Thread GitBox
liutaohua opened a new pull request #804: [IOTDB-467] The CLI displays query 
results in a batch manner
URL: https://github.com/apache/incubator-iotdb/pull/804
 
 
   If the query result set has too many lines. Each time CLI prints 1000 lines 
and waits for the command of the user. If the user enters an "ENTER", the CLI 
prints another 1000 line. If the user enters a "q", the CLI stop to print the 
Result and wait for the next command.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379419319
 
 

 ##
 File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
 ##
 @@ -50,131 +52,127 @@
 public class MTree implements Serializable {
 
   private static final long serialVersionUID = -4200394435237291964L;
-  private static final String PATH_SEPARATOR = "\\.";
-  private static final String NO_CHILD_ERROR = "Node [%s] doesn't have child 
named: [%s]";
-  private static final String NOT_LEAF_NODE = "is NOT the leaf node";
   private MNode root;
+  /**
+   * dummy node is used for the default param of traverse methods
+   */
+  private MNode dummyNode;
 
   MTree(String rootName) {
 this.root = new MNode(rootName, null, false);
+this.dummyNode = new MNode("dummy", null, false);
   }
 
   /**
-   * function for adding timeseries.It should check whether seriesPath exists.
-   */
-  void addTimeseriesPath(String timeseriesPath, TSDataType dataType, 
TSEncoding encoding,
-  CompressionType compressor, Map props) throws 
PathException {
-String[] nodeNames = MetaUtils.getNodeNames(timeseriesPath, 
PATH_SEPARATOR);
+   * Add timeseries path
+   *
+   * @param path timeseries path
+   * @param dataType data type
+   * @param encoding encoding
+   * @param compressor compressor
+   * @param props props
+   */
+  void addPath(String path, TSDataType dataType, TSEncoding encoding,
+  CompressionType compressor, Map props) throws 
MetadataException {
+String[] nodeNames = MetaUtils.getNodeNames(path);
 if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {
-  throw new MTreePathException("Timeseries", timeseriesPath);
+  throw new IllegalPathException(path);
 }
-MNode cur = findLeafParent(nodeNames);
-String levelPath = cur.getDataFileName();
+MNode cur = getParent(nodeNames);
+String storageGroupName = cur.getStorageGroupName();
 
 MNode leaf = new MNode(nodeNames[nodeNames.length - 1], cur, dataType, 
encoding, compressor);
 if (props != null && !props.isEmpty()) {
   leaf.getSchema().setProps(props);
 }
-leaf.setDataFileName(levelPath);
+leaf.setStorageGroupName(storageGroupName);
 if (cur.isLeaf()) {
-  throw new MTreePathException(timeseriesPath, "can't be created",
-  String.format("node [%s] is left node", cur.getName()));
+  throw new PathAlreadyExistException(cur.getFullPath());
 }
 cur.addChild(nodeNames[nodeNames.length - 1], leaf);
   }
 
   /**
-   * function for adding deviceId
+   * Add device to MTree. This is available IF and ONLY IF creating schema 
automatically is enabled
+   *
+   * @param deviceId device id
*/
-  MNode addDeviceId(String deviceId) throws PathException {
-String[] nodeNames = MetaUtils.getNodeNames(deviceId, PATH_SEPARATOR);
+  MNode addDevice(String deviceId) throws MetadataException {
+String[] nodeNames = MetaUtils.getNodeNames(deviceId);
 if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {
-  throw new MTreePathException("Timeseries", deviceId);
+  throw new IllegalPathException(deviceId);
 }
-MNode cur = getRoot();
+MNode cur = root;
 for (int i = 1; i < nodeNames.length; i++) {
-  if (!cur.hasChild(nodeNames[i])) {
+  if (!cur.hasChildWithKey(nodeNames[i])) {
 cur.addChild(nodeNames[i], new MNode(nodeNames[i], cur, false));
   }
   cur = cur.getChild(nodeNames[i]);
 }
 return cur;
   }
 
-  private MNode findLeafParent(String[] nodeNames) throws PathException {
+  /**
+   * Get nodes parent
+   *
+   * @param nodeNames node names
+   */
+  private MNode getParent(String[] nodeNames) throws MetadataException {
 
 Review comment:
   Actually I don't think it changes the tree structure, for it only addChild 
when current node doesn't have child with the node name 
(`!cur.hasChildWithKey(nodeName)`). But I combine codes in this method into the 
`addPath` method to avoid misunderstandings of `parent`.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #802: Cached chunk

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#issuecomment-586270989
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=802)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=802=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=802=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #802: Cached chunk

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#issuecomment-586095283
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=802=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=802)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=802=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=802=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] JackieTien97 commented on a change in pull request #802: Cached chunk

2020-02-14 Thread GitBox
JackieTien97 commented on a change in pull request #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#discussion_r379385458
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkCache.java
 ##
 @@ -0,0 +1,153 @@
+/*
+ * 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.db.engine.cache;
+
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * This class is used to cache Chunk of 
ChunkMetaData in IoTDB. The caching
+ * strategy is LRU.
+ */
+public class ChunkCache {
+
+  private static final Logger logger = 
LoggerFactory.getLogger(ChunkCache.class);
+  private static final IoTDBConfig config = 
IoTDBDescriptor.getInstance().getConfig();
+  private static final long MEMORY_THRESHOLD_IN_CHUNK_CACHE = 
config.getAllocateMemoryForChunkCache();
+  private static boolean cacheEnable = config.isMetaDataCacheEnable();
+
+  private final LRULinkedHashMap lruCache;
+
+  private AtomicLong cacheHitNum = new AtomicLong();
+  private AtomicLong cacheRequestNum = new AtomicLong();
+
+  private final ReadWriteLock lock = new ReentrantReadWriteLock();
+  private final Lock readLock = lock.readLock();
+  private final Lock writeLock = lock.writeLock();
+
+
+  private ChunkCache() {
+lruCache = new LRULinkedHashMap(MEMORY_THRESHOLD_IN_CHUNK_CACHE, true) {
+  @Override
+  protected long calEntrySize(ChunkMetaData key, Chunk value) {
+return RamUsageEstimator.sizeOf(value) + 
RamUsageEstimator.sizeOf(value);
 
 Review comment:
   it's a typo, should be RamUsageEstimator.sizeOf(key) + 
RamUsageEstimator.sizeOf(value);
   Fixed


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] liutaohua commented on a change in pull request #802: Cached chunk

2020-02-14 Thread GitBox
liutaohua commented on a change in pull request #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#discussion_r379348602
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkCache.java
 ##
 @@ -0,0 +1,153 @@
+/*
+ * 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.db.engine.cache;
+
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * This class is used to cache Chunk of 
ChunkMetaData in IoTDB. The caching
+ * strategy is LRU.
+ */
+public class ChunkCache {
+
+  private static final Logger logger = 
LoggerFactory.getLogger(ChunkCache.class);
+  private static final IoTDBConfig config = 
IoTDBDescriptor.getInstance().getConfig();
+  private static final long MEMORY_THRESHOLD_IN_CHUNK_CACHE = 
config.getAllocateMemoryForChunkCache();
+  private static boolean cacheEnable = config.isMetaDataCacheEnable();
+
+  private final LRULinkedHashMap lruCache;
+
+  private AtomicLong cacheHitNum = new AtomicLong();
+  private AtomicLong cacheRequestNum = new AtomicLong();
+
+  private final ReadWriteLock lock = new ReentrantReadWriteLock();
+  private final Lock readLock = lock.readLock();
+  private final Lock writeLock = lock.writeLock();
+
+
+  private ChunkCache() {
+lruCache = new LRULinkedHashMap(MEMORY_THRESHOLD_IN_CHUNK_CACHE, true) {
+  @Override
+  protected long calEntrySize(ChunkMetaData key, Chunk value) {
+return RamUsageEstimator.sizeOf(value) + 
RamUsageEstimator.sizeOf(value);
+  }
+};
+  }
+
+  public static ChunkCache getInstance() {
+return ChunkCacheHolder.INSTANCE;
+  }
+
+  public Chunk get(ChunkMetaData chunkMetaData, TsFileSequenceReader reader) 
throws IOException {
+if (!cacheEnable) {
+  Chunk chunk = reader.readMemChunk(chunkMetaData);
+  return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
+}
+
+cacheRequestNum.incrementAndGet();
+
+try {
+  readLock.lock();
+  if (lruCache.containsKey(chunkMetaData)) {
+cacheHitNum.incrementAndGet();
+printCacheLog(true);
+Chunk chunk = lruCache.get(chunkMetaData);
+return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
+  }
+} finally {
+  readLock.unlock();
+}
+
+writeLock.lock();
+if (lruCache.containsKey(chunkMetaData)) {
+  writeLock.unlock();
 
 Review comment:
   Why not down the lock to readLock directly


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] liutaohua commented on a change in pull request #802: Cached chunk

2020-02-14 Thread GitBox
liutaohua commented on a change in pull request #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#discussion_r379350858
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/query/reader/chunk/DiskChunkLoader.java
 ##
 @@ -0,0 +1,52 @@
+/*
+ * 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.db.query.reader.chunk;
+
+import org.apache.iotdb.db.engine.cache.ChunkCache;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.apache.iotdb.tsfile.read.controller.IChunkLoader;
+
+import java.io.IOException;
+
+public class DiskChunkLoader implements IChunkLoader {
+
+  private final TsFileSequenceReader reader;
+
+  public DiskChunkLoader(TsFileSequenceReader reader) {
+this.reader = reader;
+  }
+
+  @Override
+  public Chunk getChunk(ChunkMetaData chunkMetaData) throws IOException {
+return ChunkCache.getInstance().get(chunkMetaData, reader);
+  }
+
+  @Override
+  public void close() throws IOException {
+reader.close();
+  }
+
+  @Override
+  public void clear() {
+// no cache need clear
 
 Review comment:
   i think , this method can delete for  interface, neither memChunk nor 
diskChunk don't need to clear ,and the cache is  LRU 


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] liutaohua commented on a change in pull request #802: Cached chunk

2020-02-14 Thread GitBox
liutaohua commented on a change in pull request #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#discussion_r379346380
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkCache.java
 ##
 @@ -0,0 +1,153 @@
+/*
+ * 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.db.engine.cache;
+
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * This class is used to cache Chunk of 
ChunkMetaData in IoTDB. The caching
+ * strategy is LRU.
+ */
+public class ChunkCache {
+
+  private static final Logger logger = 
LoggerFactory.getLogger(ChunkCache.class);
+  private static final IoTDBConfig config = 
IoTDBDescriptor.getInstance().getConfig();
+  private static final long MEMORY_THRESHOLD_IN_CHUNK_CACHE = 
config.getAllocateMemoryForChunkCache();
+  private static boolean cacheEnable = config.isMetaDataCacheEnable();
+
+  private final LRULinkedHashMap lruCache;
+
+  private AtomicLong cacheHitNum = new AtomicLong();
+  private AtomicLong cacheRequestNum = new AtomicLong();
+
+  private final ReadWriteLock lock = new ReentrantReadWriteLock();
+  private final Lock readLock = lock.readLock();
+  private final Lock writeLock = lock.writeLock();
+
+
+  private ChunkCache() {
+lruCache = new LRULinkedHashMap(MEMORY_THRESHOLD_IN_CHUNK_CACHE, true) {
+  @Override
+  protected long calEntrySize(ChunkMetaData key, Chunk value) {
+return RamUsageEstimator.sizeOf(value) + 
RamUsageEstimator.sizeOf(value);
 
 Review comment:
   why this return valueSize * 2 ? 


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] liutaohua commented on a change in pull request #802: Cached chunk

2020-02-14 Thread GitBox
liutaohua commented on a change in pull request #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#discussion_r379348602
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkCache.java
 ##
 @@ -0,0 +1,153 @@
+/*
+ * 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.db.engine.cache;
+
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * This class is used to cache Chunk of 
ChunkMetaData in IoTDB. The caching
+ * strategy is LRU.
+ */
+public class ChunkCache {
+
+  private static final Logger logger = 
LoggerFactory.getLogger(ChunkCache.class);
+  private static final IoTDBConfig config = 
IoTDBDescriptor.getInstance().getConfig();
+  private static final long MEMORY_THRESHOLD_IN_CHUNK_CACHE = 
config.getAllocateMemoryForChunkCache();
+  private static boolean cacheEnable = config.isMetaDataCacheEnable();
+
+  private final LRULinkedHashMap lruCache;
+
+  private AtomicLong cacheHitNum = new AtomicLong();
+  private AtomicLong cacheRequestNum = new AtomicLong();
+
+  private final ReadWriteLock lock = new ReentrantReadWriteLock();
+  private final Lock readLock = lock.readLock();
+  private final Lock writeLock = lock.writeLock();
+
+
+  private ChunkCache() {
+lruCache = new LRULinkedHashMap(MEMORY_THRESHOLD_IN_CHUNK_CACHE, true) {
+  @Override
+  protected long calEntrySize(ChunkMetaData key, Chunk value) {
+return RamUsageEstimator.sizeOf(value) + 
RamUsageEstimator.sizeOf(value);
+  }
+};
+  }
+
+  public static ChunkCache getInstance() {
+return ChunkCacheHolder.INSTANCE;
+  }
+
+  public Chunk get(ChunkMetaData chunkMetaData, TsFileSequenceReader reader) 
throws IOException {
+if (!cacheEnable) {
+  Chunk chunk = reader.readMemChunk(chunkMetaData);
+  return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
+}
+
+cacheRequestNum.incrementAndGet();
+
+try {
+  readLock.lock();
+  if (lruCache.containsKey(chunkMetaData)) {
+cacheHitNum.incrementAndGet();
+printCacheLog(true);
+Chunk chunk = lruCache.get(chunkMetaData);
+return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
+  }
+} finally {
+  readLock.unlock();
+}
+
+writeLock.lock();
+if (lruCache.containsKey(chunkMetaData)) {
+  writeLock.unlock();
 
 Review comment:
   Why not down the lock to readLock


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] commented on issue #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
sonarcloud[bot] commented on issue #793: [IOTDB-274] Refactor MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#issuecomment-586179052
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [3 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on issue #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
sonarcloud[bot] removed a comment on issue #793: [IOTDB-274] Refactor MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#issuecomment-586091974
 
 
   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
 [4 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb=793=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793)
 No Coverage information  
   [](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb=793=new_duplicated_lines_density=list)
   
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] Alima777 opened a new pull request #803: [IoTDB-475] Improve the logic of AlignByDevicePlan in PhysicalGenerator

2020-02-14 Thread GitBox
Alima777 opened a new pull request #803: [IoTDB-475] Improve the logic of 
AlignByDevicePlan in PhysicalGenerator
URL: https://github.com/apache/incubator-iotdb/pull/803
 
 
   


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #802: Cached chunk

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#discussion_r379263035
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkCache.java
 ##
 @@ -0,0 +1,153 @@
+/*
+ * 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.db.engine.cache;
+
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * This class is used to cache Chunk of 
ChunkMetaData in IoTDB. The caching
+ * strategy is LRU.
+ */
+public class ChunkCache {
+
+  private static final Logger logger = 
LoggerFactory.getLogger(ChunkCache.class);
+  private static final IoTDBConfig config = 
IoTDBDescriptor.getInstance().getConfig();
+  private static final long MEMORY_THRESHOLD_IN_CHUNK_CACHE = 
config.getAllocateMemoryForChunkCache();
+  private static boolean cacheEnable = config.isMetaDataCacheEnable();
+
+  private final LRULinkedHashMap lruCache;
+
+  private AtomicLong cacheHitNum = new AtomicLong();
+  private AtomicLong cacheRequestNum = new AtomicLong();
+
+  private final ReadWriteLock lock = new ReentrantReadWriteLock();
+  private final Lock readLock = lock.readLock();
+  private final Lock writeLock = lock.writeLock();
+
+
+  private ChunkCache() {
+lruCache = new LRULinkedHashMap(MEMORY_THRESHOLD_IN_CHUNK_CACHE, true) {
+  @Override
+  protected long calEntrySize(ChunkMetaData key, Chunk value) {
+return RamUsageEstimator.sizeOf(value) + 
RamUsageEstimator.sizeOf(value);
+  }
+};
+  }
+
+  public static ChunkCache getInstance() {
+return ChunkCacheHolder.INSTANCE;
+  }
+
+  public Chunk get(ChunkMetaData chunkMetaData, TsFileSequenceReader reader) 
throws IOException {
+if (!cacheEnable) {
+  Chunk chunk = reader.readMemChunk(chunkMetaData);
+  return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
 
 Review comment:
   why new a Chunk?


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #802: Cached chunk

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #802: Cached chunk
URL: https://github.com/apache/incubator-iotdb/pull/802#discussion_r379263215
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkCache.java
 ##
 @@ -0,0 +1,153 @@
+/*
+ * 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.db.engine.cache;
+
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * This class is used to cache Chunk of 
ChunkMetaData in IoTDB. The caching
+ * strategy is LRU.
+ */
+public class ChunkCache {
+
+  private static final Logger logger = 
LoggerFactory.getLogger(ChunkCache.class);
+  private static final IoTDBConfig config = 
IoTDBDescriptor.getInstance().getConfig();
+  private static final long MEMORY_THRESHOLD_IN_CHUNK_CACHE = 
config.getAllocateMemoryForChunkCache();
+  private static boolean cacheEnable = config.isMetaDataCacheEnable();
+
+  private final LRULinkedHashMap lruCache;
+
+  private AtomicLong cacheHitNum = new AtomicLong();
+  private AtomicLong cacheRequestNum = new AtomicLong();
+
+  private final ReadWriteLock lock = new ReentrantReadWriteLock();
+  private final Lock readLock = lock.readLock();
+  private final Lock writeLock = lock.writeLock();
+
+
+  private ChunkCache() {
+lruCache = new LRULinkedHashMap(MEMORY_THRESHOLD_IN_CHUNK_CACHE, true) {
+  @Override
+  protected long calEntrySize(ChunkMetaData key, Chunk value) {
+return RamUsageEstimator.sizeOf(value) + 
RamUsageEstimator.sizeOf(value);
+  }
+};
+  }
+
+  public static ChunkCache getInstance() {
+return ChunkCacheHolder.INSTANCE;
+  }
+
+  public Chunk get(ChunkMetaData chunkMetaData, TsFileSequenceReader reader) 
throws IOException {
+if (!cacheEnable) {
+  Chunk chunk = reader.readMemChunk(chunkMetaData);
+  return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
+}
+
+cacheRequestNum.incrementAndGet();
+
+try {
+  readLock.lock();
+  if (lruCache.containsKey(chunkMetaData)) {
+cacheHitNum.incrementAndGet();
+printCacheLog(true);
+Chunk chunk = lruCache.get(chunkMetaData);
+return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
+  }
+} finally {
+  readLock.unlock();
+}
+
+writeLock.lock();
+if (lruCache.containsKey(chunkMetaData)) {
+  writeLock.unlock();
+  readLock.lock();
+  cacheHitNum.incrementAndGet();
+  printCacheLog(true);
+  Chunk chunk = lruCache.get(chunkMetaData);
+  readLock.unlock();
+  return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
+}
+printCacheLog(false);
+Chunk chunk = reader.readMemChunk(chunkMetaData);
+lruCache.put(chunkMetaData, chunk);
+writeLock.unlock();
+return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt(), reader.getEndianType());
 
 Review comment:
   ```suggestion
   return chunk;
   ```


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379304738
 
 

 ##
 File path: 
server/src/test/java/org/apache/iotdb/db/qp/plan/TestConcatOptimizer.java
 ##
 @@ -52,7 +52,7 @@
   public void before() throws MetadataException, PathException {
 processor = new Planner();
 MManager.getInstance().init();
 
 Review comment:
   Fixed.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379304738
 
 

 ##
 File path: 
server/src/test/java/org/apache/iotdb/db/qp/plan/TestConcatOptimizer.java
 ##
 @@ -52,7 +52,7 @@
   public void before() throws MetadataException, PathException {
 processor = new Planner();
 MManager.getInstance().init();
 
 Review comment:
   Fix.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379304264
 
 

 ##
 File path: server/src/main/java/org/apache/iotdb/db/metadata/MNode.java
 ##
 @@ -36,29 +36,47 @@
 
   private static final long serialVersionUID = -770028375899514063L;
 
-  // The name of the MNode
+  /**
+   * Name of the MNode
+   */
   private String name;
-  // Whether current node is a leaf in the Metadata Tree
+
+  /**
+   * Whether current node is a leaf in the Metadata Tree
+   */
   private boolean isLeaf;
-  // Whether current node is Storage group in the Metadata Tree
+
+  /**
+   * Whether current node is Storage group in the Metadata Tree
+   */
   private boolean isStorageGroup;
-  // Map for the schema in this storage group
+
+  /**
+   * Map for the schema in this storage group
+   */
   private Map schemaMap;
+
   private Map numSchemaMap;
 
 Review comment:
   It was used for `addPath` and `deletePath` in MManager... but is truly 
useless now. Deleted.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
samperson1997 commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379302495
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/exception/metadata/RootNotExistException.java
 ##
 @@ -15,16 +15,16 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-package org.apache.iotdb.db.exception.storageGroup;
+package org.apache.iotdb.db.exception.metadata;
 
-public class StorageGroupPathException extends StorageGroupException {
+public class RootNotExistException extends MetadataException {
 
 Review comment:
   This method used to call `StorageGroupPathException` because it shows the 
storage group doesn't exist, but in the **cluster** branch, it is renamed to be 
thrown when the `root` node is wrong. For example when users enter 
`rooot.vehicle.d0`, he will get this error.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r378086773
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/memtable/TimeValuePairSorter.java
 ##
 @@ -21,7 +21,7 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.TimeValuePair;
 
 public interface TimeValuePairSorter {
 
 Review comment:
   This class is unused. Remove it or give an explanation.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r379260445
 
 

 ##
 File path: 
server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationIT.java
 ##
 @@ -508,6 +509,57 @@ public void avgSumErrorTest() throws SQLException {
 }
   }
 
+  /**
+   * test aggregation query with more than one functions on one series
+   */
+  @Test
+  public void mergeAggrOnOneSeriesTest() {
 
 Review comment:
   Maybe we need more tests here. Consider the order of columns, mergeable or 
unmergeable columns. Such as following sql:
"SELECT sum(s0), count(s0), avg(s2), avg(s0) FROM root.vehicle.d0 WHERE 
time >= 6000 AND time <= 9000"
"SELECT sum(s2), count(s0), avg(s2), avg(s1), count(s2),sum(s0) FROM 
root.vehicle.d0 WHERE time >= 6000 AND time <= 9000"


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r378084647
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/query/aggregation/AggregateResult.java
 ##
 @@ -0,0 +1,212 @@
+/*
+ * 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.db.query.aggregation;
+
+import org.apache.iotdb.db.exception.query.QueryProcessException;
+import org.apache.iotdb.db.query.reader.series.IReaderByTimestamp;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.utils.Binary;
+
+import java.io.IOException;
+
+public abstract class AggregateResult {
+
+  protected TSDataType dataType;
+
+  private boolean booleanRet;
 
 Review comment:
   May be we should use result rather than Ret. When I first look at this name, 
I think it is return rather than result


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r376837938
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/query/reader/series/SeriesReader.java
 ##
 @@ -0,0 +1,444 @@
+/*
+ * 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.db.query.reader.series;
+
+import org.apache.iotdb.db.engine.cache.DeviceMetaDataCache;
+import org.apache.iotdb.db.engine.modification.Modification;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
+import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
+import org.apache.iotdb.db.query.context.QueryContext;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.query.reader.chunk.MemChunkLoader;
+import org.apache.iotdb.db.query.reader.chunk.MemChunkReader;
+import org.apache.iotdb.db.query.reader.universal.PriorityMergeReader;
+import org.apache.iotdb.db.utils.QueryUtils;
+import org.apache.iotdb.db.utils.TestOnly;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.TimeValuePair;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.controller.ChunkLoaderImpl;
+import org.apache.iotdb.tsfile.read.controller.IChunkLoader;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.reader.IChunkReader;
+import org.apache.iotdb.tsfile.read.reader.IPageReader;
+import org.apache.iotdb.tsfile.read.reader.chunk.ChunkReader;
+
+import java.io.IOException;
+import java.util.*;
+
+public class SeriesReader {
+
+  private final Path seriesPath;
+  private final TSDataType dataType;
+  private final QueryContext context;
+  private final Filter timeFilter;
+  private final Filter valueFilter;
+
+  private final List seqFileResource;
+  private final PriorityQueue unseqFileResource;
+
+  private final List seqChunkMetadatas = new LinkedList<>();
+  private final PriorityQueue unseqChunkMetadatas =
+  new 
PriorityQueue<>(Comparator.comparingLong(ChunkMetaData::getStartTime));
+
+  private boolean hasCachedFirstChunkMetadata;
+  private ChunkMetaData firstChunkMetaData;
+
+  private PriorityQueue> overlappedPageReaders =
+  new PriorityQueue<>(
+  Comparator.comparingLong(pageReader -> 
pageReader.data.getStatistics().getStartTime()));
+
+  private PriorityMergeReader mergeReader = new PriorityMergeReader();
+
+  private boolean hasCachedNextBatch;
+  private BatchData cachedBatchData;
+
+
+  public SeriesReader(Path seriesPath, TSDataType dataType, QueryContext 
context,
+  QueryDataSource dataSource, Filter timeFilter, Filter valueFilter) {
+this.seriesPath = seriesPath;
+this.dataType = dataType;
+this.context = context;
+this.seqFileResource = dataSource.getSeqResources();
+this.unseqFileResource = 
sortUnSeqFileResources(dataSource.getUnseqResources());
+this.timeFilter = timeFilter;
+this.valueFilter = valueFilter;
+  }
+
+  @TestOnly
+  public SeriesReader(Path seriesPath, TSDataType dataType, QueryContext 
context,
+  List seqFileResource, List 
unseqFileResource,
+  Filter timeFilter, Filter valueFilter) {
+this.seriesPath = seriesPath;
+this.dataType = dataType;
+this.context = context;
+this.seqFileResource = seqFileResource;
+this.unseqFileResource = sortUnSeqFileResources(unseqFileResource);
+this.timeFilter = timeFilter;
+this.valueFilter = valueFilter;
+  }
+
+
+  public boolean hasNextChunk() throws IOException {
+if (hasCachedFirstChunkMetadata) {
+  return true;
+}
+// init first chunk metadata whose startTime is minimum
+tryToInitFirstChunk();
+
+return 

[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r377997898
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/query/reader/series/SeriesReader.java
 ##
 @@ -0,0 +1,444 @@
+/*
+ * 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.db.query.reader.series;
+
+import org.apache.iotdb.db.engine.cache.DeviceMetaDataCache;
+import org.apache.iotdb.db.engine.modification.Modification;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
+import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
+import org.apache.iotdb.db.query.context.QueryContext;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.query.reader.chunk.MemChunkLoader;
+import org.apache.iotdb.db.query.reader.chunk.MemChunkReader;
+import org.apache.iotdb.db.query.reader.universal.PriorityMergeReader;
+import org.apache.iotdb.db.utils.QueryUtils;
+import org.apache.iotdb.db.utils.TestOnly;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.TimeValuePair;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.controller.ChunkLoaderImpl;
+import org.apache.iotdb.tsfile.read.controller.IChunkLoader;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.reader.IChunkReader;
+import org.apache.iotdb.tsfile.read.reader.IPageReader;
+import org.apache.iotdb.tsfile.read.reader.chunk.ChunkReader;
+
+import java.io.IOException;
+import java.util.*;
+
+public class SeriesReader {
+
+  private final Path seriesPath;
+  private final TSDataType dataType;
+  private final QueryContext context;
+  private final Filter timeFilter;
+  private final Filter valueFilter;
+
+  private final List seqFileResource;
+  private final PriorityQueue unseqFileResource;
+
+  private final List seqChunkMetadatas = new LinkedList<>();
+  private final PriorityQueue unseqChunkMetadatas =
+  new 
PriorityQueue<>(Comparator.comparingLong(ChunkMetaData::getStartTime));
+
+  private boolean hasCachedFirstChunkMetadata;
+  private ChunkMetaData firstChunkMetaData;
+
+  private PriorityQueue> overlappedPageReaders =
+  new PriorityQueue<>(
+  Comparator.comparingLong(pageReader -> 
pageReader.data.getStatistics().getStartTime()));
+
+  private PriorityMergeReader mergeReader = new PriorityMergeReader();
+
+  private boolean hasCachedNextBatch;
+  private BatchData cachedBatchData;
+
+
+  public SeriesReader(Path seriesPath, TSDataType dataType, QueryContext 
context,
+  QueryDataSource dataSource, Filter timeFilter, Filter valueFilter) {
+this.seriesPath = seriesPath;
+this.dataType = dataType;
+this.context = context;
+this.seqFileResource = dataSource.getSeqResources();
+this.unseqFileResource = 
sortUnSeqFileResources(dataSource.getUnseqResources());
+this.timeFilter = timeFilter;
+this.valueFilter = valueFilter;
+  }
+
+  @TestOnly
+  public SeriesReader(Path seriesPath, TSDataType dataType, QueryContext 
context,
+  List seqFileResource, List 
unseqFileResource,
+  Filter timeFilter, Filter valueFilter) {
+this.seriesPath = seriesPath;
+this.dataType = dataType;
+this.context = context;
+this.seqFileResource = seqFileResource;
+this.unseqFileResource = sortUnSeqFileResources(unseqFileResource);
+this.timeFilter = timeFilter;
+this.valueFilter = valueFilter;
+  }
+
+
+  public boolean hasNextChunk() throws IOException {
+if (hasCachedFirstChunkMetadata) {
+  return true;
+}
+// init first chunk metadata whose startTime is minimum
+tryToInitFirstChunk();
+
+return 

[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r378085873
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/memtable/TimeValuePairInMemTable.java
 ##
 @@ -20,7 +20,7 @@
 
 import java.util.Objects;
 
-import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.TimeValuePair;
 import org.apache.iotdb.tsfile.utils.TsPrimitiveType;
 
 public class TimeValuePairInMemTable extends TimeValuePair {
 
 Review comment:
   I have a question. Why we need this class? This class's methods are 
identical with TimeValuePair. Could we just use TimeValuePair?


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r378088994
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/query/aggregation/impl/AvgAggrResult.java
 ##
 @@ -0,0 +1,119 @@
+/*
+ * 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.db.query.aggregation.impl;
+
+import java.io.IOException;
+import org.apache.iotdb.db.query.aggregation.AggregateResult;
+import org.apache.iotdb.db.query.reader.series.IReaderByTimestamp;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+
+public class AvgAggrResult extends AggregateResult {
+
+  private static final String AVG_AGGR_NAME = "AVG";
+  private TSDataType seriesDataType;
+  protected double sum = 0.0;
+  protected int cnt = 0;
+
+  public AvgAggrResult(TSDataType seriesDataType) {
+super(TSDataType.DOUBLE);
+this.seriesDataType = seriesDataType;
+reset();
+sum = 0.0;
+cnt = 0;
+  }
+
+  @Override
+  public Double getResult() {
+if (cnt > 0) {
+  setDoubleRet(sum / cnt);
+}
+return hasResult() ? getDoubleRet() : null;
+  }
+
+  @Override
+  public void updateResultFromStatistics(Statistics statistics) {
+cnt += statistics.getCount();
+sum += statistics.getSumValue();
+  }
+
+  @Override
+  public void updateResultFromPageData(BatchData dataInThisPage) throws 
IOException {
+updateResultFromPageData(dataInThisPage, Long.MAX_VALUE);
+  }
+
+  @Override
+  public void updateResultFromPageData(BatchData dataInThisPage, long bound) 
throws IOException {
+while (dataInThisPage.hasCurrent()) {
+  if (dataInThisPage.currentTime() >= bound) {
+break;
+  }
+  updateAvg(seriesDataType, dataInThisPage.currentValue());
+  dataInThisPage.next();
+}
+  }
+
+  @Override
+  public void updateResultUsingTimestamps(long[] timestamps, int length,
+  IReaderByTimestamp dataReader) throws IOException {
+for (int i = 0; i < length; i++) {
+  Object value = dataReader.getValueInTimestamp(timestamps[i]);
+  if (value != null) {
+updateAvg(seriesDataType, value);
+  }
+}
+  }
+
+  private void updateAvg(TSDataType type, Object sumVal) throws IOException {
 
 Review comment:
   The sum value here may overflow when we query large number of data. May be 
we should use this method to update:
   ```
   avg(n + 1) = avg(n) * (n / n + 1) + (1 / n + 1) * val(n + 1)
   ```


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New series reader

2020-02-14 Thread GitBox
SilverNarcissus commented on a change in pull request #713: [IOTDB-418] New 
series reader
URL: https://github.com/apache/incubator-iotdb/pull/713#discussion_r378827014
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/query/reader/chunk/MemChunkReader.java
 ##
 @@ -112,12 +116,9 @@ public void close() {
   }
 
   @Override
-  public PageHeader nextPageHeader() throws IOException {
-return null;
+  public List getPageReaderList() throws IOException {
+return Collections.singletonList(
+new MemPageReader(nextPageData(), 
readOnlyMemChunk.getChunkMetaData().getStatistics()));
 
 Review comment:
   Why we can just put chunk statistics into page reader?


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379280325
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/exception/metadata/RootNotExistException.java
 ##
 @@ -15,16 +15,16 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-package org.apache.iotdb.db.exception.storageGroup;
+package org.apache.iotdb.db.exception.metadata;
 
-public class StorageGroupPathException extends StorageGroupException {
+public class RootNotExistException extends MetadataException {
 
 Review comment:
   what is Root not exist?  StorageGroup not exist?


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379294406
 
 

 ##
 File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
 ##
 @@ -50,131 +52,127 @@
 public class MTree implements Serializable {
 
   private static final long serialVersionUID = -4200394435237291964L;
-  private static final String PATH_SEPARATOR = "\\.";
-  private static final String NO_CHILD_ERROR = "Node [%s] doesn't have child 
named: [%s]";
-  private static final String NOT_LEAF_NODE = "is NOT the leaf node";
   private MNode root;
+  /**
+   * dummy node is used for the default param of traverse methods
+   */
+  private MNode dummyNode;
 
   MTree(String rootName) {
 this.root = new MNode(rootName, null, false);
+this.dummyNode = new MNode("dummy", null, false);
   }
 
   /**
-   * function for adding timeseries.It should check whether seriesPath exists.
-   */
-  void addTimeseriesPath(String timeseriesPath, TSDataType dataType, 
TSEncoding encoding,
-  CompressionType compressor, Map props) throws 
PathException {
-String[] nodeNames = MetaUtils.getNodeNames(timeseriesPath, 
PATH_SEPARATOR);
+   * Add timeseries path
+   *
+   * @param path timeseries path
+   * @param dataType data type
+   * @param encoding encoding
+   * @param compressor compressor
+   * @param props props
+   */
+  void addPath(String path, TSDataType dataType, TSEncoding encoding,
+  CompressionType compressor, Map props) throws 
MetadataException {
+String[] nodeNames = MetaUtils.getNodeNames(path);
 if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {
-  throw new MTreePathException("Timeseries", timeseriesPath);
+  throw new IllegalPathException(path);
 }
-MNode cur = findLeafParent(nodeNames);
-String levelPath = cur.getDataFileName();
+MNode cur = getParent(nodeNames);
+String storageGroupName = cur.getStorageGroupName();
 
 MNode leaf = new MNode(nodeNames[nodeNames.length - 1], cur, dataType, 
encoding, compressor);
 if (props != null && !props.isEmpty()) {
   leaf.getSchema().setProps(props);
 }
-leaf.setDataFileName(levelPath);
+leaf.setStorageGroupName(storageGroupName);
 if (cur.isLeaf()) {
-  throw new MTreePathException(timeseriesPath, "can't be created",
-  String.format("node [%s] is left node", cur.getName()));
+  throw new PathAlreadyExistException(cur.getFullPath());
 }
 cur.addChild(nodeNames[nodeNames.length - 1], leaf);
   }
 
   /**
-   * function for adding deviceId
+   * Add device to MTree. This is available IF and ONLY IF creating schema 
automatically is enabled
+   *
+   * @param deviceId device id
*/
-  MNode addDeviceId(String deviceId) throws PathException {
-String[] nodeNames = MetaUtils.getNodeNames(deviceId, PATH_SEPARATOR);
+  MNode addDevice(String deviceId) throws MetadataException {
+String[] nodeNames = MetaUtils.getNodeNames(deviceId);
 if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {
-  throw new MTreePathException("Timeseries", deviceId);
+  throw new IllegalPathException(deviceId);
 }
-MNode cur = getRoot();
+MNode cur = root;
 for (int i = 1; i < nodeNames.length; i++) {
-  if (!cur.hasChild(nodeNames[i])) {
+  if (!cur.hasChildWithKey(nodeNames[i])) {
 cur.addChild(nodeNames[i], new MNode(nodeNames[i], cur, false));
   }
   cur = cur.getChild(nodeNames[i]);
 }
 return cur;
   }
 
-  private MNode findLeafParent(String[] nodeNames) throws PathException {
+  /**
+   * Get nodes parent
+   *
+   * @param nodeNames node names
+   */
+  private MNode getParent(String[] nodeNames) throws MetadataException {
 
 Review comment:
   I don't understant this method... This is not only a get function, it also 
changes the tree structure.


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379284304
 
 

 ##
 File path: server/src/main/java/org/apache/iotdb/db/metadata/MNode.java
 ##
 @@ -36,29 +36,47 @@
 
   private static final long serialVersionUID = -770028375899514063L;
 
-  // The name of the MNode
+  /**
+   * Name of the MNode
+   */
   private String name;
-  // Whether current node is a leaf in the Metadata Tree
+
+  /**
+   * Whether current node is a leaf in the Metadata Tree
+   */
   private boolean isLeaf;
-  // Whether current node is Storage group in the Metadata Tree
+
+  /**
+   * Whether current node is Storage group in the Metadata Tree
+   */
   private boolean isStorageGroup;
-  // Map for the schema in this storage group
+
+  /**
+   * Map for the schema in this storage group
+   */
   private Map schemaMap;
+
   private Map numSchemaMap;
 
 Review comment:
   what is this field for?


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


With regards,
Apache Git Services


[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor MManager

2020-02-14 Thread GitBox
qiaojialin commented on a change in pull request #793: [IOTDB-274] Refactor 
MManager
URL: https://github.com/apache/incubator-iotdb/pull/793#discussion_r379288759
 
 

 ##
 File path: 
server/src/test/java/org/apache/iotdb/db/qp/plan/TestConcatOptimizer.java
 ##
 @@ -52,7 +52,7 @@
   public void before() throws MetadataException, PathException {
 processor = new Planner();
 MManager.getInstance().init();
 
 Review comment:
   Rename this class to ConcatOptimizerTest


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


With regards,
Apache Git Services