You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2021/03/12 11:21:22 UTC

[iotdb] 01/02: fix conflicts

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch TYQuery
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit e844b136fc919be0ae1dddb686c7301b395e3279
Author: JackieTien97 <Ja...@foxmail.com>
AuthorDate: Fri Mar 12 19:17:28 2021 +0800

    fix conflicts
---
 .../org/apache/iotdb/db/metadata/PartialPath.java  |  6 +--
 .../iotdb/db/metadata/VectorPartialPath.java       | 58 ++++++++++++++++++++++
 .../writelog/recover/UnseqTsFileRecoverTest.java   | 18 ++++---
 .../tsfile/write/schema/IMeasurementSchema.java    |  1 -
 .../write/writer/VectorChunkWriterImplTest.java    | 20 ++------
 .../write/writer/VectorMeasurementSchemaStub.java  |  8 +--
 6 files changed, 80 insertions(+), 31 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java b/server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
index 1f006d9..79d075f 100755
--- a/server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
@@ -40,11 +40,11 @@ public class PartialPath extends Path implements Comparable<Path> {
 
   private static final Logger logger = LoggerFactory.getLogger(PartialPath.class);
 
-  private String[] nodes;
+  protected String[] nodes;
   // alias of measurement, null pointer cannot be serialized in thrift so empty string is instead
-  private String measurementAlias = "";
+  protected String measurementAlias = "";
   // alias of time series used in SELECT AS
-  private String tsAlias = "";
+  protected String tsAlias = "";
 
   /**
    * Construct the PartialPath using a String, will split the given String into String[] E.g., path
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/VectorPartialPath.java b/server/src/main/java/org/apache/iotdb/db/metadata/VectorPartialPath.java
new file mode 100644
index 0000000..7c584ce
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/VectorPartialPath.java
@@ -0,0 +1,58 @@
+/*
+ * 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.metadata;
+
+import org.apache.iotdb.db.exception.metadata.IllegalPathException;
+
+import java.util.List;
+
+public class VectorPartialPath extends PartialPath {
+
+  private List<PartialPath> subSensorsPathList;
+
+  public VectorPartialPath(String path, List<PartialPath> subSensorsPathList)
+      throws IllegalPathException {
+    super(path);
+    this.subSensorsPathList = subSensorsPathList;
+  }
+
+  public VectorPartialPath(String device, String measurement, List<PartialPath> subSensorsPathList)
+      throws IllegalPathException {
+    super(device, measurement);
+    this.subSensorsPathList = subSensorsPathList;
+  }
+
+  public VectorPartialPath(String[] partialNodes, List<PartialPath> subSensorsPathList) {
+    super(partialNodes);
+    this.subSensorsPathList = subSensorsPathList;
+  }
+
+  public VectorPartialPath(String path, boolean needSplit, List<PartialPath> subSensorsPathList) {
+    super(path, needSplit);
+    this.subSensorsPathList = subSensorsPathList;
+  }
+
+  public List<PartialPath> getSubSensorsPathList() {
+    return subSensorsPathList;
+  }
+
+  public void setSubSensorsPathList(List<PartialPath> subSensorsPathList) {
+    this.subSensorsPathList = subSensorsPathList;
+  }
+}
diff --git a/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java b/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java
index a2d3539..77f7940 100644
--- a/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/writelog/recover/UnseqTsFileRecoverTest.java
@@ -19,14 +19,6 @@
 
 package org.apache.iotdb.db.writelog.recover;
 
-import static org.junit.Assert.assertEquals;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.MappedByteBuffer;
-import java.util.Collections;
-import org.apache.commons.io.FileUtils;
 import org.apache.iotdb.db.conf.IoTDBConstant;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.constant.TestConstant;
@@ -65,10 +57,20 @@ import org.apache.iotdb.tsfile.write.record.TSRecord;
 import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
 import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
 import org.apache.iotdb.tsfile.write.schema.Schema;
+
+import org.apache.commons.io.FileUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.MappedByteBuffer;
+import java.util.Collections;
+
+import static org.junit.Assert.assertEquals;
+
 public class UnseqTsFileRecoverTest {
 
   private File tsF;
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/IMeasurementSchema.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/IMeasurementSchema.java
index ee23bef..c6bad29 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/IMeasurementSchema.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/IMeasurementSchema.java
@@ -23,7 +23,6 @@ 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 java.io.IOException;
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorChunkWriterImplTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorChunkWriterImplTest.java
index 7866f48..0937d6c 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorChunkWriterImplTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorChunkWriterImplTest.java
@@ -18,6 +18,11 @@
  */
 package org.apache.iotdb.tsfile.write.writer;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
 import org.apache.iotdb.tsfile.file.MetaMarker;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
@@ -26,15 +31,8 @@ import org.apache.iotdb.tsfile.utils.PublicBAOS;
 import org.apache.iotdb.tsfile.utils.ReadWriteForEncodingUtils;
 import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
 import org.apache.iotdb.tsfile.write.chunk.VectorChunkWriterImpl;
-
 import org.junit.Test;
 
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 public class VectorChunkWriterImplTest {
 
   @Test
@@ -65,11 +63,7 @@ public class VectorChunkWriterImplTest {
           (byte) (0x80 | MetaMarker.ONLY_ONE_PAGE_CHUNK_HEADER), ReadWriteIOUtils.readByte(buffer));
       assertEquals("s1.time", ReadWriteIOUtils.readVarIntString(buffer));
       assertEquals(164, ReadWriteForEncodingUtils.readUnsignedVarInt(buffer));
-<<<<<<< HEAD
       assertEquals(TSDataType.VECTOR.serialize(), ReadWriteIOUtils.readByte(buffer));
-=======
-      assertEquals(TSDataType.Vector.serialize(), ReadWriteIOUtils.readByte(buffer));
->>>>>>> origin/Vector
       assertEquals(CompressionType.UNCOMPRESSED.serialize(), ReadWriteIOUtils.readByte(buffer));
       assertEquals(TSEncoding.PLAIN.serialize(), ReadWriteIOUtils.readByte(buffer));
       buffer.position(buffer.position() + 164);
@@ -142,11 +136,7 @@ public class VectorChunkWriterImplTest {
       assertEquals((byte) (0x80 | MetaMarker.CHUNK_HEADER), ReadWriteIOUtils.readByte(buffer));
       assertEquals("s1.time", ReadWriteIOUtils.readVarIntString(buffer));
       assertEquals(362, ReadWriteForEncodingUtils.readUnsignedVarInt(buffer));
-<<<<<<< HEAD
       assertEquals(TSDataType.VECTOR.serialize(), ReadWriteIOUtils.readByte(buffer));
-=======
-      assertEquals(TSDataType.Vector.serialize(), ReadWriteIOUtils.readByte(buffer));
->>>>>>> origin/Vector
       assertEquals(CompressionType.UNCOMPRESSED.serialize(), ReadWriteIOUtils.readByte(buffer));
       assertEquals(TSEncoding.PLAIN.serialize(), ReadWriteIOUtils.readByte(buffer));
       buffer.position(buffer.position() + 362);
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorMeasurementSchemaStub.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorMeasurementSchemaStub.java
index 7216aec..0780f40 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorMeasurementSchemaStub.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/VectorMeasurementSchemaStub.java
@@ -18,10 +18,6 @@
  */
 package org.apache.iotdb.tsfile.write.writer;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.util.Map;
 import org.apache.iotdb.tsfile.encoding.encoder.Encoder;
 import org.apache.iotdb.tsfile.encoding.encoder.PlainEncoder;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
@@ -29,8 +25,12 @@ import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
 import org.apache.iotdb.tsfile.write.schema.IMeasurementSchema;
 
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 public class VectorMeasurementSchemaStub implements IMeasurementSchema {