qiaojialin commented on a change in pull request #1326:
URL: https://github.com/apache/incubator-iotdb/pull/1326#discussion_r448076477



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -1133,9 +1138,15 @@ public MNode getDeviceNode(String path) throws 
MetadataException {
   }
 
   /**
+<<<<<<< HEAD
+   * To reduce the String number in memory, 
+   * use the deviceId from MManager instead of the deviceId read from disk
+   * 
+=======

Review comment:
       remove

##########
File path: 
server/src/main/java/org/apache/iotdb/db/engine/version/SimpleFileVersionController.java
##########
@@ -144,7 +142,9 @@ private void restore() throws IOException {
     } else {
       versionFile = SystemFileFactory.INSTANCE.getFile(directory, FILE_PREFIX 
+ "0");
       prevVersion = 0;
-      new FileOutputStream(versionFile).close();
+      if (!versionFile.createNewFile()) {
+        logger.warn("Cannot create new version file {}", versionFile);
+      }

Review comment:
       what does the previous code do?

##########
File path: 
server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
##########
@@ -301,9 +296,14 @@ public void serialize(DataOutputStream stream) throws 
IOException {
 
   private void putValues(DataOutputStream outputStream) throws 
QueryProcessException, IOException {
     for (int i = 0; i < values.length; i++) {
-      if (types[i] == null) {
+      // types are not determined, the situation mainly occurs when the plan 
uses string values
+      // and is forwarded to other nodes
+      if (types == null || types[i] == null) {
+        ReadWriteIOUtils.write((short) -1, outputStream);

Review comment:
       Extract -1 to a constant?

##########
File path: server/src/main/java/org/apache/iotdb/db/utils/SerializeUtils.java
##########
@@ -494,4 +494,21 @@ public static ByteBuffer serializeLongs(long[] longs) {
     }
     return ret;
   }
+
+  public static Node stringToNode(String str) {

Review comment:
       add some javadoc, give an example of str

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -1133,9 +1138,15 @@ public MNode getDeviceNode(String path) throws 
MetadataException {
   }
 
   /**
+<<<<<<< HEAD
+   * To reduce the String number in memory, 
+   * use the deviceId from MManager instead of the deviceId read from disk
+   * 
+=======
    * To reduce the String number in memory, use the deviceId from MManager 
instead of the deviceId
    * read from disk
    *
+>>>>>>> master

Review comment:
       remove

##########
File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/TimeseriesSchema.java
##########
@@ -0,0 +1,265 @@
+/*
+ * 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.write.schema;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.encoding.encoder.Encoder;
+import org.apache.iotdb.tsfile.encoding.encoder.TSEncodingBuilder;
+import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
+import org.apache.iotdb.tsfile.utils.StringContainer;
+
+/**
+ * TimeseriesSchema is like MeasurementSchema, but instead of measurementId, 
it stores the full
+ * path.
+ */
+public class TimeseriesSchema implements Comparable<TimeseriesSchema>, 
Serializable {

Review comment:
       Could we reuse the MeasurementSchema?




----------------------------------------------------------------
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:
[email protected]


Reply via email to