[GitHub] [incubator-iotdb] JackieTien97 commented on a change in pull request #429: [IOTDB-205]Support storage-group-level data ttl

2019-10-22 Thread GitBox
JackieTien97 commented on a change in pull request #429: [IOTDB-205]Support 
storage-group-level data ttl
URL: https://github.com/apache/incubator-iotdb/pull/429#discussion_r337822532
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/merge/manage/MergeResource.java
 ##
 @@ -65,24 +65,28 @@
   private Map measurementSchemaMap = new 
HashMap<>();
   private Map chunkWriterCache = new 
ConcurrentHashMap<>();
 
+  private long fileTimeBound = Long.MAX_VALUE;
+
   private boolean cacheDeviceMeta = false;
 
   public MergeResource(List seqFiles, List 
unseqFiles) {
-this.seqFiles = seqFiles.stream().filter(res -> res.isClosed() && 
!res.isDeleted())
-.collect(Collectors.toList());
+this.seqFiles =
+
seqFiles.stream().filter(this::filterResource).collect(Collectors.toList());
 this.unseqFiles =
-unseqFiles.stream().filter(res -> res.isClosed() && !res.isDeleted())
-.collect(Collectors.toList());
+
unseqFiles.stream().filter(this::filterResource).collect(Collectors.toList());
+  }
+
+  private boolean filterResource(TsFileResource res) {
+return res.isClosed() && !res.isDeleted() && res.stillLives(fileTimeBound);
 
 Review comment:
   In the before lambda, you didn't judge res.stillLives(fileTimeBound), but in 
the `filterResource` you judge it. Will there be some bugs after changing it?


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] little-emotion commented on a change in pull request #462: [IOTDB-253]time expression

2019-10-22 Thread GitBox
little-emotion commented on a change in pull request #462: [IOTDB-253]time 
expression
URL: https://github.com/apache/incubator-iotdb/pull/462#discussion_r337817960
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/qp/constant/DatetimeUtils.java
 ##
 @@ -475,6 +475,66 @@ public static long convertDatetimeStrToLong(String str, 
ZoneOffset offset, int d
 return getInstantWithPrecision(str, timestampPrecision);
   }
 
+  /**
+   * convert duration string to millisecond, microsecond or nanosecond.
+   */
+  public static long convertDurationStrToLong(long value, String unit, String 
timestampPrecision) {
+
+long res = value;
+switch (unit) {
+  case "y":
+res *= 365 * 86400_000;
+break;
+  case "mo":
+res *= 30 * 86400_000;
+break;
+  case "w":
+res *= 7 * 86400_000;
+break;
+  case "d":
+res *= 86400_000;
+break;
+  case "h":
+res *= 3600_000;
+break;
+  case "m":
+res *= 60_000;
+break;
+  case "s":
+res *= 1_000;
+break;
+  default:
 
 Review comment:
   Yes, I will make String unit a  enum.


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 #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
SilverNarcissus commented on a change in pull request #466: [IOTDB-208] Bloom 
filter
URL: https://github.com/apache/incubator-iotdb/pull/466#discussion_r337817246
 
 

 ##
 File path: tsfile/src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java
 ##
 @@ -0,0 +1,136 @@
+/*
+ * 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.tsfile.utils;
+
+import java.util.BitSet;
+
+public class BloomFilter {
+
+  private static final int MINIMAL_SIZE = 256;
+  private static final int MAXIMAL_HASH_FUNCTION_SIZE = 8;
+  private static final int[] seeds = new int[]{5, 7, 11, 19, 31, 37, 43, 59};
+  private int size;
+  private int hashFunctionSize;
+  private BitSet bits;
+  private HashFunction[] func;
+
+  // do not try to initialize the filter by construction method
+  private BloomFilter(byte[] bytes, int size, int hashFunctionSize) {
+this.size = size;
+this.hashFunctionSize = hashFunctionSize;
+func = new HashFunction[hashFunctionSize];
+for (int i = 0; i < hashFunctionSize; i++) {
+  func[i] = new HashFunction(size, seeds[i]);
+}
+bits = BitSet.valueOf(bytes);
+  }
+
+  private BloomFilter(int size, int hashFunctionSize) {
+this.size = size;
+this.hashFunctionSize = hashFunctionSize;
+func = new HashFunction[hashFunctionSize];
+for (int i = 0; i < hashFunctionSize; i++) {
+  func[i] = new HashFunction(size, seeds[i]);
+}
+bits = new BitSet(size);
+  }
+
+  /**
+   * get empty bloom filter
+   *
+   * @param errorPercent the tolerant percent of error of the bloom filter
+   * @param numOfString the number of string want to store in the bloom filter
+   * @return empty bloom
+   */
+  public static BloomFilter getEmptyBloomFilter(double errorPercent, int 
numOfString) {
+errorPercent = Math.max(errorPercent, 0.01);
+errorPercent = Math.min(errorPercent, 0.1);
 
 Review comment:
   There are two reasons:
   1.If user set errorPercent smaller than 0 or bigger than 1, iotdb will crash.
   2. If user set errorPercent very small, such as 0.0001, the size of 
bloom filter will very big (GB level), so I add these constraints


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] little-emotion commented on a change in pull request #462: [IOTDB-253]time expression

2019-10-22 Thread GitBox
little-emotion commented on a change in pull request #462: [IOTDB-253]time 
expression
URL: https://github.com/apache/incubator-iotdb/pull/462#discussion_r337814959
 
 

 ##
 File path: 
server/src/main/java/org/apache/iotdb/db/qp/constant/DatetimeUtils.java
 ##
 @@ -475,6 +475,66 @@ public static long convertDatetimeStrToLong(String str, 
ZoneOffset offset, int d
 return getInstantWithPrecision(str, timestampPrecision);
   }
 
+  /**
+   * convert duration string to millisecond, microsecond or nanosecond.
+   */
+  public static long convertDurationStrToLong(long value, String unit, String 
timestampPrecision) {
+
+long res = value;
+switch (unit) {
+  case "y":
+res *= 365 * 86400_000;
+break;
+  case "mo":
+res *= 30 * 86400_000;
+break;
+  case "w":
+res *= 7 * 86400_000;
+break;
+  case "d":
+res *= 86400_000;
+break;
+  case "h":
+res *= 3600_000;
+break;
+  case "m":
+res *= 60_000;
+break;
+  case "s":
+res *= 1_000;
+break;
+  default:
 
 Review comment:
   > Plus Plus, why doesn't the default branch throw an exception?
   > Plus Plus Plus, if this miss of "ns" is a bug, better add tests to cover 
this.
   This function has the second half.
   ```
   if (timestampPrecision.equals("us")) {
 if (unit.equals("ns")) {
   return value / 1000;
 } else if (unit.equals("us")) {
   return value;
 } else {
   return res * 1000;
 }
   } else if (timestampPrecision.equals("ns")) {
 if (unit.equals("ns")) {
   return value;
 } else if (unit.equals("us")) {
   return value * 1000;
 } else {
   return res * 1000_000;
 }
   } else {
 if (unit.equals("ns")) {
   return value / 1000_;
 } else if (unit.equals("us")) {
   return value / 1000;
 } else {
   return res;
 }
   }
   ```


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] little-emotion commented on a change in pull request #462: [IOTDB-253]time expression

2019-10-22 Thread GitBox
little-emotion commented on a change in pull request #462: [IOTDB-253]time 
expression
URL: https://github.com/apache/incubator-iotdb/pull/462#discussion_r337813928
 
 

 ##
 File path: docs/Documentation-CHN/UserGuide/2-Concept Key Concepts and 
Terminology/1-Key Concepts and Terminology.md
 ##
 @@ -166,6 +170,42 @@ IoTDB在显示时间戳时可以支持LONG类型以及DATETIME-DISPLAY类型,
 
 
 
+* 相对时间戳
+  
+  相对时间是指与服务器时间```now()```和```DATETIME```类型时间相差一定时间间隔的时间。
+  形式化定义为:
+  ```
+  Duration = (Digit+ ('Y'|'MO'|'W'|'D'|'H'|'M'|'S'|'MS'|'US'|'NS'))+
+  RelativeTime = (now() | DATETIME) ((+|-) Duration)+
 
 Review comment:
   5Y6Y is equal to 11Y. 7D8D is equal to 7D+8D, which is 15D.


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] LeiRui edited a comment on issue #455: [IOTDB-251]improve TSQueryDataSet structure in RPC

2019-10-22 Thread GitBox
LeiRui edited a comment on issue #455: [IOTDB-251]improve TSQueryDataSet 
structure in RPC
URL: https://github.com/apache/incubator-iotdb/pull/455#issuecomment-544514616
 
 
   > How about this:
   > Deprecate the List of RowRecord and instead use a RowBatch, which avoids 
too many objects such as Fields and RowRecord itself.
   
   Hi, thank you, I have recorded your thought on JIRA 
https://issues.apache.org/jira/projects/IOTDB/issues/IOTDB-263 for future work.


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 #468: Update comment.

2019-10-22 Thread GitBox
qiaojialin merged pull request #468: Update comment.
URL: https://github.com/apache/incubator-iotdb/pull/468
 
 
   


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] HTHou commented on issue #464: Modified Decoder and SequenceReader to support old version of TsFile

2019-10-22 Thread GitBox
HTHou commented on issue #464: Modified Decoder and SequenceReader to support 
old version of TsFile
URL: https://github.com/apache/incubator-iotdb/pull/464#issuecomment-544954673
 
 
   All requested changes have been changed. Please check them again. Thank you.


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 #455: [IOTDB-251]improve TSQueryDataSet structure in RPC

2019-10-22 Thread GitBox
qiaojialin merged pull request #455: [IOTDB-251]improve TSQueryDataSet 
structure in RPC
URL: https://github.com/apache/incubator-iotdb/pull/455
 
 
   


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 #465: [IOTDB-261]Check path validity in session

2019-10-22 Thread GitBox
qiaojialin merged pull request #465: [IOTDB-261]Check path validity in session
URL: https://github.com/apache/incubator-iotdb/pull/465
 
 
   


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 #469: New doc pr

2019-10-22 Thread GitBox
qiaojialin merged pull request #469: New doc pr
URL: https://github.com/apache/incubator-iotdb/pull/469
 
 
   


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 issue #450: modify documents

2019-10-22 Thread GitBox
qiaojialin commented on issue #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#issuecomment-544947518
 
 
   move to New doc pr #469


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 closed pull request #450: modify documents

2019-10-22 Thread GitBox
qiaojialin closed pull request #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450
 
 
   


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 opened a new pull request #469: New doc pr

2019-10-22 Thread GitBox
qiaojialin opened a new pull request #469: New doc pr
URL: https://github.com/apache/incubator-iotdb/pull/469
 
 
   


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] HTHou commented on a change in pull request #464: Modified Decoder and SequenceReader to support old version of TsFile

2019-10-22 Thread GitBox
HTHou commented on a change in pull request #464: Modified Decoder and 
SequenceReader to support old version of TsFile
URL: https://github.com/apache/incubator-iotdb/pull/464#discussion_r337409169
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/PlainDecoder.java
 ##
 @@ -56,53 +57,39 @@ public boolean readBoolean(ByteBuffer buffer) {
   @Override
   public short readShort(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  int ch1 = ReadWriteIOUtils.read(buffer);
-  int ch2 = ReadWriteIOUtils.read(buffer);
-  return (short) (ch1 + (ch2 << 8));
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getShort();
   }
 
   @Override
   public int readInt(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  int ch1 = ReadWriteIOUtils.read(buffer);
-  int ch2 = ReadWriteIOUtils.read(buffer);
-  int ch3 = ReadWriteIOUtils.read(buffer);
-  int ch4 = ReadWriteIOUtils.read(buffer);
-  return ch1 + (ch2 << 8) + (ch3 << 16) + (ch4 << 24);
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getInt();
   }
 
   @Override
   public long readLong(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  int[] buf = new int[8];
-  for (int i = 0; i < 8; i++) {
-buf[i] = ReadWriteIOUtils.read(buffer);
-  }
-  Long res = 0L;
-  for (int i = 0; i < 8; i++) {
-res += ((long) buf[i] << (i * 8));
-  }
-  return res;
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getLong();
   }
 
   @Override
   public float readFloat(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  return Float.intBitsToFloat(readInt(buffer));
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getFloat();
   }
 
   @Override
   public double readDouble(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  return Double.longBitsToDouble(readLong(buffer));
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 
 Review comment:
   > This is okay. But the checks can be saved if you set the byte order when 
the buffer is created instead of when calling these methods.
   
   Yes, you are right! Thanks a lot.


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 #468: Update comment.

2019-10-22 Thread GitBox
Genius-pig opened a new pull request #468: Update comment.
URL: https://github.com/apache/incubator-iotdb/pull/468
 
 
   Update comment.


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] EJTTianYu opened a new pull request #467: online upgrade from v0.8.0 to current version

2019-10-22 Thread GitBox
EJTTianYu opened a new pull request #467: online upgrade  from v0.8.0 to 
current version
URL: https://github.com/apache/incubator-iotdb/pull/467
 
 
   


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 #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466#discussion_r337393088
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsFileMetaData.java
 ##
 @@ -110,6 +120,13 @@ public static TsFileMetaData deserializeFrom(InputStream 
inputStream) throws IOE
 }
 fileMetaData.totalChunkNum = ReadWriteIOUtils.readInt(inputStream);
 fileMetaData.invalidChunkNum = ReadWriteIOUtils.readInt(inputStream);
+// read bloom filter
+if(!ReadWriteIOUtils.checkIfMagicString(inputStream)){
 
 Review comment:
   Maybe you can use `available()` to perform a quick check.


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 issue #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
jt2594838 commented on issue #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466#issuecomment-544862107
 
 
   There are failing tests, please have a look.


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 #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466#discussion_r337389299
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
 ##
 @@ -277,6 +275,10 @@ public void endFile(Schema schema) throws IOException {
 int size = tsFileMetaData.serializeTo(out.wrapAsStream());
 logger.debug("finish flushing the footer {}, file pos:{}", tsFileMetaData, 
out.getPosition());
 
+// write bloom filter
+size += tsFileMetaData.serializeBloomFilter(out.wrapAsStream(), 
chunkGroupMetaDataList);
+logger.debug("finish flushing the bloom filter file pos:{}", 
out.getPosition());
 
 Review comment:
   Wrap with `if (logger.isDebugEnabled())`, `out.getPosition()` could be 
costly, please also fix logs above.


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 #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466#discussion_r337381247
 
 

 ##
 File path: tsfile/src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java
 ##
 @@ -0,0 +1,136 @@
+/*
+ * 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.tsfile.utils;
+
+import java.util.BitSet;
+
+public class BloomFilter {
+
+  private static final int MINIMAL_SIZE = 256;
+  private static final int MAXIMAL_HASH_FUNCTION_SIZE = 8;
+  private static final int[] seeds = new int[]{5, 7, 11, 19, 31, 37, 43, 59};
 
 Review comment:
   seeds -> SEEDS


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 #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466#discussion_r337377447
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/executor/TsFileExecutor.java
 ##
 @@ -54,6 +58,25 @@ public TsFileExecutor(IMetadataQuerier metadataQuerier, 
IChunkLoader chunkLoader
 
   @Override
   public QueryDataSet execute(QueryExpression queryExpression) throws 
IOException {
+// bloom filter
+BloomFilter bloomFilter = 
metadataQuerier.getWholeFileMetadata().getBloomFilter();
+List filteredSeriesPath = new ArrayList<>();
+if(bloomFilter != null) {
+  for (Path path : queryExpression.getSelectedSeries()) {
+if (bloomFilter.contains(path.getFullPath())) {
+  filteredSeriesPath.add(path);
+}
+  }
+  if (filteredSeriesPath.isEmpty()) {
+// return an empty QueryDataSet
+LOG.warn(
+"This tsfile not contains all paths which specified in selected 
series, return empty dataset");
 
 Review comment:
   `warn` may be too high. Querying old files with newly created time series 
may often result in this branch, I think `debug` is enough.


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 #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466#discussion_r337382019
 
 

 ##
 File path: tsfile/src/main/java/org/apache/iotdb/tsfile/utils/BloomFilter.java
 ##
 @@ -0,0 +1,136 @@
+/*
+ * 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.tsfile.utils;
+
+import java.util.BitSet;
+
+public class BloomFilter {
+
+  private static final int MINIMAL_SIZE = 256;
+  private static final int MAXIMAL_HASH_FUNCTION_SIZE = 8;
+  private static final int[] seeds = new int[]{5, 7, 11, 19, 31, 37, 43, 59};
+  private int size;
+  private int hashFunctionSize;
+  private BitSet bits;
+  private HashFunction[] func;
+
+  // do not try to initialize the filter by construction method
+  private BloomFilter(byte[] bytes, int size, int hashFunctionSize) {
+this.size = size;
+this.hashFunctionSize = hashFunctionSize;
+func = new HashFunction[hashFunctionSize];
+for (int i = 0; i < hashFunctionSize; i++) {
+  func[i] = new HashFunction(size, seeds[i]);
+}
+bits = BitSet.valueOf(bytes);
+  }
+
+  private BloomFilter(int size, int hashFunctionSize) {
+this.size = size;
+this.hashFunctionSize = hashFunctionSize;
+func = new HashFunction[hashFunctionSize];
+for (int i = 0; i < hashFunctionSize; i++) {
+  func[i] = new HashFunction(size, seeds[i]);
+}
+bits = new BitSet(size);
+  }
+
+  /**
+   * get empty bloom filter
+   *
+   * @param errorPercent the tolerant percent of error of the bloom filter
+   * @param numOfString the number of string want to store in the bloom filter
+   * @return empty bloom
+   */
+  public static BloomFilter getEmptyBloomFilter(double errorPercent, int 
numOfString) {
+errorPercent = Math.max(errorPercent, 0.01);
+errorPercent = Math.min(errorPercent, 0.1);
 
 Review comment:
   Why adding these constraints?


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 #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466#discussion_r337375287
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsFileMetaData.java
 ##
 @@ -247,9 +271,59 @@ public int serializeTo(OutputStream outputStream) throws 
IOException {
 byteLen += ReadWriteIOUtils.write(totalChunkNum, outputStream);
 byteLen += ReadWriteIOUtils.write(invalidChunkNum, outputStream);
 
+
+return byteLen;
+  }
+
+  /**
+   * use the given outputStream to serialize bloom filter.
+   *
+   * @param outputStream -output stream to determine byte length
+   * @return -byte length
+   */
+  public int serializeBloomFilter(OutputStream outputStream, 
List chunkGroupMetaDataList)
+  throws IOException {
+int byteLen = 0;
+BloomFilter filter = buildBloomFilter(chunkGroupMetaDataList);
+
+byte[] bytes = filter.serialize();
+byteLen += ReadWriteIOUtils.write(ByteBuffer.wrap(bytes), outputStream);
 
 Review comment:
   ```
   outputStream.write(bytes);
   byteLen += bytes.length;
   ```
should be enough, there is no need to wrap with a ByteBuffer.


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] fanhualta commented on a change in pull request #465: [IOTDB-261]Check path validity in session

2019-10-22 Thread GitBox
fanhualta commented on a change in pull request #465: [IOTDB-261]Check path 
validity in session
URL: https://github.com/apache/incubator-iotdb/pull/465#discussion_r337377574
 
 

 ##
 File path: session/src/test/java/org/apache/iotdb/session/IoTDBSessionIT.java
 ##
 @@ -280,4 +280,59 @@ private void insert_via_sql() throws TException, 
IoTDBRPCException {
 session.executeNonQueryStatement(
 "insert into root.sg1.d1(timestamp,s1, s2, s3) values(100, 1,2,3)");
   }
+
+  @Test
+  public void checkPathTest()
+  throws ClassNotFoundException, SQLException, IoTDBSessionException, 
TException, IoTDBRPCException {
+session = new Session("127.0.0.1", 6667, "root", "root");
+session.open();
+
+//test set sg
+checkSetSG(session, "root.vehicle", true);
+checkSetSG(session, "root.123456", true);
+checkSetSG(session, "root._1234", true);
+checkSetSG(session, "root._vehicle", true);
+checkSetSG(session, "root.\tvehicle", false);
 
 Review comment:
   Don't support it.  The check rules here are the same as those of 
`TSParser.g`.


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] fanhualta merged pull request #430: [IOTDB-193]Create schema automatically

2019-10-22 Thread GitBox
fanhualta merged pull request #430: [IOTDB-193]Create schema automatically
URL: https://github.com/apache/incubator-iotdb/pull/430
 
 
   


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 #464: Modified Decoder and SequenceReader to support old version of TsFile

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #464: Modified Decoder and 
SequenceReader to support old version of TsFile
URL: https://github.com/apache/incubator-iotdb/pull/464#discussion_r337364532
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
 ##
 @@ -346,6 +341,12 @@ private ChunkHeader readChunkHeader(long position, 
boolean markerRead) throws IO
* @return the pages of this chunk
*/
   public ByteBuffer readChunk(ChunkHeader header) throws IOException {
+if (this.readVersionNumber().startsWith("v")) {
+  config.setEndian("LITTLE_ENDIAN");
+}
+else {
+  config.setEndian("BIG_ENDIAN");
+}
 
 Review comment:
   You may add a field in TsFileSequenceReader to indicate the byte order and 
pass it down throughout the query process.
   And this should be done at the very beginning, instead of when you plan to 
read 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] HTHou commented on issue #450: modify documents

2019-10-22 Thread GitBox
HTHou commented on issue #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#issuecomment-544843023
 
 
   > There are new conflicts, please have a look.
   
   Actually, I am still working on how to resolve these conflicts. I tried to 
copy everything except the file names from the initial files of Master branch, 
but Github still said there are conflicts. Do you think if I need to change the 
document and path names back to avoid the conflicts?


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 #464: Modified Decoder and SequenceReader to support old version of TsFile

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #464: Modified Decoder and 
SequenceReader to support old version of TsFile
URL: https://github.com/apache/incubator-iotdb/pull/464#discussion_r337365604
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/PlainDecoder.java
 ##
 @@ -56,53 +57,39 @@ public boolean readBoolean(ByteBuffer buffer) {
   @Override
   public short readShort(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  int ch1 = ReadWriteIOUtils.read(buffer);
-  int ch2 = ReadWriteIOUtils.read(buffer);
-  return (short) (ch1 + (ch2 << 8));
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getShort();
   }
 
   @Override
   public int readInt(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  int ch1 = ReadWriteIOUtils.read(buffer);
-  int ch2 = ReadWriteIOUtils.read(buffer);
-  int ch3 = ReadWriteIOUtils.read(buffer);
-  int ch4 = ReadWriteIOUtils.read(buffer);
-  return ch1 + (ch2 << 8) + (ch3 << 16) + (ch4 << 24);
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getInt();
   }
 
   @Override
   public long readLong(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  int[] buf = new int[8];
-  for (int i = 0; i < 8; i++) {
-buf[i] = ReadWriteIOUtils.read(buffer);
-  }
-  Long res = 0L;
-  for (int i = 0; i < 8; i++) {
-res += ((long) buf[i] << (i * 8));
-  }
-  return res;
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getLong();
   }
 
   @Override
   public float readFloat(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  return Float.intBitsToFloat(readInt(buffer));
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 }
 return buffer.getFloat();
   }
 
   @Override
   public double readDouble(ByteBuffer buffer) {
 if (this.endianType == EndianType.LITTLE_ENDIAN) {
-  return Double.longBitsToDouble(readLong(buffer));
+  buffer.order(ByteOrder.LITTLE_ENDIAN);
 
 Review comment:
   This is okay. But the checks can be saved if you set the byte order when the 
buffer is created instead of when calling these methods.


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 #464: Modified Decoder and SequenceReader to support old version of TsFile

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #464: Modified Decoder and 
SequenceReader to support old version of TsFile
URL: https://github.com/apache/incubator-iotdb/pull/464#discussion_r337364532
 
 

 ##
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
 ##
 @@ -346,6 +341,12 @@ private ChunkHeader readChunkHeader(long position, 
boolean markerRead) throws IO
* @return the pages of this chunk
*/
   public ByteBuffer readChunk(ChunkHeader header) throws IOException {
+if (this.readVersionNumber().startsWith("v")) {
+  config.setEndian("LITTLE_ENDIAN");
+}
+else {
+  config.setEndian("BIG_ENDIAN");
+}
 
 Review comment:
   You may add a field in TsFileSequenceReader to indicate the byte order and 
pass it down throughout the query process.


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 #450: modify documents

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#discussion_r337350502
 
 

 ##
 File path: docs/Documentation/UserGuide/4-Operation Manual/7-IoTDB Query 
Statement.md
 ##
 @@ -0,0 +1,694 @@
+
+# Chapter 4 Operation Manual
+# IoTDB SQL Statement
+In this part, we will introduce you IoTDB's Query Language. IoTDB offers you a 
SQL-like query language for interacting with IoTDB, the query language can be 
devided into 4 major parts:
+
+* Schema Statement: statements about schema management are all listed in this 
section.
+* Data Management Statement: statements about data management (such as: data 
insertion, data query, etc.) are all listed in this section.
+* Database Management Statement: statements about database management and 
authentication are all listed in this section.
+* Functions: functions that IoTDB offers are all listed in this section.
+
+All of these statements are write in IoTDB's own syntax, for details about the 
syntax composition, please check the `Reference` section.
+
+## IoTDB Query Statement
+
+
+### Schema Statement
+
+* Set Storage Group
+
+``` SQL
+SET STORAGE GROUP TO 
+Eg: IoTDB > SET STORAGE GROUP TO root.ln.wf01.wt01
+Note: PrefixPath can not include `*`
+```
+* Create Timeseries Statement
+
+```
+CREATE TIMESERIES  WITH 
+AttributeClauses : DATATYPE= COMMA ENCODING= 
[COMMA ]*
+DataTypeValue: BOOLEAN | DOUBLE | FLOAT | INT32 | INT64 | TEXT
+EncodingValue: GORILLA | PLAIN | RLE | TS_2DIFF | REGULAR
+ExtraAttributeClause: {
+  COMPRESSOR = 
+  MAX_POINT_NUMBER = Integer
+}
+CompressorValue: UNCOMPRESSED | SNAPPY
+Eg: IoTDB > CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE=BOOLEAN, 
ENCODING=PLAIN
+Eg: IoTDB > CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH 
DATATYPE=FLOAT, ENCODING=RLE
+Eg: IoTDB > CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH 
DATATYPE=FLOAT, ENCODING=RLE, COMPRESSOR=SNAPPY, MAX_POINT_NUMBER=3
+Note: Datatype and encoding type must be corresponding. Please check Chapter 3 
Encoding Section for details.
+```
+
+* Delete Timeseries Statement
+
+```
+DELETE TIMESERIES  [COMMA ]*
+Eg: IoTDB > DELETE TIMESERIES root.ln.wf01.wt01.status
+Eg: IoTDB > DELETE TIMESERIES root.ln.wf01.wt01.status, 
root.ln.wf01.wt01.temperature
+Eg: IoTDB > DELETE TIMESERIES root.ln.wf01.wt01.*
+```
+
+* Show All Timeseries Statement
+
+```
+SHOW TIMESERIES
+Eg: IoTDB > SHOW TIMESERIES
+Note: This statement can only be used in IoTDB Client. If you need to show all 
timeseries in JDBC, please use `DataBaseMetadata` interface.
+```
+
+* Show Specific Timeseries Statement
+
+```
+SHOW TIMESERIES 
+Eg: IoTDB > SHOW TIMESERIES root
+Eg: IoTDB > SHOW TIMESERIES root.ln
+Eg: IoTDB > SHOW TIMESERIES root.ln.*.*.status
+Eg: IoTDB > SHOW TIMESERIES root.ln.wf01.wt01.status
+Note: The path can be prefix path, star path or timeseries path
+Note: This statement can be used in IoTDB Client and JDBC.
+```
+
+* Show Storage Group Statement
+
+```
+SHOW STORAGE GROUP
+Eg: IoTDB > SHOW STORAGE GROUP
+Note: This statement can be used in IoTDB Client and JDBC.
+```
+
+### Data Management Statement
+
+* Insert Record Statement
+
+```
+INSERT INTO  LPAREN TIMESTAMP COMMA  [COMMA ]* 
RPAREN VALUES LPAREN ,  [COMMA ]* RPAREN
+Sensor : Identifier
+Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,status) 
values(150946560,true)
+Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,status) VALUES(NOW(), 
false)
+Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp,temperature) 
VALUES(2017-11-01T00:17:00.000+08:00,24.22028)
+Eg: IoTDB > INSERT INTO root.ln.wf01.wt01(timestamp, status, temperature) 
VALUES (150946668, false, 20.060787);
+Note: the statement needs to satisfy this constraint:  +  = 

+Note: The order of Sensor and PointValue need one-to-one correspondence
+```
+
+* Update Record Statement
+
+```
+UPDATE  SET  WHERE 
+UpdateClause: 
+SetClause:  
+SetExpression:  EQUAL 
+WhereClause :  [(AND | OR) ]*
+Condition  :  [(AND | OR) ]*
+Expression : [NOT | !]? TIME PrecedenceEqualOperator 
+Eg: IoTDB > UPDATE root.ln.wf01.wt01 SET temperature = 23 WHERE time < NOW() 
and time > 2017-11-1T00:15:00+08:00
+Note: the statement needs to satisfy this constraint:  +  = 

+```
+
+* Delete Record Statement
+
+```
+DELETE FROM  [COMMA ]* WHERE TIME LESSTHAN 
+Eg: DELETE FROM root.ln.wf01.wt01.temperature WHERE time < 
2017-11-1T00:05:00+08:00
+Eg: DELETE FROM root.ln.wf01.wt01.status, root.ln.wf01.wt01.temperature WHERE 
time < NOW()
+Eg: DELETE FROM root.ln.wf01.wt01.* WHERE time < 150946614
+```
+
+* Select Record Statement
+
+```
+SELECT  FROM  [WHERE ]?
+SelectClause :  (COMMA )*
+SelectPath :  LPAREN  RPAREN | 
+FUNCTION : ‘COUNT’ , ‘MIN_TIME’, ‘MAX_TIME’, ‘MIN_VALUE’, ‘MAX_VALUE’
+FromClause :  (COMMA )?
+WhereClause :  [(AND | OR) ]*
+Condition  :  [(AND | OR) ]*
+Expression : [NOT | !]?  | [NOT | !]? 
+TimeExpr : TIME PrecedenceEqualOperator 
+SensorExpr : ( | ) 

[GitHub] [incubator-iotdb] jt2594838 commented on issue #450: modify documents

2019-10-22 Thread GitBox
jt2594838 commented on issue #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#issuecomment-544839813
 
 
   There are new conflicts, please have a look.


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 #450: modify documents

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#discussion_r337354516
 
 

 ##
 File path: docs/Documentation/UserGuide/9-Tools-Grafana.md
 ##
 @@ -0,0 +1,139 @@
+
+
+
+## Outline
+
+- IoTDB-Grafana
+- Grafana installation
+- Install Grafana
+- Install data source plugin
+- Start Grafana
+- IoTDB installation
+- IoTDB-Grafana installation
+- Start IoTDB-Grafana
+- Explore in Grafana
+- Add data source
+- Design in dashboard
+
+
+# IoTDB-Grafana
+
+This project provides a connector which reads data from IoTDB and sends to 
Grafana(https://grafana.com/). Before you use this tool, make sure Grafana and 
IoTDB are correctly installed and started.
+
+## Grafana installation
+
+### Install Grafana
+
+* Download url: https://grafana.com/grafana/download
+* version >= 4.4.1
+
+### Install data source plugin
+
+* plugin name: simple-json-datasource
+* Download url: https://github.com/grafana/simple-json-datasource
+
+After downloading this plugin, you can use the grafana-cli tool to install 
SimpleJson from the commandline:
+
+```
+grafana-cli plugins install grafana-simple-json-datasource
+```
+
+Alternatively, you can manually download the .zip file and unpack it into your 
grafana plugins directory.
+
+* `{grafana-install-directory}\data\plugin\` (Windows)
+* `/var/lib/grafana/plugins` (Linux)
+* `/usr/local/var/lib/grafana/plugins`(Mac)
+
+### Start Grafana
+If you use Unix, Grafana will auto start after installing, or you can run 
`sudo service grafana-server start` command. See more information 
[here](http://docs.grafana.org/installation/debian/).
+
+If you use Mac and `homebrew` to install Grafana, you can use `homebrew` to 
start Grafana.
+First make sure homebrew/services is installed by running `brew tap 
homebrew/services`, then start Grafana using: `brew services start grafana`.
+See more information [here](http://docs.grafana.org/installation/mac/).
+
+If you use Windows, start Grafana by executing grafana-server.exe, located in 
the bin directory, preferably from the command line. See more information 
[here](http://docs.grafana.org/installation/windows/).
+
+## IoTDB installation
+
+See https://github.com/apache/incubator-iotdb
 
 Review comment:
   How about changing this to an internal link to the corresponding chapter in 
the user guide.


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 #450: modify documents

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#discussion_r337348684
 
 

 ##
 File path: docs/Documentation/UserGuide/4-Operation Manual/7-IoTDB Query 
Statement.md
 ##
 @@ -0,0 +1,694 @@
+
+# Chapter 4 Operation Manual
+# IoTDB SQL Statement
+In this part, we will introduce you IoTDB's Query Language. IoTDB offers you a 
SQL-like query language for interacting with IoTDB, the query language can be 
devided into 4 major parts:
+
+* Schema Statement: statements about schema management are all listed in this 
section.
+* Data Management Statement: statements about data management (such as: data 
insertion, data query, etc.) are all listed in this section.
+* Database Management Statement: statements about database management and 
authentication are all listed in this section.
+* Functions: functions that IoTDB offers are all listed in this section.
+
+All of these statements are write in IoTDB's own syntax, for details about the 
syntax composition, please check the `Reference` section.
+
+## IoTDB Query Statement
+
+
+### Schema Statement
+
+* Set Storage Group
+
+``` SQL
+SET STORAGE GROUP TO 
+Eg: IoTDB > SET STORAGE GROUP TO root.ln.wf01.wt01
+Note: PrefixPath can not include `*`
+```
+* Create Timeseries Statement
+
+```
+CREATE TIMESERIES  WITH 
+AttributeClauses : DATATYPE= COMMA ENCODING= 
[COMMA ]*
+DataTypeValue: BOOLEAN | DOUBLE | FLOAT | INT32 | INT64 | TEXT
+EncodingValue: GORILLA | PLAIN | RLE | TS_2DIFF | REGULAR
+ExtraAttributeClause: {
+  COMPRESSOR = 
+  MAX_POINT_NUMBER = Integer
+}
+CompressorValue: UNCOMPRESSED | SNAPPY
 
 Review comment:
   Please update the compressor types.


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 #450: modify documents

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#discussion_r337334873
 
 

 ##
 File path: docs/Documentation-CHN/UserGuide/9-Tools-Cli.md
 ##
 @@ -0,0 +1,134 @@
+
+
+
+## 概览
+- Cli / Shell工具
+- Cli / Shell运行方式
+- Cli / Shell运行参数
+- Cli / Shell的-e参数
+
+
+
+# Cli / Shell工具
+IOTDB为用户提供Client/Shell工具用于启动客户端和服务端程序。下面介绍每个Client/Shell工具的运行方式和相关参数。
+> \$IOTDB\_HOME表示IoTDB的安装目录所在路径。
+
+## Cli  / Shell运行方式
+安装后的IoTDB中有一个默认用户:`root`,默认密码为`root`。用户可以使用该用户尝试运行IoTDB客户端以测试服务器是否正常启动。客户端启动脚本为$IOTDB_HOME/bin文件夹下的`start-client`脚本。启动脚本时需要指定运行IP和PORT。以下为服务器在本机启动,且用户未更改运行端口号的示例,默认端口为6667。若用户尝试连接远程服务器或更改了服务器运行的端口号,请在-h和-p项处使用服务器的IP和PORT。
  
+
+Linux系统与MacOS系统启动命令如下:
+
+```
+  Shell > ./sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
+```
+Windows系统启动命令如下:
+
+```
+  Shell > \sbin\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root
 
 Review comment:
   There seems to be a missing ".".
   And I think the names of the scripts have changed.


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 #450: modify documents

2019-10-22 Thread GitBox
jt2594838 commented on a change in pull request #450: modify documents
URL: https://github.com/apache/incubator-iotdb/pull/450#discussion_r337352379
 
 

 ##
 File path: docs/Documentation/UserGuide/9-Tools-Cli.md
 ##
 @@ -0,0 +1,132 @@
+
+
+
+## Outline
+- Cli/shell tool
+- Running Cli/Shell
+- Cli/Shell Parameters
+- Cli/shell tool with -e parameter
+
+
+# Cli/shell tool
+IoTDB provides Cli/shell tools for users to interact with IoTDB server in 
command lines. This document will show how Cli/shell tool works and what does 
it parameters mean.
 
 Review comment:
   " what does it parameters mean" -> " what do its parameters mean"


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 opened a new pull request #466: [IOTDB-208] Bloom filter

2019-10-22 Thread GitBox
SilverNarcissus opened a new pull request #466: [IOTDB-208] Bloom filter
URL: https://github.com/apache/incubator-iotdb/pull/466
 
 
   Add bloom filter to skip tsfile which doesn't contains some timeseries


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] jixuan1989 merged pull request #449: Tooling for release

2019-10-22 Thread GitBox
jixuan1989 merged pull request #449: Tooling for release
URL: https://github.com/apache/incubator-iotdb/pull/449
 
 
   


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