[GitHub] [incubator-iotdb] xijunmu closed pull request #338: [IOTDB-158] add metrics service

2019-08-13 Thread GitBox
xijunmu closed pull request #338: [IOTDB-158] add metrics service
URL: https://github.com/apache/incubator-iotdb/pull/338
 
 
   


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 #331: [IOTDB-13]Support batched ingestion

2019-08-13 Thread GitBox
qiaojialin commented on a change in pull request #331: [IOTDB-13]Support 
batched ingestion
URL: https://github.com/apache/incubator-iotdb/pull/331#discussion_r313674111
 
 

 ##
 File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java
 ##
 @@ -211,6 +233,22 @@ public boolean write(TSRecord record) throws IOException, 
WriteProcessException
 return checkMemorySizeAndMayFlushGroup();
   }
 
+  /**
+   * write a row batch
+   *
+   * @param rowBatch - series responding a data column
 
 Review comment:
   @jack870131  You can change this to: multiple time series of one device that 
share a time column
   
   and add this as the Javadoc of RowBatch class


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 #331: [IOTDB-13]Support batched ingestion

2019-08-13 Thread GitBox
qiaojialin commented on a change in pull request #331: [IOTDB-13]Support 
batched ingestion
URL: https://github.com/apache/incubator-iotdb/pull/331#discussion_r313673611
 
 

 ##
 File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java
 ##
 @@ -194,6 +187,35 @@ private boolean checkIsTimeSeriesExist(TSRecord record) 
throws WriteProcessExcep
 return true;
   }
 
+  /**
+   * Confirm whether the row batch is legal. If legal, add it into this 
RecordWriter.
+   *
+   * @param rowBatch - a row batch responding multiple columns
+   * @return - whether the row batch has been added into RecordWriter legally
+   * @throws WriteProcessException exception
+   */
+  private boolean checkIsTimeSeriesExist(RowBatch rowBatch) throws 
WriteProcessException {
+IChunkGroupWriter groupWriter;
+if (!groupWriters.containsKey(rowBatch.deviceId)) {
+  groupWriter = new ChunkGroupWriterImpl(rowBatch.deviceId);
+  groupWriters.put(rowBatch.deviceId, groupWriter);
+} else {
+  groupWriter = groupWriters.get(rowBatch.deviceId);
+}
+
+// add all SeriesWriter of measurements in this RowBatch to this 
ChunkGroupWriter
+Map schemaDescriptorMap = 
schema.getMeasurementSchemaMap();
+for (MeasurementSchema measurement : rowBatch.measurements) {
+  String measurementId = measurement.getMeasurementId();
+  if (schemaDescriptorMap.containsKey(measurementId)) {
+groupWriter.addSeriesWriter(schemaDescriptorMap.get(measurementId), 
pageSize);
+  } else {
+throw new NoMeasurementException("input measurement is invalid: " + 
measurementId);
+  }
+}
+return true;
 
 Review comment:
   @jack870131  You can change this method to return void and remove the 
"return true;".
   
   Also, remove the javadoc "If legal, add it into this RecordWriter."
   
   Another: rename the IChunkGroupWriter.addSeriesWriter to tryToAddSeriesWriter


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] jt2594838 commented on a change in pull request #258: [IOTDB-143]Development of merge

2019-08-13 Thread GitBox
jt2594838 commented on a change in pull request #258: [IOTDB-143]Development of 
merge
URL: https://github.com/apache/incubator-iotdb/pull/258#discussion_r313672394
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/merge/task/MergeTask.java
 ##
 @@ -0,0 +1,155 @@
+/**
+ * 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.merge.task;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.Callable;
+import org.apache.iotdb.db.engine.merge.manage.MergeContext;
+import org.apache.iotdb.db.engine.merge.manage.MergeResource;
+import org.apache.iotdb.db.engine.merge.recover.MergeLogger;
+import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
+import org.apache.iotdb.db.utils.MergeUtils;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * MergeTask merges given seqFiles and unseqFiles into a new one, which 
basically consists of three
+ * steps: 1. rewrite overflowed, modified or small-sized chunks into temp 
merge files
+ *2. move the merged chunks in the temp files back to the seqFiles or 
move the unmerged
+ *chunks in the seqFiles int temp files and replace the seqFiles with 
the temp files.
 
 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] Genius-pig edited a comment on issue #338: add metrics service

2019-08-13 Thread GitBox
Genius-pig edited a comment on issue #338: add metrics service
URL: https://github.com/apache/incubator-iotdb/pull/338#issuecomment-520899618
 
 
   I think you should talk in the mailing list or open an issue. If you have 
already opened an issue, you can add it into pr title.


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 #338: add metrics service

2019-08-13 Thread GitBox
Genius-pig commented on issue #338: add metrics service
URL: https://github.com/apache/incubator-iotdb/pull/338#issuecomment-520899618
 
 
   I think you should open an issue or talk in the mailing 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] jt2594838 commented on a change in pull request #331: [IOTDB-13]Support batched ingestion

2019-08-13 Thread GitBox
jt2594838 commented on a change in pull request #331: [IOTDB-13]Support batched 
ingestion
URL: https://github.com/apache/incubator-iotdb/pull/331#discussion_r313298950
 
 

 ##
 File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java
 ##
 @@ -194,6 +187,35 @@ private boolean checkIsTimeSeriesExist(TSRecord record) 
throws WriteProcessExcep
 return true;
   }
 
+  /**
+   * Confirm whether the row batch is legal. If legal, add it into this 
RecordWriter.
+   *
+   * @param rowBatch - a row batch responding multiple columns
+   * @return - whether the row batch has been added into RecordWriter legally
+   * @throws WriteProcessException exception
+   */
+  private boolean checkIsTimeSeriesExist(RowBatch rowBatch) throws 
WriteProcessException {
+IChunkGroupWriter groupWriter;
+if (!groupWriters.containsKey(rowBatch.deviceId)) {
+  groupWriter = new ChunkGroupWriterImpl(rowBatch.deviceId);
+  groupWriters.put(rowBatch.deviceId, groupWriter);
+} else {
+  groupWriter = groupWriters.get(rowBatch.deviceId);
+}
+
+// add all SeriesWriter of measurements in this RowBatch to this 
ChunkGroupWriter
+Map schemaDescriptorMap = 
schema.getMeasurementSchemaMap();
+for (MeasurementSchema measurement : rowBatch.measurements) {
+  String measurementId = measurement.getMeasurementId();
+  if (schemaDescriptorMap.containsKey(measurementId)) {
+groupWriter.addSeriesWriter(schemaDescriptorMap.get(measurementId), 
pageSize);
+  } else {
+throw new NoMeasurementException("input measurement is invalid: " + 
measurementId);
+  }
+}
+return true;
 
 Review comment:
   You do not have to return this since it will never be "false", just use the 
exception.
   You said "If legal, add it into this RecordWriter.", but I did not see the 
corresponding code.


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] jt2594838 commented on a change in pull request #331: [IOTDB-13]Support batched ingestion

2019-08-13 Thread GitBox
jt2594838 commented on a change in pull request #331: [IOTDB-13]Support batched 
ingestion
URL: https://github.com/apache/incubator-iotdb/pull/331#discussion_r313301691
 
 

 ##
 File path: tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java
 ##
 @@ -211,6 +233,22 @@ public boolean write(TSRecord record) throws IOException, 
WriteProcessException
 return checkMemorySizeAndMayFlushGroup();
   }
 
+  /**
+   * write a row batch
+   *
+   * @param rowBatch - series responding a data column
 
 Review comment:
   I can hardly understand "series responding a data column".


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] xijunmu opened a new pull request #338: add metrics service

2019-08-13 Thread GitBox
xijunmu opened a new pull request #338: add metrics service
URL: https://github.com/apache/incubator-iotdb/pull/338
 
 
   add a monitoring web page to show SQL execution status after service 
startup.Monitor the memory and CPU usage of the current host


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