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

hxd pushed a commit to branch refactor_overflow_2
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/refactor_overflow_2 by this 
push:
     new 69089c4  temporary submit
69089c4 is described below

commit 69089c496588e2bac52f7b73f64a86b16a93b207
Author: xiangdong huang <[email protected]>
AuthorDate: Mon Mar 11 23:42:23 2019 +0800

    temporary submit
---
 .../overflow/io/OverflowedTsFileIOWriter.java      | 36 ++++++++++++++++++++++
 .../engine/overflow/io/OverflowResourceTest.java   | 24 ++++++---------
 2 files changed, 45 insertions(+), 15 deletions(-)

diff --git 
a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowedTsFileIOWriter.java
 
b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowedTsFileIOWriter.java
new file mode 100644
index 0000000..db86a78
--- /dev/null
+++ 
b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowedTsFileIOWriter.java
@@ -0,0 +1,36 @@
+/**
+ * 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.overflow.io;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import org.apache.iotdb.tsfile.write.writer.DefaultTsFileOutput;
+import org.apache.iotdb.tsfile.write.writer.TsFileIOWriter;
+
+public class OverflowedTsFileIOWriter extends TsFileIOWriter {
+
+  public OverflowedTsFileIOWriter(File file) throws FileNotFoundException {
+    super();
+    this.out = new DefaultTsFileOutput(file, true);
+
+  }
+
+
+}
diff --git 
a/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowResourceTest.java
 
b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowResourceTest.java
index 13eee7b..c7662bf 100644
--- 
a/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowResourceTest.java
+++ 
b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowResourceTest.java
@@ -37,35 +37,29 @@ public class OverflowResourceTest {
 
   private OverflowResource work;
   private File insertFile;
-  private File updateFile;
-  private File positionFile;
   private String insertFileName = "unseqTsFile";
-  private String updateDeleteFileName = "overflowFile";
-  private String positionFileName = "positionFile";
-  private String filePath = "overflow";
+  private String folderPath = "overflow";
   private String dataPath = "1";
-  private OverflowMemtable support = new OverflowMemtable();
+  private OverflowMemtable memtable = new OverflowMemtable();
 
   @Before
   public void setUp() throws Exception {
-    work = new OverflowResource(filePath, dataPath, 
SysTimeVersionController.INSTANCE);
-    insertFile = new File(new File(filePath, dataPath), insertFileName);
-    updateFile = new File(new File(filePath, dataPath), updateDeleteFileName);
-    positionFile = new File(new File(filePath, dataPath), positionFileName);
+    work = new OverflowResource(folderPath, dataPath, 
SysTimeVersionController.INSTANCE);
+    insertFile = new File(new File(folderPath, dataPath), insertFileName);
   }
 
   @After
   public void tearDown() throws Exception {
     work.close();
-    support.clear();
-    EnvironmentUtils.cleanDir(filePath);
+    memtable.clear();
+    EnvironmentUtils.cleanDir(folderPath);
   }
 
   @Test
   public void testOverflowInsert() throws IOException {
-    OverflowTestUtils.produceInsertData(support);
+    OverflowTestUtils.produceInsertData(memtable);
     QueryContext context = new QueryContext();
-    work.flush(OverflowTestUtils.getFileSchema(), support.getMemTabale(), 
"processorName");
+    work.flush(OverflowTestUtils.getFileSchema(), memtable.getMemTabale(), 
"processorName");
     List<ChunkMetaData> chunkMetaDatas = 
work.getInsertMetadatas(OverflowTestUtils.deviceId1,
         OverflowTestUtils.measurementId1, OverflowTestUtils.dataType2, 
context);
     assertEquals(0, chunkMetaDatas.size());
@@ -85,7 +79,7 @@ public class OverflowResourceTest {
     fileOutputStream.write(new byte[20]);
     fileOutputStream.close();
     assertEquals(originlength + 20, insertFile.length());
-    work = new OverflowResource(filePath, dataPath, 
SysTimeVersionController.INSTANCE);
+    work = new OverflowResource(folderPath, dataPath, 
SysTimeVersionController.INSTANCE);
     chunkMetaDatas = work
         .getInsertMetadatas(OverflowTestUtils.deviceId1, 
OverflowTestUtils.measurementId1,
             OverflowTestUtils.dataType1, context);

Reply via email to