You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2019/02/17 01:37:36 UTC

[GitHub] jt2594838 commented on a change in pull request #7: [IOTDB-5]Combine deletion with FileNodeProcessor and FileNodeManager

jt2594838 commented on a change in pull request #7: [IOTDB-5]Combine deletion with FileNodeProcessor and FileNodeManager
URL: https://github.com/apache/incubator-iotdb/pull/7#discussion_r257484369
 
 

 ##########
 File path: iotdb/src/test/java/org/apache/iotdb/db/engine/modification/DeletionFileNodeTest.java
 ##########
 @@ -0,0 +1,235 @@
+/**
+ * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
+ * <p>
+ * Licensed 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.modification;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.engine.modification.io.LocalTextModificationAccessor;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.DoubleDataPoint;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+public class DeletionFileNodeTest {
+
+  private String processorName = "root.test";
+
+  private static String[] measurements = new String[10];
+  private String dataType = TSDataType.DOUBLE.toString();
+  private String encoding = TSEncoding.PLAIN.toString();
+  private String[] args = new String[0];
+
+  static {
+    for (int i = 0; i < 10; i++) {
+      measurements[i] = "m" + i;
+    }
+  }
+
+  @Before
+  public void setup() throws MetadataArgsErrorException,
+          PathErrorException, IOException, FileNodeManagerException {
+    MManager.getInstance().setStorageLevelToMTree(processorName);
+    for (int i = 0; i < 10; i++) {
+      MManager.getInstance().addPathToMTree(processorName + "." + measurements[i], dataType,
+              encoding, args);
+      FileNodeManager.getInstance().addTimeSeries(new Path(processorName, measurements[i]), dataType,
+              encoding, args);
 
 Review comment:
   fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services