permissions;
private Path nodeName;
- public AuthorPlan(AuthorType authorType, String userName, String roleName, String password, String newPassword,
- String[] authorizationList, Path nodeName) throws AuthException {
+ public AuthorPlan(AuthorOperator.AuthorType authorType, String userName, String roleName, String password, String newPassword,
+ String[] authorizationList, Path nodeName) throws AuthException {
super(false, Operator.OperatorType.AUTHOR);
this.authorType = authorType;
this.userName = userName;
@@ -87,7 +91,7 @@ public class AuthorPlan extends PhysicalPlan {
}
}
- public AuthorType getAuthorType() {
+ public AuthorOperator.AuthorType getAuthorType() {
return authorType;
}
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/LoadDataPlan.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/LoadDataPlan.java
similarity index 75%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/LoadDataPlan.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/LoadDataPlan.java
index a4aefb2cad4..71453522494 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/LoadDataPlan.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/LoadDataPlan.java
@@ -1,11 +1,12 @@
-package cn.edu.tsinghua.iotdb.qp.physical.sys;
+package org.apache.iotdb.db.qp.physical.sys;
import java.util.ArrayList;
import java.util.List;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.logical.Operator;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.logical.Operator;
public class LoadDataPlan extends PhysicalPlan {
private final String inputFilePath;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/MetadataPlan.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/MetadataPlan.java
similarity index 86%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/MetadataPlan.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/MetadataPlan.java
index 96c90895da2..78d4a69826c 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/MetadataPlan.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/MetadataPlan.java
@@ -1,12 +1,14 @@
-package cn.edu.tsinghua.iotdb.qp.physical.sys;
+package org.apache.iotdb.db.qp.physical.sys;
import java.util.ArrayList;
import java.util.List;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.logical.Operator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.MetadataOperator;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.qp.logical.sys.MetadataOperator;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.qp.logical.sys.MetadataOperator;
public class MetadataPlan extends PhysicalPlan {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/PropertyPlan.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/PropertyPlan.java
similarity index 63%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/PropertyPlan.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/PropertyPlan.java
index 8cc43790056..f2a727df98f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/physical/sys/PropertyPlan.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/sys/PropertyPlan.java
@@ -1,18 +1,20 @@
-package cn.edu.tsinghua.iotdb.qp.physical.sys;
+package org.apache.iotdb.db.qp.physical.sys;
import java.util.ArrayList;
import java.util.List;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.PropertyOperator.PropertyType;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.logical.Operator;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.logical.sys.PropertyOperator.PropertyType;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.qp.logical.sys.PropertyOperator;
/**
* Manipulate property plan
*/
public class PropertyPlan extends PhysicalPlan {
- private final PropertyType propertyType;
+ private final PropertyOperator.PropertyType propertyType;
private Path propertyPath;
private Path metadataPath;
@@ -24,12 +26,12 @@ public class PropertyPlan extends PhysicalPlan {
return metadataPath;
}
- public PropertyType getPropertyType() {
+ public PropertyOperator.PropertyType getPropertyType() {
return propertyType;
}
- public PropertyPlan(PropertyType propertyType, Path propertyPath, Path metadataPath) {
+ public PropertyPlan(PropertyOperator.PropertyType propertyType, Path propertyPath, Path metadataPath) {
super(false, Operator.OperatorType.PROPERTY);
this.propertyType = propertyType;
this.propertyPath = propertyPath;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/LogicalGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
similarity index 93%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/LogicalGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
index 308ca1f887c..5f85c05cacd 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/LogicalGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
@@ -1,48 +1,42 @@
-package cn.edu.tsinghua.iotdb.qp.strategy;
+package org.apache.iotdb.db.qp.strategy;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.MetadataArgsErrorException;
-import cn.edu.tsinghua.iotdb.qp.constant.DatetimeUtils;
-import cn.edu.tsinghua.iotdb.qp.constant.SQLConstant;
-import cn.edu.tsinghua.iotdb.qp.constant.TSParserConstant;
-import cn.edu.tsinghua.iotdb.exception.qp.IllegalASTFormatException;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOperatorException;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.logical.RootOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.BasicFunctionOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.DeleteOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.FilterOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.FromOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.InsertOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.QueryOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.SFWOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.SelectOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.UpdateOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.AuthorOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.AuthorOperator.AuthorType;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.LoadDataOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.MetadataOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.PropertyOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.PropertyOperator.PropertyType;
-import cn.edu.tsinghua.iotdb.query.fill.IFill;
-import cn.edu.tsinghua.iotdb.query.fill.LinearFill;
-import cn.edu.tsinghua.iotdb.query.fill.PreviousFill;
-import cn.edu.tsinghua.iotdb.sql.parse.ASTNode;
-import cn.edu.tsinghua.iotdb.sql.parse.Node;
-import cn.edu.tsinghua.iotdb.sql.parse.TSParser;
-import cn.edu.tsinghua.tsfile.common.constant.SystemConstant;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.utils.Pair;
-import cn.edu.tsinghua.tsfile.utils.StringContainer;
import org.antlr.runtime.Token;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.qp.IllegalASTFormatException;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.constant.DatetimeUtils;
+import org.apache.iotdb.db.qp.constant.SQLConstant;
+import org.apache.iotdb.db.qp.constant.TSParserConstant;
+import org.apache.iotdb.db.qp.logical.RootOperator;
+import org.apache.iotdb.db.qp.logical.crud.*;
+import org.apache.iotdb.db.qp.logical.sys.AuthorOperator;
+import org.apache.iotdb.db.qp.logical.sys.LoadDataOperator;
+import org.apache.iotdb.db.qp.logical.sys.MetadataOperator;
+import org.apache.iotdb.db.qp.logical.sys.PropertyOperator;
+import org.apache.iotdb.db.query.fill.IFill;
+import org.apache.iotdb.db.query.fill.LinearFill;
+import org.apache.iotdb.db.query.fill.PreviousFill;
+import org.apache.iotdb.db.sql.parse.ASTNode;
+import org.apache.iotdb.db.sql.parse.Node;
+import org.apache.iotdb.db.sql.parse.TSParser;
+import org.apache.iotdb.tsfile.common.constant.SystemConstant;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.utils.StringContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.ZoneId;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
-import static cn.edu.tsinghua.iotdb.qp.constant.SQLConstant.*;
+import static org.apache.iotdb.db.qp.constant.SQLConstant.LESSTHAN;
+import static org.apache.iotdb.db.qp.constant.SQLConstant.LESSTHANOREQUALTO;
/**
* This class receives an ASTNode and transform it to an operator which is a
@@ -233,22 +227,22 @@ public class LogicalGenerator {
int tokenType = astNode.getChild(0).getType();
if(tokenType == TSParser.TOK_USER) {
// list all users
- initializedOperator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_USER);
+ initializedOperator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER);
} else if(tokenType == TSParser.TOK_ROLE) {
// list all roles
- initializedOperator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_ROLE);
+ initializedOperator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE);
}
} else if(childrenSize == 3) {
int tokenType = astNode.getChild(1).getType();
if(tokenType == TSParser.TOK_USER) {
// list user privileges on seriesPath
- AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_USER_PRIVILEGE);
+ AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_PRIVILEGE);
initializedOperator = operator;
operator.setUserName(astNode.getChild(1).getChild(0).getText());
operator.setNodeNameList(parsePath(astNode.getChild(2)));
} else if(tokenType == TSParser.TOK_ROLE) {
// list role privileges on seriesPath
- AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_ROLE_PRIVILEGE);
+ AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_PRIVILEGE);
initializedOperator = operator;
operator.setRoleName(astNode.getChild(1).getChild(0).getText());
operator.setNodeNameList(parsePath(astNode.getChild(2)));
@@ -258,12 +252,12 @@ public class LogicalGenerator {
tokenType = astNode.getChild(2).getType();
if(tokenType == TSParser.TOK_USER) {
// list all privileges of a user
- AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_USER_PRIVILEGE);
+ AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_PRIVILEGE);
initializedOperator = operator;
operator.setUserName(astNode.getChild(2).getChild(0).getText());
} else if (tokenType == TSParser.TOK_ROLE) {
// list all privileges of a role
- AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_ROLE_PRIVILEGE);
+ AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_PRIVILEGE);
initializedOperator = operator;
operator.setRoleName(astNode.getChild(2).getChild(0).getText());
}
@@ -271,12 +265,12 @@ public class LogicalGenerator {
tokenType = astNode.getChild(2).getType();
if(tokenType == TSParser.TOK_USER) {
// list all roles of a user
- AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_USER_ROLES);
+ AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_ROLES);
initializedOperator = operator;
operator.setUserName(astNode.getChild(2).getChild(0).getText());
} else if(tokenType == TSParser.TOK_ROLE) {
// list all users of a role
- AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorType.LIST_ROLE_USERS);
+ AuthorOperator operator = new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_USERS);
initializedOperator = operator;
operator.setRoleName(astNode.getChild(2).getChild(0).getText());
}
@@ -287,14 +281,14 @@ public class LogicalGenerator {
private void analyzePropertyCreate(ASTNode astNode) {
PropertyOperator propertyOperator = new PropertyOperator(SQLConstant.TOK_PROPERTY_CREATE,
- PropertyType.ADD_TREE);
+ PropertyOperator.PropertyType.ADD_TREE);
propertyOperator.setPropertyPath(new Path(astNode.getChild(0).getChild(0).getText()));
initializedOperator = propertyOperator;
}
private void analyzePropertyAddLabel(ASTNode astNode) {
PropertyOperator propertyOperator = new PropertyOperator(SQLConstant.TOK_PROPERTY_ADD_LABEL,
- PropertyType.ADD_PROPERTY_LABEL);
+ PropertyOperator.PropertyType.ADD_PROPERTY_LABEL);
Path propertyLabel = parsePropertyAndLabel(astNode, 0);
propertyOperator.setPropertyPath(propertyLabel);
initializedOperator = propertyOperator;
@@ -302,7 +296,7 @@ public class LogicalGenerator {
private void analyzePropertyDeleteLabel(ASTNode astNode) {
PropertyOperator propertyOperator = new PropertyOperator(SQLConstant.TOK_PROPERTY_DELETE_LABEL,
- PropertyType.DELETE_PROPERTY_LABEL);
+ PropertyOperator.PropertyType.DELETE_PROPERTY_LABEL);
Path propertyLabel = parsePropertyAndLabel(astNode, 0);
propertyOperator.setPropertyPath(propertyLabel);
initializedOperator = propertyOperator;
@@ -316,7 +310,7 @@ public class LogicalGenerator {
private void analyzePropertyLink(ASTNode astNode) {
PropertyOperator propertyOperator = new PropertyOperator(SQLConstant.TOK_PROPERTY_LINK,
- PropertyType.ADD_PROPERTY_TO_METADATA);
+ PropertyOperator.PropertyType.ADD_PROPERTY_TO_METADATA);
Path metaPath = parsePath(astNode.getChild(0));
propertyOperator.setMetadataPath(metaPath);
Path propertyLabel = parsePropertyAndLabel(astNode, 1);
@@ -326,7 +320,7 @@ public class LogicalGenerator {
private void analyzePropertyUnLink(ASTNode astNode) {
PropertyOperator propertyOperator = new PropertyOperator(SQLConstant.TOK_PROPERTY_UNLINK,
- PropertyType.DEL_PROPERTY_FROM_METADATA);
+ PropertyOperator.PropertyType.DEL_PROPERTY_FROM_METADATA);
Path metaPath = parsePath(astNode.getChild(0));
propertyOperator.setMetadataPath(metaPath);
Path propertyLabel = parsePropertyAndLabel(astNode, 1);
@@ -848,12 +842,12 @@ public class LogicalGenerator {
AuthorOperator authorOperator;
if (childCount == 2) {
// create user
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorType.CREATE_USER);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorOperator.AuthorType.CREATE_USER);
authorOperator.setUserName(astNode.getChild(0).getChild(0).getText());
authorOperator.setPassWord(astNode.getChild(1).getChild(0).getText());
} else if (childCount == 1) {
// create role
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorType.CREATE_ROLE);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorOperator.AuthorType.CREATE_ROLE);
authorOperator.setRoleName(astNode.getChild(0).getChild(0).getText());
} else {
throw new IllegalASTFormatException("illegal ast tree in grant author command, please check you SQL statement");
@@ -865,7 +859,7 @@ public class LogicalGenerator {
int childCount = astNode.getChildCount();
AuthorOperator authorOperator;
if (childCount == 1) {
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_UPDATE_USER, AuthorType.UPDATE_USER);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_UPDATE_USER, AuthorOperator.AuthorType.UPDATE_USER);
ASTNode user = astNode.getChild(0);
if (user.getChildCount() != 2) {
throw new IllegalASTFormatException("illegal ast tree in update password command, please check you SQL statement");
@@ -885,11 +879,11 @@ public class LogicalGenerator {
// drop user or role
switch (astNode.getChild(0).getType()) {
case TSParser.TOK_USER:
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorType.DROP_USER);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorOperator.AuthorType.DROP_USER);
authorOperator.setUserName(astNode.getChild(0).getChild(0).getText());
break;
case TSParser.TOK_ROLE:
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorType.DROP_ROLE);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorOperator.AuthorType.DROP_ROLE);
authorOperator.setRoleName(astNode.getChild(0).getChild(0).getText());
break;
default:
@@ -906,7 +900,7 @@ public class LogicalGenerator {
AuthorOperator authorOperator;
if (childCount == 2) {
// grant role to user
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.GRANT_ROLE_TO_USER);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorOperator.AuthorType.GRANT_ROLE_TO_USER);
authorOperator.setRoleName(astNode.getChild(0).getChild(0).getText());
authorOperator.setUserName(astNode.getChild(1).getChild(0).getText());
} else if (childCount == 3) {
@@ -918,13 +912,13 @@ public class LogicalGenerator {
Path nodePath = parsePath(astNode.getChild(2));
if (astNode.getChild(0).getType() == TSParser.TOK_USER) {
// grant user
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.GRANT_USER);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorOperator.AuthorType.GRANT_USER);
authorOperator.setUserName(astNode.getChild(0).getChild(0).getText());
authorOperator.setPrivilegeList(privileges);
authorOperator.setNodeNameList(nodePath);
} else if (astNode.getChild(0).getType() == TSParser.TOK_ROLE) {
// grant role
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.GRANT_ROLE);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorOperator.AuthorType.GRANT_ROLE);
authorOperator.setRoleName(astNode.getChild(0).getChild(0).getText());
authorOperator.setPrivilegeList(privileges);
authorOperator.setNodeNameList(nodePath);
@@ -942,7 +936,7 @@ public class LogicalGenerator {
AuthorOperator authorOperator;
if (childCount == 2) {
// revoke role to user
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_REVOKE, AuthorType.REVOKE_ROLE_FROM_USER);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_REVOKE, AuthorOperator.AuthorType.REVOKE_ROLE_FROM_USER);
authorOperator.setRoleName(astNode.getChild(0).getChild(0).getText());
authorOperator.setUserName(astNode.getChild(1).getChild(0).getText());
} else if (childCount == 3) {
@@ -954,13 +948,13 @@ public class LogicalGenerator {
Path nodePath = parsePath(astNode.getChild(2));
if (astNode.getChild(0).getType() == TSParser.TOK_USER) {
// revoke user
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_REVOKE, AuthorType.REVOKE_USER);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_REVOKE, AuthorOperator.AuthorType.REVOKE_USER);
authorOperator.setUserName(astNode.getChild(0).getChild(0).getText());
authorOperator.setPrivilegeList(privileges);
authorOperator.setNodeNameList(nodePath);
} else if (astNode.getChild(0).getType() == TSParser.TOK_ROLE) {
// revoke role
- authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_REVOKE, AuthorType.REVOKE_ROLE);
+ authorOperator = new AuthorOperator(SQLConstant.TOK_AUTHOR_REVOKE, AuthorOperator.AuthorType.REVOKE_ROLE);
authorOperator.setRoleName(astNode.getChild(0).getChild(0).getText());
authorOperator.setPrivilegeList(privileges);
authorOperator.setNodeNameList(nodePath);
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/PhysicalGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
similarity index 90%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/PhysicalGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
index 14953bd5fb0..22a32a458e0 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/PhysicalGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
@@ -1,24 +1,27 @@
-package cn.edu.tsinghua.iotdb.qp.strategy;
+package org.apache.iotdb.db.qp.strategy;
-import cn.edu.tsinghua.iotdb.auth.AuthException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOperatorException;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.executor.QueryProcessExecutor;
-import cn.edu.tsinghua.iotdb.qp.logical.Operator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.*;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.AuthorOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.LoadDataOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.MetadataOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.PropertyOperator;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.*;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.AuthorPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.LoadDataPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.MetadataPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.PropertyPlan;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.auth.AuthException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.executor.QueryProcessExecutor;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.qp.logical.crud.BasicFunctionOperator;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
+import org.apache.iotdb.db.qp.logical.crud.InsertOperator;
+import org.apache.iotdb.db.qp.logical.crud.QueryOperator;
+import org.apache.iotdb.db.qp.logical.sys.AuthorOperator;
+import org.apache.iotdb.db.qp.logical.sys.LoadDataOperator;
+import org.apache.iotdb.db.qp.logical.sys.MetadataOperator;
+import org.apache.iotdb.db.qp.logical.sys.PropertyOperator;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.crud.*;
+import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
+import org.apache.iotdb.db.qp.physical.sys.LoadDataPlan;
+import org.apache.iotdb.db.qp.physical.sys.MetadataPlan;
+import org.apache.iotdb.db.qp.physical.sys.PropertyPlan;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -263,13 +266,13 @@ public class PhysicalGenerator {
// "in format:[(a) and () and ()] or [] or [], a is not single! a:" + child);
// }
// switch (child.getSinglePath().toString()) {
-// case SQLConstant.RESERVED_TIME:
+// case RESERVED_TIME:
// if (timeFilter != null) {
// throw new GeneratePhysicalPlanException("time filter has been specified more than once");
// }
// timeFilter = child;
// break;
-// case SQLConstant.RESERVED_FREQ:
+// case RESERVED_FREQ:
// if (freqFilter != null) {
// throw new GeneratePhysicalPlanException("freq filter has been specified more than once");
// }
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/ConcatPathOptimizer.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
similarity index 94%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/ConcatPathOptimizer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
index 9478e612c8f..ba7babed1ed 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/ConcatPathOptimizer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
@@ -1,21 +1,26 @@
-package cn.edu.tsinghua.iotdb.qp.strategy.optimizer;
+package org.apache.iotdb.db.qp.strategy.optimizer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOperatorException;
-import cn.edu.tsinghua.iotdb.qp.executor.QueryProcessExecutor;
-import cn.edu.tsinghua.iotdb.qp.logical.Operator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.*;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.qp.executor.QueryProcessExecutor;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.qp.logical.crud.*;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.qp.logical.crud.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cn.edu.tsinghua.iotdb.qp.constant.SQLConstant;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOptimizeException;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.constant.SQLConstant;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.tsfile.read.common.Path;
/**
* concat paths in select and from clause
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/DNFFilterOptimizer.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/DNFFilterOptimizer.java
similarity index 92%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/DNFFilterOptimizer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/DNFFilterOptimizer.java
index 7a20f6d5f0b..9352a4656b3 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/DNFFilterOptimizer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/DNFFilterOptimizer.java
@@ -1,13 +1,15 @@
-package cn.edu.tsinghua.iotdb.qp.strategy.optimizer;
+package org.apache.iotdb.db.qp.strategy.optimizer;
-import static cn.edu.tsinghua.iotdb.qp.constant.SQLConstant.KW_AND;
-import static cn.edu.tsinghua.iotdb.qp.constant.SQLConstant.KW_OR;
+import static org.apache.iotdb.db.qp.constant.SQLConstant.KW_AND;
+import static org.apache.iotdb.db.qp.constant.SQLConstant.KW_OR;
import java.util.ArrayList;
import java.util.List;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOptimizeException;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.FilterOperator;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
public class DNFFilterOptimizer implements IFilterOptimizer {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/IFilterOptimizer.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/IFilterOptimizer.java
new file mode 100644
index 00000000000..cd38fd5f1be
--- /dev/null
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/IFilterOptimizer.java
@@ -0,0 +1,13 @@
+package org.apache.iotdb.db.qp.strategy.optimizer;
+
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
+
+/**
+ * provide a filter operator, optimize it.
+ */
+public interface IFilterOptimizer {
+ FilterOperator optimize(FilterOperator filter) throws QueryProcessorException;
+}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ILogicalOptimizer.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ILogicalOptimizer.java
new file mode 100644
index 00000000000..b65c232bc8c
--- /dev/null
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ILogicalOptimizer.java
@@ -0,0 +1,14 @@
+package org.apache.iotdb.db.qp.strategy.optimizer;
+
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.Operator;
+
+/**
+ * provide a context, transform it for optimization.
+ */
+public interface ILogicalOptimizer {
+
+ Operator transform(Operator operator) throws LogicalOptimizeException;
+}
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/MergeSingleFilterOptimizer.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/MergeSingleFilterOptimizer.java
similarity index 91%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/MergeSingleFilterOptimizer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/MergeSingleFilterOptimizer.java
index ff85f153d3e..e9b542a9202 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/MergeSingleFilterOptimizer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/MergeSingleFilterOptimizer.java
@@ -1,9 +1,12 @@
-package cn.edu.tsinghua.iotdb.qp.strategy.optimizer;
+package org.apache.iotdb.db.qp.strategy.optimizer;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOptimizeException;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.BasicFunctionOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.FilterOperator;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.crud.BasicFunctionOperator;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.crud.BasicFunctionOperator;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
import java.util.ArrayList;
import java.util.Comparator;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/RemoveNotOptimizer.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/RemoveNotOptimizer.java
similarity index 78%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/RemoveNotOptimizer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/RemoveNotOptimizer.java
index 5fbfdb8990e..50103f8dbf4 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/qp/strategy/optimizer/RemoveNotOptimizer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/RemoveNotOptimizer.java
@@ -1,16 +1,20 @@
-package cn.edu.tsinghua.iotdb.qp.strategy.optimizer;
+package org.apache.iotdb.db.qp.strategy.optimizer;
-import static cn.edu.tsinghua.iotdb.qp.constant.SQLConstant.KW_AND;
-import static cn.edu.tsinghua.iotdb.qp.constant.SQLConstant.KW_NOT;
-import static cn.edu.tsinghua.iotdb.qp.constant.SQLConstant.KW_OR;
+import static org.apache.iotdb.db.qp.constant.SQLConstant.KW_AND;
+import static org.apache.iotdb.db.qp.constant.SQLConstant.KW_NOT;
+import static org.apache.iotdb.db.qp.constant.SQLConstant.KW_OR;
import java.util.List;
-import cn.edu.tsinghua.iotdb.qp.constant.SQLConstant;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOptimizeException;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOperatorException;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.BasicFunctionOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.FilterOperator;
+import org.apache.iotdb.db.qp.constant.SQLConstant;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.qp.logical.crud.BasicFunctionOperator;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.qp.logical.crud.BasicFunctionOperator;
+import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
public class RemoveNotOptimizer implements IFilterOptimizer {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/executor/QueryJobExecutor.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/executor/QueryJobExecutor.java
similarity index 69%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/executor/QueryJobExecutor.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/executor/QueryJobExecutor.java
index 5077b479c93..2bf4f26bbc1 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/executor/QueryJobExecutor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/executor/QueryJobExecutor.java
@@ -1,10 +1,10 @@
-package cn.edu.tsinghua.iotdb.query.component.executor;
+package org.apache.iotdb.db.query.component.executor;
-import cn.edu.tsinghua.iotdb.query.component.job.QueryJob;
-import cn.edu.tsinghua.iotdb.query.component.job.QueryJobExecutionMessage;
-import cn.edu.tsinghua.iotdb.query.component.job.QueryEngineImpl;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
-import cn.edu.tsinghua.iotdb.query.component.job.QueryEngine;
+import org.apache.iotdb.db.query.component.job.QueryJob;
+import org.apache.iotdb.db.query.component.job.QueryJobExecutionMessage;
+import org.apache.iotdb.db.query.component.job.QueryEngineImpl;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.query.component.job.QueryEngine;
public abstract class QueryJobExecutor implements Runnable {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryEngine.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryEngine.java
similarity index 69%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryEngine.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryEngine.java
index bf0bcdc1bd1..66357b5f375 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryEngine.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryEngine.java
@@ -1,8 +1,8 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
-import cn.edu.tsinghua.iotdb.query.component.job.QueryJob;
-import cn.edu.tsinghua.iotdb.query.component.job.QueryJobFuture;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.query.component.job.QueryJob;
+import org.apache.iotdb.db.query.component.job.QueryJobFuture;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
public interface QueryEngine {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryEngineImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryEngineImpl.java
similarity index 92%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryEngineImpl.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryEngineImpl.java
index 919bd3f4e50..183044978bc 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryEngineImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryEngineImpl.java
@@ -1,8 +1,10 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
-import cn.edu.tsinghua.iotdb.concurrent.IoTDBThreadPoolFactory;
-import cn.edu.tsinghua.iotdb.query.component.executor.QueryJobExecutor;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.db.query.component.executor.QueryJobExecutor;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.db.query.component.executor.QueryJobExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJob.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJob.java
similarity index 95%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJob.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJob.java
index ee65172bcf2..6f871094c5e 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJob.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJob.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
-import cn.edu.tsinghua.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
public abstract class QueryJob {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobContext.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobContext.java
new file mode 100644
index 00000000000..aaa34165f8b
--- /dev/null
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobContext.java
@@ -0,0 +1,5 @@
+package org.apache.iotdb.db.query.component.job;
+
+
+public class QueryJobContext {
+}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobDispatcher.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobDispatcher.java
new file mode 100644
index 00000000000..e2be8c0c947
--- /dev/null
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobDispatcher.java
@@ -0,0 +1,12 @@
+package org.apache.iotdb.db.query.component.job;
+
+import org.apache.iotdb.db.query.component.executor.QueryJobExecutor;
+import org.apache.iotdb.db.query.component.job.QueryJob;
+import org.apache.iotdb.db.query.component.executor.QueryJobExecutor;
+
+
+public interface QueryJobDispatcher {
+
+ QueryJobExecutor dispatch(QueryJob queryJob);
+
+}
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobExecutionMessage.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobExecutionMessage.java
similarity index 86%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobExecutionMessage.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobExecutionMessage.java
index 3d310414da1..0039d2b3b2c 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobExecutionMessage.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobExecutionMessage.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
public class QueryJobExecutionMessage {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobFuture.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobFuture.java
similarity index 90%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobFuture.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobFuture.java
index 2ca2d15d162..28325b999d7 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobFuture.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobFuture.java
@@ -1,6 +1,6 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
public interface QueryJobFuture {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobFutureImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobFutureImpl.java
similarity index 92%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobFutureImpl.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobFutureImpl.java
index bbf29207c42..de05955577c 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobFutureImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobFutureImpl.java
@@ -1,6 +1,6 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobStatus.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobStatus.java
similarity index 68%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobStatus.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobStatus.java
index 5fadeb24496..f90acfdceef 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobStatus.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobStatus.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
public enum QueryJobStatus {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobType.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobType.java
similarity index 56%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobType.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobType.java
index 88c83bdcffb..c12c924ae4f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/job/QueryJobType.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobType.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.query.component.job;
+package org.apache.iotdb.db.query.component.job;
public enum QueryJobType {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/resource/QueryResource.java b/iotdb/src/main/java/org/apache/iotdb/db/query/component/resource/QueryResource.java
similarity index 74%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/resource/QueryResource.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/component/resource/QueryResource.java
index 93d44439000..bdeebdb7028 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/component/resource/QueryResource.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/component/resource/QueryResource.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.query.component.resource;
+package org.apache.iotdb.db.query.component.resource;
public interface QueryResource {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/FileReaderManager.java b/iotdb/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
similarity index 91%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/FileReaderManager.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
index 8b5bd9dfce9..c5d63eb26f7 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/FileReaderManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
@@ -1,12 +1,12 @@
-package cn.edu.tsinghua.iotdb.query.control;
+package org.apache.iotdb.db.query.control;
-import cn.edu.tsinghua.iotdb.concurrent.IoTDBThreadPoolFactory;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
-import cn.edu.tsinghua.iotdb.service.IService;
-import cn.edu.tsinghua.iotdb.service.ServiceType;
-import cn.edu.tsinghua.tsfile.read.TsFileSequenceReader;
-import cn.edu.tsinghua.tsfile.read.UnClosedTsFileReader;
+import org.apache.iotdb.db.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.service.IService;
+import org.apache.iotdb.db.service.ServiceType;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.UnClosedTsFileReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -17,8 +17,6 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-import static cn.edu.tsinghua.iotdb.service.ServiceType.FILE_READER_MANAGER_SERVICE;
-
/**
* Singleton pattern, to manage all file reader.
* Manage all opened file streams, to ensure that each file will be opened at most once.
@@ -165,7 +163,7 @@ public class FileReaderManager implements IService {
@Override
public ServiceType getID() {
- return FILE_READER_MANAGER_SERVICE;
+ return ServiceType.FILE_READER_MANAGER_SERVICE;
}
private static class FileReaderManagerHelper {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/OpenedFilePathsManager.java b/iotdb/src/main/java/org/apache/iotdb/db/query/control/OpenedFilePathsManager.java
similarity index 86%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/OpenedFilePathsManager.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/control/OpenedFilePathsManager.java
index 5a91cdee7ae..4b1ca250dc8 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/OpenedFilePathsManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/control/OpenedFilePathsManager.java
@@ -1,8 +1,11 @@
-package cn.edu.tsinghua.iotdb.query.control;
+package org.apache.iotdb.db.query.control;
-import cn.edu.tsinghua.iotdb.engine.filenode.IntervalFileNode;
-import cn.edu.tsinghua.iotdb.engine.querycontext.OverflowInsertFile;
-import cn.edu.tsinghua.iotdb.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.engine.filenode.IntervalFileNode;
+import org.apache.iotdb.db.engine.querycontext.OverflowInsertFile;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.engine.filenode.IntervalFileNode;
+import org.apache.iotdb.db.engine.querycontext.OverflowInsertFile;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
import java.util.HashSet;
import java.util.Set;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/QueryDataSourceManager.java b/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryDataSourceManager.java
similarity index 58%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/QueryDataSourceManager.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryDataSourceManager.java
index 3e7b6e09dca..b081356fa20 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/QueryDataSourceManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryDataSourceManager.java
@@ -1,10 +1,13 @@
-package cn.edu.tsinghua.iotdb.query.control;
+package org.apache.iotdb.db.query.control;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.engine.querycontext.QueryDataSource;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
/**
*
This class is used to get query data source of a given path.
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/QueryTokenManager.java b/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryTokenManager.java
similarity index 89%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/QueryTokenManager.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryTokenManager.java
index 8870841dabd..761c878b6f2 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/control/QueryTokenManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryTokenManager.java
@@ -1,12 +1,14 @@
-package cn.edu.tsinghua.iotdb.query.control;
+package org.apache.iotdb.db.query.control;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.expression.ExpressionType;
-import cn.edu.tsinghua.tsfile.read.expression.IBinaryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.ExpressionType;
+import org.apache.iotdb.tsfile.read.expression.IBinaryExpression;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
import java.util.HashSet;
import java.util.List;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/dataset/EngineDataSetWithTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithTimeGenerator.java
similarity index 77%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/dataset/EngineDataSetWithTimeGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithTimeGenerator.java
index 69b078f1c65..270d39e9f4a 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/dataset/EngineDataSetWithTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithTimeGenerator.java
@@ -1,15 +1,15 @@
-package cn.edu.tsinghua.iotdb.query.dataset;
+package org.apache.iotdb.db.query.dataset;
-import cn.edu.tsinghua.iotdb.query.reader.merge.EngineReaderByTimeStamp;
-import cn.edu.tsinghua.iotdb.query.timegenerator.EngineTimeGenerator;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.Field;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.common.RowRecord;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
-import cn.edu.tsinghua.tsfile.utils.Binary;
+import org.apache.iotdb.db.query.reader.merge.EngineReaderByTimeStamp;
+import org.apache.iotdb.db.query.timegenerator.EngineTimeGenerator;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Field;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.tsfile.utils.Binary;
import java.io.IOException;
import java.util.List;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/dataset/EngineDataSetWithoutTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithoutTimeGenerator.java
similarity index 85%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/dataset/EngineDataSetWithoutTimeGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithoutTimeGenerator.java
index 1a98dced585..f73b8979730 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/dataset/EngineDataSetWithoutTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/dataset/EngineDataSetWithoutTimeGenerator.java
@@ -1,15 +1,15 @@
-package cn.edu.tsinghua.iotdb.query.dataset;
+package org.apache.iotdb.db.query.dataset;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.common.Field;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.common.RowRecord;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Field;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
import java.io.IOException;
import java.util.*;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineExecutorWithTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithTimeGenerator.java
similarity index 61%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineExecutorWithTimeGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithTimeGenerator.java
index 5c5253d3c93..bba04c053d7 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineExecutorWithTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithTimeGenerator.java
@@ -1,22 +1,30 @@
-package cn.edu.tsinghua.iotdb.query.executor;
+package org.apache.iotdb.db.query.executor;
-import cn.edu.tsinghua.iotdb.engine.querycontext.QueryDataSource;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.query.control.QueryDataSourceManager;
-import cn.edu.tsinghua.iotdb.query.control.QueryTokenManager;
-import cn.edu.tsinghua.iotdb.query.dataset.EngineDataSetWithTimeGenerator;
-import cn.edu.tsinghua.iotdb.query.factory.SeriesReaderFactory;
-import cn.edu.tsinghua.iotdb.query.reader.merge.EngineReaderByTimeStamp;
-import cn.edu.tsinghua.iotdb.query.reader.merge.PriorityMergeReader;
-import cn.edu.tsinghua.iotdb.query.reader.merge.PriorityMergeReaderByTimestamp;
-import cn.edu.tsinghua.iotdb.query.reader.sequence.SequenceDataReader;
-import cn.edu.tsinghua.iotdb.query.timegenerator.EngineTimeGenerator;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.expression.QueryExpression;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.query.control.QueryDataSourceManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.query.dataset.EngineDataSetWithTimeGenerator;
+import org.apache.iotdb.db.query.factory.SeriesReaderFactory;
+import org.apache.iotdb.db.query.reader.merge.EngineReaderByTimeStamp;
+import org.apache.iotdb.db.query.reader.merge.PriorityMergeReader;
+import org.apache.iotdb.db.query.reader.merge.PriorityMergeReaderByTimestamp;
+import org.apache.iotdb.db.query.reader.sequence.SequenceDataReader;
+import org.apache.iotdb.db.query.timegenerator.EngineTimeGenerator;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.query.control.QueryDataSourceManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.query.dataset.EngineDataSetWithTimeGenerator;
+import org.apache.iotdb.db.query.factory.SeriesReaderFactory;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineExecutorWithoutTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithoutTimeGenerator.java
similarity index 69%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineExecutorWithoutTimeGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithoutTimeGenerator.java
index f4ffc1a0e0f..7d1d4271003 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineExecutorWithoutTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineExecutorWithoutTimeGenerator.java
@@ -1,22 +1,30 @@
-package cn.edu.tsinghua.iotdb.query.executor;
+package org.apache.iotdb.db.query.executor;
-import cn.edu.tsinghua.iotdb.engine.querycontext.QueryDataSource;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.query.control.QueryDataSourceManager;
-import cn.edu.tsinghua.iotdb.query.control.QueryTokenManager;
-import cn.edu.tsinghua.iotdb.query.dataset.EngineDataSetWithoutTimeGenerator;
-import cn.edu.tsinghua.iotdb.query.factory.SeriesReaderFactory;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.query.reader.merge.PriorityMergeReader;
-import cn.edu.tsinghua.iotdb.query.reader.sequence.SequenceDataReader;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.expression.QueryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.GlobalTimeExpression;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.query.control.QueryDataSourceManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.query.dataset.EngineDataSetWithoutTimeGenerator;
+import org.apache.iotdb.db.query.factory.SeriesReaderFactory;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.query.reader.merge.PriorityMergeReader;
+import org.apache.iotdb.db.query.reader.sequence.SequenceDataReader;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.GlobalTimeExpression;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.query.control.QueryDataSourceManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.query.dataset.EngineDataSetWithoutTimeGenerator;
+import org.apache.iotdb.db.query.factory.SeriesReaderFactory;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineQueryRouter.java b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineQueryRouter.java
similarity index 72%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineQueryRouter.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineQueryRouter.java
index 7d8754d04e6..b8a6625ac2f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/executor/EngineQueryRouter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/executor/EngineQueryRouter.java
@@ -1,21 +1,25 @@
-package cn.edu.tsinghua.iotdb.query.executor;
+package org.apache.iotdb.db.query.executor;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.query.control.OpenedFilePathsManager;
-import cn.edu.tsinghua.iotdb.query.control.QueryTokenManager;
-import cn.edu.tsinghua.tsfile.exception.filter.QueryFilterOptimizationException;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.expression.QueryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.util.ExpressionOptimizer;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.query.control.OpenedFilePathsManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.expression.util.ExpressionOptimizer;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.query.control.OpenedFilePathsManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicLong;
-import static cn.edu.tsinghua.tsfile.read.expression.ExpressionType.GLOBAL_TIME;
+import static org.apache.iotdb.tsfile.read.expression.ExpressionType.GLOBAL_TIME;
/**
*
Query entrance class of IoTDB query process.
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJob.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJob.java
similarity index 93%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJob.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJob.java
index 72053cae570..c86971b125a 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJob.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJob.java
@@ -1,4 +1,4 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
//
//import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobEngine.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobEngine.java
similarity index 86%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobEngine.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobEngine.java
index 43621a39f02..65c662eadee 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobEngine.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobEngine.java
@@ -1,6 +1,6 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReader;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReader;
//
//import java.io.IOException;
//import java.util.List;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobPart.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobPart.java
similarity index 80%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobPart.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobPart.java
index 15894cc373c..67fa3bcad4b 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobPart.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobPart.java
@@ -1,6 +1,6 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReader;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReader;
//
//import java.io.IOException;
//
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobScheduler.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobScheduler.java
similarity index 91%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobScheduler.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobScheduler.java
index fdfbfe49488..a48e8452c2c 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/ExternalSortJobScheduler.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobScheduler.java
@@ -1,4 +1,4 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
//
//public class ExternalSortJobScheduler {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/LineMerger.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/LineMerger.java
similarity index 61%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/LineMerger.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/LineMerger.java
index 0e62daf6bb5..ede1a65ce19 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/LineMerger.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/LineMerger.java
@@ -1,11 +1,11 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
-//import cn.edu.tsinghua.iotdb.query.externalsort.serialize.TimeValuePairDeserializer;
-//import cn.edu.tsinghua.iotdb.query.externalsort.serialize.TimeValuePairSerializer;
-//import cn.edu.tsinghua.iotdb.query.externalsort.serialize.impl.FixLengthTimeValuePairDeserializer;
-//import cn.edu.tsinghua.iotdb.query.externalsort.serialize.impl.FixLengthTimeValuePairSerializer;
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PriorityMergeReader;
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReader;
+//import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairDeserializer;
+//import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairSerializer;
+//import org.apache.iotdb.db.query.externalsort.serialize.impl.FixLengthTimeValuePairDeserializer;
+//import org.apache.iotdb.db.query.externalsort.serialize.impl.FixLengthTimeValuePairSerializer;
+//import org.apache.iotdb.db.query.reader.merge.PriorityMergeReader;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReader;
//
//import java.io.IOException;
//import java.util.List;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/MultiSourceExternalSortJobPart.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/MultiSourceExternalSortJobPart.java
similarity index 91%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/MultiSourceExternalSortJobPart.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/MultiSourceExternalSortJobPart.java
index 0cebb597310..2f6f5a642a5 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/MultiSourceExternalSortJobPart.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/MultiSourceExternalSortJobPart.java
@@ -1,6 +1,6 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReader;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReader;
//
//import java.io.IOException;
//import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/SimpleExternalSortEngine.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/SimpleExternalSortEngine.java
similarity index 94%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/SimpleExternalSortEngine.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/SimpleExternalSortEngine.java
index 9cbe1231e13..cfd884000c9 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/SimpleExternalSortEngine.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/SimpleExternalSortEngine.java
@@ -1,7 +1,7 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
-//import cn.edu.tsinghua.iotdb.conf.TsfileDBDescriptor;
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReader;
+//import org.apache.iotdb.db.conf.TsfileDBDescriptor;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReader;
//
//import java.io.File;
//import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/SingleSourceExternalSortJobPart.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/SingleSourceExternalSortJobPart.java
similarity index 80%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/SingleSourceExternalSortJobPart.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/SingleSourceExternalSortJobPart.java
index b6f0b483266..41b2dbe5be9 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/SingleSourceExternalSortJobPart.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/SingleSourceExternalSortJobPart.java
@@ -1,6 +1,6 @@
-//package cn.edu.tsinghua.iotdb.query.externalsort;
+//package org.apache.iotdb.db.query.externalsort;
//
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReader;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReader;
//
//
//public class SingleSourceExternalSortJobPart extends ExternalSortJobPart {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/TimeValuePairDeserializer.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairDeserializer.java
similarity index 72%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/TimeValuePairDeserializer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairDeserializer.java
index 7593c3fe13a..86a5d9779ae 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/TimeValuePairDeserializer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairDeserializer.java
@@ -1,6 +1,6 @@
-package cn.edu.tsinghua.iotdb.query.externalsort.serialize;
+package org.apache.iotdb.db.query.externalsort.serialize;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TimeValuePair;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/TimeValuePairSerializer.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairSerializer.java
similarity index 62%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/TimeValuePairSerializer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairSerializer.java
index 3679cff2bed..21f850ad176 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/TimeValuePairSerializer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairSerializer.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.query.externalsort.serialize;
+package org.apache.iotdb.db.query.externalsort.serialize;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TimeValuePair;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/FixLengthTimeValuePairDeserializer.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/FixLengthTimeValuePairDeserializer.java
similarity index 92%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/FixLengthTimeValuePairDeserializer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/FixLengthTimeValuePairDeserializer.java
index 5b15990aa3b..5d6edc8a9f3 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/FixLengthTimeValuePairDeserializer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/FixLengthTimeValuePairDeserializer.java
@@ -1,11 +1,12 @@
-package cn.edu.tsinghua.iotdb.query.externalsort.serialize.impl;
+package org.apache.iotdb.db.query.externalsort.serialize.impl;
-import cn.edu.tsinghua.iotdb.query.externalsort.serialize.TimeValuePairDeserializer;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.Binary;
-import cn.edu.tsinghua.tsfile.utils.BytesUtils;
+import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairDeserializer;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.Binary;
+import org.apache.iotdb.tsfile.utils.BytesUtils;
+import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairDeserializer;
import java.io.*;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/FixLengthTimeValuePairSerializer.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/FixLengthTimeValuePairSerializer.java
similarity index 94%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/FixLengthTimeValuePairSerializer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/FixLengthTimeValuePairSerializer.java
index 26082d5f8ec..f98aac1c9bd 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/FixLengthTimeValuePairSerializer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/FixLengthTimeValuePairSerializer.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.query.externalsort.serialize.impl;
+package org.apache.iotdb.db.query.externalsort.serialize.impl;
-import cn.edu.tsinghua.iotdb.query.externalsort.serialize.TimeValuePairSerializer;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.BytesUtils;
+import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairSerializer;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.BytesUtils;
import java.io.*;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/SimpleTimeValuePairDeserializer.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/SimpleTimeValuePairDeserializer.java
similarity index 82%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/SimpleTimeValuePairDeserializer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/SimpleTimeValuePairDeserializer.java
index b8f8bfb8255..72454a8e6ea 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/SimpleTimeValuePairDeserializer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/SimpleTimeValuePairDeserializer.java
@@ -1,7 +1,8 @@
-package cn.edu.tsinghua.iotdb.query.externalsort.serialize.impl;
+package org.apache.iotdb.db.query.externalsort.serialize.impl;
-import cn.edu.tsinghua.iotdb.query.externalsort.serialize.TimeValuePairDeserializer;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
+import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairDeserializer;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairDeserializer;
import java.io.*;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/SimpleTimeValuePairSerializer.java b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/SimpleTimeValuePairSerializer.java
similarity index 82%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/SimpleTimeValuePairSerializer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/SimpleTimeValuePairSerializer.java
index 89b3720f41b..3c729a4b825 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/externalsort/serialize/impl/SimpleTimeValuePairSerializer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/impl/SimpleTimeValuePairSerializer.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.query.externalsort.serialize.impl;
+package org.apache.iotdb.db.query.externalsort.serialize.impl;
-import cn.edu.tsinghua.iotdb.query.externalsort.serialize.TimeValuePairSerializer;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
+import org.apache.iotdb.db.query.externalsort.serialize.TimeValuePairSerializer;
+import org.apache.iotdb.db.utils.TimeValuePair;
import java.io.*;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/factory/SeriesReaderFactory.java b/iotdb/src/main/java/org/apache/iotdb/db/query/factory/SeriesReaderFactory.java
similarity index 73%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/factory/SeriesReaderFactory.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/factory/SeriesReaderFactory.java
index 90f80dfee4d..ceb284ed481 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/factory/SeriesReaderFactory.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/factory/SeriesReaderFactory.java
@@ -1,30 +1,34 @@
-package cn.edu.tsinghua.iotdb.query.factory;
+package org.apache.iotdb.db.query.factory;
-import cn.edu.tsinghua.iotdb.engine.filenode.IntervalFileNode;
-import cn.edu.tsinghua.iotdb.engine.querycontext.OverflowInsertFile;
-import cn.edu.tsinghua.iotdb.engine.querycontext.OverflowSeriesDataSource;
-import cn.edu.tsinghua.iotdb.query.control.FileReaderManager;
-import cn.edu.tsinghua.iotdb.query.reader.mem.MemChunkReaderWithFilter;
-import cn.edu.tsinghua.iotdb.query.reader.mem.MemChunkReaderWithoutFilter;
-import cn.edu.tsinghua.iotdb.query.reader.merge.PriorityMergeReader;
-import cn.edu.tsinghua.iotdb.query.reader.sequence.SealedTsFilesReader;
-import cn.edu.tsinghua.iotdb.query.reader.unsequence.EngineChunkReader;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.tsfile.common.constant.StatisticConstant;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
-import cn.edu.tsinghua.tsfile.read.TsFileSequenceReader;
-import cn.edu.tsinghua.tsfile.read.common.Chunk;
-import cn.edu.tsinghua.tsfile.read.controller.ChunkLoaderImpl;
-import cn.edu.tsinghua.tsfile.read.controller.MetadataQuerier;
-import cn.edu.tsinghua.tsfile.read.controller.MetadataQuerierByFileImpl;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.DigestForFilter;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
-import cn.edu.tsinghua.tsfile.read.reader.chunk.ChunkReader;
-import cn.edu.tsinghua.tsfile.read.reader.chunk.ChunkReaderWithFilter;
-import cn.edu.tsinghua.tsfile.read.reader.chunk.ChunkReaderWithoutFilter;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReader;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReaderWithFilter;
+import org.apache.iotdb.db.engine.filenode.IntervalFileNode;
+import org.apache.iotdb.db.engine.querycontext.OverflowInsertFile;
+import org.apache.iotdb.db.engine.querycontext.OverflowSeriesDataSource;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.query.reader.mem.MemChunkReaderWithFilter;
+import org.apache.iotdb.db.query.reader.mem.MemChunkReaderWithoutFilter;
+import org.apache.iotdb.db.query.reader.merge.PriorityMergeReader;
+import org.apache.iotdb.db.query.reader.sequence.SealedTsFilesReader;
+import org.apache.iotdb.db.query.reader.unsequence.EngineChunkReader;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.tsfile.common.constant.StatisticConstant;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Chunk;
+import org.apache.iotdb.tsfile.read.controller.ChunkLoaderImpl;
+import org.apache.iotdb.tsfile.read.controller.MetadataQuerier;
+import org.apache.iotdb.tsfile.read.controller.MetadataQuerierByFileImpl;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.DigestForFilter;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.reader.chunk.ChunkReader;
+import org.apache.iotdb.tsfile.read.reader.chunk.ChunkReaderWithFilter;
+import org.apache.iotdb.tsfile.read.reader.chunk.ChunkReaderWithoutFilter;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReader;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReaderWithFilter;
+import org.apache.iotdb.db.engine.filenode.IntervalFileNode;
+import org.apache.iotdb.db.engine.querycontext.OverflowInsertFile;
+import org.apache.iotdb.db.engine.querycontext.OverflowSeriesDataSource;
+import org.apache.iotdb.db.query.control.FileReaderManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/IFill.java b/iotdb/src/main/java/org/apache/iotdb/db/query/fill/IFill.java
similarity index 64%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/IFill.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/fill/IFill.java
index 9cfafc2006f..c1545250655 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/IFill.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/fill/IFill.java
@@ -1,10 +1,11 @@
-package cn.edu.tsinghua.iotdb.query.fill;
+package org.apache.iotdb.db.query.fill;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.PathErrorException;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/LinearFill.java b/iotdb/src/main/java/org/apache/iotdb/db/query/fill/LinearFill.java
similarity index 78%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/LinearFill.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/fill/LinearFill.java
index 1fc813d9aae..d80a6539569 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/LinearFill.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/fill/LinearFill.java
@@ -1,10 +1,11 @@
-package cn.edu.tsinghua.iotdb.query.fill;
+package org.apache.iotdb.db.query.fill;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.PathErrorException;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/PreviousFill.java b/iotdb/src/main/java/org/apache/iotdb/db/query/fill/PreviousFill.java
similarity index 71%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/PreviousFill.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/fill/PreviousFill.java
index 9f3cd8482db..92d78cb8894 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/fill/PreviousFill.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/fill/PreviousFill.java
@@ -1,11 +1,12 @@
-package cn.edu.tsinghua.iotdb.query.fill;
+package org.apache.iotdb.db.query.fill;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.PathErrorException;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/IReader.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/IReader.java
similarity index 72%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/IReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/IReader.java
index 0d98241f163..4c6c5bd849a 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/IReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/IReader.java
@@ -1,7 +1,8 @@
-package cn.edu.tsinghua.iotdb.query.reader;
+package org.apache.iotdb.db.query.reader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.utils.TimeValuePair;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderByTimestamp.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderByTimestamp.java
similarity index 80%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderByTimestamp.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderByTimestamp.java
index d29b803f00a..2c7b62e64e8 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderByTimestamp.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderByTimestamp.java
@@ -1,10 +1,12 @@
-package cn.edu.tsinghua.iotdb.query.reader.mem;
+package org.apache.iotdb.db.query.reader.mem;
-import cn.edu.tsinghua.iotdb.engine.memtable.TimeValuePairSorter;
-import cn.edu.tsinghua.iotdb.query.reader.merge.EngineReaderByTimeStamp;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.engine.memtable.TimeValuePairSorter;
+import org.apache.iotdb.db.query.reader.merge.EngineReaderByTimeStamp;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.engine.memtable.TimeValuePairSorter;
+import org.apache.iotdb.db.query.reader.merge.EngineReaderByTimeStamp;
import java.io.IOException;
import java.util.Iterator;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderWithFilter.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithFilter.java
similarity index 81%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderWithFilter.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithFilter.java
index 2dbb4ce2c6c..19ec64c4784 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderWithFilter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithFilter.java
@@ -1,10 +1,11 @@
-package cn.edu.tsinghua.iotdb.query.reader.mem;
+package org.apache.iotdb.db.query.reader.mem;
-import cn.edu.tsinghua.iotdb.engine.memtable.TimeValuePairSorter;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.db.engine.memtable.TimeValuePairSorter;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.db.engine.memtable.TimeValuePairSorter;
import java.io.IOException;
import java.util.Iterator;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderWithoutFilter.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithoutFilter.java
similarity index 75%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderWithoutFilter.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithoutFilter.java
index 62c1e7765a2..573f34468b7 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/mem/MemChunkReaderWithoutFilter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/mem/MemChunkReaderWithoutFilter.java
@@ -1,9 +1,10 @@
-package cn.edu.tsinghua.iotdb.query.reader.mem;
+package org.apache.iotdb.db.query.reader.mem;
-import cn.edu.tsinghua.iotdb.engine.memtable.TimeValuePairSorter;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.engine.memtable.TimeValuePairSorter;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.engine.memtable.TimeValuePairSorter;
import java.io.IOException;
import java.util.Iterator;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/EngineReaderByTimeStamp.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/EngineReaderByTimeStamp.java
similarity index 69%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/EngineReaderByTimeStamp.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/EngineReaderByTimeStamp.java
index 0507cec6eb5..598efdb3e0e 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/EngineReaderByTimeStamp.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/EngineReaderByTimeStamp.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.query.reader.merge;
+package org.apache.iotdb.db.query.reader.merge;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReader.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReader.java
similarity index 93%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReader.java
index 31e7313ca8f..53b632dea6e 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReader.java
@@ -1,8 +1,8 @@
-package cn.edu.tsinghua.iotdb.query.reader.merge;
+package org.apache.iotdb.db.query.reader.merge;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.common.BatchData;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderByTimestamp.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderByTimestamp.java
similarity index 88%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderByTimestamp.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderByTimestamp.java
index 012463543aa..5108ab845c0 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderByTimestamp.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderByTimestamp.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.query.reader.merge;
+package org.apache.iotdb.db.query.reader.merge;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SealedTsFilesReader.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SealedTsFilesReader.java
similarity index 80%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SealedTsFilesReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SealedTsFilesReader.java
index b17970e214b..70b5f3e282c 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SealedTsFilesReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SealedTsFilesReader.java
@@ -1,21 +1,23 @@
-package cn.edu.tsinghua.iotdb.query.reader.sequence;
+package org.apache.iotdb.db.query.reader.sequence;
-import cn.edu.tsinghua.iotdb.engine.filenode.IntervalFileNode;
-import cn.edu.tsinghua.iotdb.query.control.FileReaderManager;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePairUtils;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
-import cn.edu.tsinghua.tsfile.read.TsFileSequenceReader;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.controller.ChunkLoader;
-import cn.edu.tsinghua.tsfile.read.controller.ChunkLoaderImpl;
-import cn.edu.tsinghua.tsfile.read.controller.MetadataQuerierByFileImpl;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReader;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReaderWithFilter;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReaderWithoutFilter;
+import org.apache.iotdb.db.engine.filenode.IntervalFileNode;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePairUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.controller.ChunkLoader;
+import org.apache.iotdb.tsfile.read.controller.ChunkLoaderImpl;
+import org.apache.iotdb.tsfile.read.controller.MetadataQuerierByFileImpl;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReader;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReaderWithFilter;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReaderWithoutFilter;
+import org.apache.iotdb.db.engine.filenode.IntervalFileNode;
+import org.apache.iotdb.db.query.control.FileReaderManager;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SequenceDataReader.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SequenceDataReader.java
similarity index 79%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SequenceDataReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SequenceDataReader.java
index b47a74f65af..b737435ee0f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SequenceDataReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SequenceDataReader.java
@@ -1,12 +1,15 @@
-package cn.edu.tsinghua.iotdb.query.reader.sequence;
+package org.apache.iotdb.db.query.reader.sequence;
-import cn.edu.tsinghua.iotdb.engine.querycontext.GlobalSortedSeriesDataSource;
-import cn.edu.tsinghua.iotdb.query.reader.mem.MemChunkReaderWithFilter;
-import cn.edu.tsinghua.iotdb.query.reader.mem.MemChunkReaderWithoutFilter;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.db.engine.querycontext.GlobalSortedSeriesDataSource;
+import org.apache.iotdb.db.query.reader.mem.MemChunkReaderWithFilter;
+import org.apache.iotdb.db.query.reader.mem.MemChunkReaderWithoutFilter;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.db.engine.querycontext.GlobalSortedSeriesDataSource;
+import org.apache.iotdb.db.query.reader.mem.MemChunkReaderWithFilter;
+import org.apache.iotdb.db.query.reader.mem.MemChunkReaderWithoutFilter;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SequenceInsertDataByTimeStampReader.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SequenceInsertDataByTimeStampReader.java
similarity index 90%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SequenceInsertDataByTimeStampReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SequenceInsertDataByTimeStampReader.java
index 960d7fcec7c..d08745ca9e7 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/SequenceInsertDataByTimeStampReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/SequenceInsertDataByTimeStampReader.java
@@ -1,16 +1,16 @@
-//package cn.edu.tsinghua.iotdb.read.reader;
+//package org.apache.iotdb.read.reader;
//
-//import cn.edu.tsinghua.iotdb.engine.filenode.IntervalFileNode;
-//import cn.edu.tsinghua.iotdb.engine.querycontext.GlobalSortedSeriesDataSource;
-//import cn.edu.tsinghua.iotdb.engine.querycontext.UnsealedTsFile;
-//import cn.edu.tsinghua.iotdb.query.control.FileReaderManager;
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PriorityMergeReaderByTimestamp;
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReader;
-//import cn.edu.tsinghua.iotdb.query.reader.merge.PrioritySeriesReaderByTimestamp;
-//import cn.edu.tsinghua.iotdb.query.reader.merge.EngineReaderByTimeStamp;
-//import cn.edu.tsinghua.iotdb.query.reader.mem.MemChunkReaderByTimestamp;
-//import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-//import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
+//import org.apache.iotdb.db.engine.filenode.IntervalFileNode;
+//import org.apache.iotdb.db.engine.querycontext.GlobalSortedSeriesDataSource;
+//import org.apache.iotdb.db.engine.querycontext.UnsealedTsFile;
+//import org.apache.iotdb.db.query.control.FileReaderManager;
+//import org.apache.iotdb.db.query.reader.merge.PriorityMergeReaderByTimestamp;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReader;
+//import org.apache.iotdb.db.query.reader.merge.PrioritySeriesReaderByTimestamp;
+//import org.apache.iotdb.db.query.reader.merge.EngineReaderByTimeStamp;
+//import org.apache.iotdb.db.query.reader.mem.MemChunkReaderByTimestamp;
+//import org.apache.iotdb.db.utils.TimeValuePair;
+//import org.apache.iotdb.db.utils.TsPrimitiveType;
//
//import java.io.IOException;
//import java.io.RandomAccessFile;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/UnSealedTsFileReader.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/UnSealedTsFileReader.java
similarity index 64%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/UnSealedTsFileReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/UnSealedTsFileReader.java
index 54be1e5a70e..c9ed3430eb0 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/sequence/UnSealedTsFileReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/sequence/UnSealedTsFileReader.java
@@ -1,19 +1,21 @@
-package cn.edu.tsinghua.iotdb.query.reader.sequence;
+package org.apache.iotdb.db.query.reader.sequence;
-import cn.edu.tsinghua.iotdb.engine.querycontext.UnsealedTsFile;
-import cn.edu.tsinghua.iotdb.query.control.FileReaderManager;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePairUtils;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.read.TsFileSequenceReader;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.controller.ChunkLoader;
-import cn.edu.tsinghua.tsfile.read.controller.ChunkLoaderImpl;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReader;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReaderWithFilter;
-import cn.edu.tsinghua.tsfile.read.reader.series.FileSeriesReaderWithoutFilter;
+import org.apache.iotdb.db.engine.querycontext.UnsealedTsFile;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePairUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.controller.ChunkLoader;
+import org.apache.iotdb.tsfile.read.controller.ChunkLoaderImpl;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReader;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReaderWithFilter;
+import org.apache.iotdb.tsfile.read.reader.series.FileSeriesReaderWithoutFilter;
+import org.apache.iotdb.db.engine.querycontext.UnsealedTsFile;
+import org.apache.iotdb.db.query.control.FileReaderManager;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/unsequence/EngineChunkReader.java b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/unsequence/EngineChunkReader.java
similarity index 78%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/unsequence/EngineChunkReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/reader/unsequence/EngineChunkReader.java
index adbf34745a3..910ffbcf1a6 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/reader/unsequence/EngineChunkReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/reader/unsequence/EngineChunkReader.java
@@ -1,12 +1,11 @@
-package cn.edu.tsinghua.iotdb.query.reader.unsequence;
+package org.apache.iotdb.db.query.reader.unsequence;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePairUtils;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.read.TsFileSequenceReader;
-import cn.edu.tsinghua.tsfile.read.UnClosedTsFileReader;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.reader.chunk.ChunkReader;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePairUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.reader.chunk.ChunkReader;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineLeafNode.java b/iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineLeafNode.java
similarity index 82%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineLeafNode.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineLeafNode.java
index 49b3433d190..ed0ad4f056f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineLeafNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineLeafNode.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.query.timegenerator;
+package org.apache.iotdb.db.query.timegenerator;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
-import cn.edu.tsinghua.tsfile.read.query.timegenerator.node.Node;
-import cn.edu.tsinghua.tsfile.read.query.timegenerator.node.NodeType;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.query.timegenerator.node.Node;
+import org.apache.iotdb.tsfile.read.query.timegenerator.node.NodeType;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineNodeConstructor.java b/iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineNodeConstructor.java
similarity index 62%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineNodeConstructor.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineNodeConstructor.java
index 3988678f32f..d0c5c1a412f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineNodeConstructor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineNodeConstructor.java
@@ -1,24 +1,28 @@
-package cn.edu.tsinghua.iotdb.query.timegenerator;
+package org.apache.iotdb.db.query.timegenerator;
-import cn.edu.tsinghua.iotdb.engine.querycontext.QueryDataSource;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.query.control.QueryDataSourceManager;
-import cn.edu.tsinghua.iotdb.query.factory.SeriesReaderFactory;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.query.reader.merge.PriorityMergeReader;
-import cn.edu.tsinghua.iotdb.query.reader.sequence.SequenceDataReader;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.read.expression.IBinaryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
-import cn.edu.tsinghua.tsfile.read.query.timegenerator.node.AndNode;
-import cn.edu.tsinghua.tsfile.read.query.timegenerator.node.Node;
-import cn.edu.tsinghua.tsfile.read.query.timegenerator.node.OrNode;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.query.control.QueryDataSourceManager;
+import org.apache.iotdb.db.query.factory.SeriesReaderFactory;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.query.reader.merge.PriorityMergeReader;
+import org.apache.iotdb.db.query.reader.sequence.SequenceDataReader;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.read.expression.IBinaryExpression;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.query.timegenerator.node.AndNode;
+import org.apache.iotdb.tsfile.read.query.timegenerator.node.Node;
+import org.apache.iotdb.tsfile.read.query.timegenerator.node.OrNode;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.query.control.QueryDataSourceManager;
+import org.apache.iotdb.db.query.factory.SeriesReaderFactory;
import java.io.IOException;
-import static cn.edu.tsinghua.tsfile.read.expression.ExpressionType.*;
+import static org.apache.iotdb.tsfile.read.expression.ExpressionType.*;
public class EngineNodeConstructor {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineTimeGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineTimeGenerator.java
similarity index 73%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineTimeGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineTimeGenerator.java
index 12208cceb30..05144681a6c 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/query/timegenerator/EngineTimeGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/timegenerator/EngineTimeGenerator.java
@@ -1,10 +1,11 @@
-package cn.edu.tsinghua.iotdb.query.timegenerator;
+package org.apache.iotdb.db.query.timegenerator;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.query.timegenerator.TimeGenerator;
-import cn.edu.tsinghua.tsfile.read.query.timegenerator.node.Node;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.query.timegenerator.TimeGenerator;
+import org.apache.iotdb.tsfile.read.query.timegenerator.node.Node;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/CloseMergeService.java b/iotdb/src/main/java/org/apache/iotdb/db/service/CloseMergeService.java
similarity index 91%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/CloseMergeService.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/CloseMergeService.java
index 1abaa7dcd11..80510f46134 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/CloseMergeService.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/CloseMergeService.java
@@ -1,19 +1,22 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
+import org.apache.iotdb.db.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.db.concurrent.ThreadName;
+import org.apache.iotdb.db.exception.StartupException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cn.edu.tsinghua.iotdb.concurrent.IoTDBThreadPoolFactory;
-import cn.edu.tsinghua.iotdb.concurrent.ThreadName;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
+import org.apache.iotdb.db.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.db.concurrent.ThreadName;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.StartupException;
/**
* A service that triggers close and merge operation regularly
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/IService.java b/iotdb/src/main/java/org/apache/iotdb/db/service/IService.java
similarity index 70%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/IService.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/IService.java
index a713aa87896..b196a70d54a 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/IService.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/IService.java
@@ -1,6 +1,7 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.exception.StartupException;
public interface IService {
/**
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/IoTDB.java b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDB.java
similarity index 76%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/IoTDB.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/IoTDB.java
index fd1fb97177b..3a38a8a4904 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/IoTDB.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDB.java
@@ -1,19 +1,26 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
-import cn.edu.tsinghua.iotdb.concurrent.IoTDBDefaultThreadExceptionHandler;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.engine.memcontrol.BasicMemController;
-import cn.edu.tsinghua.iotdb.exception.*;
-import cn.edu.tsinghua.iotdb.exception.builder.ExceptionBuilder;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.monitor.StatMonitor;
-import cn.edu.tsinghua.iotdb.postback.receiver.ServerManager;
-import cn.edu.tsinghua.iotdb.query.control.FileReaderManager;
-import cn.edu.tsinghua.iotdb.writelog.manager.MultiFileLogNodeManager;
-import cn.edu.tsinghua.iotdb.writelog.manager.WriteLogNodeManager;
+import org.apache.iotdb.db.concurrent.IoTDBDefaultThreadExceptionHandler;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.engine.memcontrol.BasicMemController;
+import org.apache.iotdb.db.exception.*;
+import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.monitor.StatMonitor;
+import org.apache.iotdb.db.postback.receiver.ServerManager;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
+import org.apache.iotdb.db.writelog.manager.WriteLogNodeManager;
+import org.apache.iotdb.db.concurrent.IoTDBDefaultThreadExceptionHandler;
+import org.apache.iotdb.db.exception.*;
+import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.postback.receiver.ServerManager;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
+import org.apache.iotdb.db.writelog.manager.WriteLogNodeManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBMBean.java b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBMBean.java
new file mode 100644
index 00000000000..b95c984dc77
--- /dev/null
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBMBean.java
@@ -0,0 +1,10 @@
+package org.apache.iotdb.db.service;
+
+import java.io.IOException;
+
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+
+public interface IoTDBMBean {
+ void stop() throws FileNodeManagerException, IOException;
+}
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCService.java b/iotdb/src/main/java/org/apache/iotdb/db/service/JDBCService.java
similarity index 92%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCService.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/JDBCService.java
index ac80378ff33..5d032f3bbb8 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCService.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/JDBCService.java
@@ -1,7 +1,13 @@
-package cn.edu.tsinghua.iotdb.service;
-
-import java.io.IOException;
+package org.apache.iotdb.db.service;
+import org.apache.iotdb.db.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.db.concurrent.ThreadName;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.service.rpc.thrift.TSIService;
+import org.apache.iotdb.service.rpc.thrift.TSIService.Processor;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TBinaryProtocol.Factory;
import org.apache.thrift.server.TServer;
@@ -11,14 +17,7 @@ import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cn.edu.tsinghua.iotdb.concurrent.IoTDBThreadPoolFactory;
-import cn.edu.tsinghua.iotdb.concurrent.ThreadName;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
-import cn.edu.tsinghua.service.rpc.thrift.TSIService;
-import cn.edu.tsinghua.service.rpc.thrift.TSIService.Processor;
+import java.io.IOException;
/**
* A service to handle jdbc request from client.
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCServiceEventHandler.java b/iotdb/src/main/java/org/apache/iotdb/db/service/JDBCServiceEventHandler.java
similarity index 96%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCServiceEventHandler.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/JDBCServiceEventHandler.java
index 4d849c63cb9..02cbc21bb22 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCServiceEventHandler.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/JDBCServiceEventHandler.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TProtocol;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCServiceMBean.java b/iotdb/src/main/java/org/apache/iotdb/db/service/JDBCServiceMBean.java
similarity index 60%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCServiceMBean.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/JDBCServiceMBean.java
index cace887f91e..fd5fc583bcb 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JDBCServiceMBean.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/JDBCServiceMBean.java
@@ -1,6 +1,7 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.exception.StartupException;
public interface JDBCServiceMBean {
String getJDBCServiceStatus();
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JMXService.java b/iotdb/src/main/java/org/apache/iotdb/db/service/JMXService.java
similarity index 95%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JMXService.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/JMXService.java
index 10f268cb221..fdf0e293635 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/JMXService.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/JMXService.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
import java.io.IOException;
import java.lang.management.ManagementFactory;
@@ -17,11 +17,12 @@ import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
+import org.apache.iotdb.db.exception.StartupException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.exception.StartupException;
public class JMXService implements IService {
private static final Logger LOGGER = LoggerFactory.getLogger(JMXService.class);
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/Monitor.java b/iotdb/src/main/java/org/apache/iotdb/db/service/Monitor.java
similarity index 89%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/Monitor.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/Monitor.java
index fbee61deb55..264d55e7ea6 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/Monitor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/Monitor.java
@@ -1,12 +1,13 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
import java.io.File;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.utils.OpenFileNumUtil;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.utils.OpenFileNumUtil;
+import org.apache.iotdb.db.exception.StartupException;
import org.apache.commons.io.FileUtils;
+import org.apache.iotdb.db.exception.StartupException;
public class Monitor implements MonitorMBean, IService{
private IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/MonitorMBean.java b/iotdb/src/main/java/org/apache/iotdb/db/service/MonitorMBean.java
similarity index 92%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/MonitorMBean.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/MonitorMBean.java
index 48d6a9c77f3..64f34075566 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/MonitorMBean.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/MonitorMBean.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
public interface MonitorMBean {
long getDataSizeInByte();
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/RegisterManager.java b/iotdb/src/main/java/org/apache/iotdb/db/service/RegisterManager.java
similarity index 86%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/RegisterManager.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/RegisterManager.java
index e946f91b6d1..7d8d4f2f5fe 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/RegisterManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/RegisterManager.java
@@ -1,12 +1,13 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
import java.util.ArrayList;
import java.util.List;
+import org.apache.iotdb.db.exception.StartupException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
+import org.apache.iotdb.db.exception.StartupException;
public class RegisterManager {
private static final Logger LOGGER = LoggerFactory.getLogger(RegisterManager.class);
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/ServiceType.java b/iotdb/src/main/java/org/apache/iotdb/db/service/ServiceType.java
similarity index 95%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/ServiceType.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/ServiceType.java
index e8491877d92..e64f4a94709 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/ServiceType.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/ServiceType.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
public enum ServiceType {
FILE_NODE_SERVICE("File Node ServerService",""),
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/StartupCheck.java b/iotdb/src/main/java/org/apache/iotdb/db/service/StartupCheck.java
similarity index 52%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/StartupCheck.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/StartupCheck.java
index 9225735f136..6131f19e3df 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/StartupCheck.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/StartupCheck.java
@@ -1,6 +1,7 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.exception.StartupException;
public interface StartupCheck {
/**
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/StartupChecks.java b/iotdb/src/main/java/org/apache/iotdb/db/service/StartupChecks.java
similarity index 90%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/StartupChecks.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/StartupChecks.java
index 6bac350cf3b..b65efe8ef8f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/StartupChecks.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/StartupChecks.java
@@ -1,15 +1,16 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
import java.util.ArrayList;
import java.util.List;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
-import cn.edu.tsinghua.iotdb.utils.CommonUtils;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.utils.CommonUtils;
+import org.apache.iotdb.db.exception.StartupException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBConstant;
public class StartupChecks {
private static final Logger LOGGER = LoggerFactory.getLogger(StartupChecks.class);
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/TSServiceImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
similarity index 93%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/TSServiceImpl.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index 3439f97fb77..5bd8d9e6a22 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/TSServiceImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -1,32 +1,39 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
-import cn.edu.tsinghua.iotdb.auth.AuthException;
-import cn.edu.tsinghua.iotdb.auth.AuthorityChecker;
-import cn.edu.tsinghua.iotdb.auth.authorizer.IAuthorizer;
-import cn.edu.tsinghua.iotdb.auth.authorizer.LocalFileAuthorizer;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.exception.qp.IllegalASTFormatException;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.metadata.Metadata;
-import cn.edu.tsinghua.iotdb.qp.QueryProcessor;
-import cn.edu.tsinghua.iotdb.qp.executor.OverflowQPExecutor;
-import cn.edu.tsinghua.iotdb.qp.logical.Operator;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.QueryPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.AuthorPlan;
-import cn.edu.tsinghua.iotdb.query.control.OpenedFilePathsManager;
-import cn.edu.tsinghua.iotdb.query.control.QueryTokenManager;
-import cn.edu.tsinghua.service.rpc.thrift.*;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.auth.AuthException;
+import org.apache.iotdb.db.auth.AuthorityChecker;
+import org.apache.iotdb.db.auth.authorizer.IAuthorizer;
+import org.apache.iotdb.db.auth.authorizer.LocalFileAuthorizer;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.exception.qp.IllegalASTFormatException;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.metadata.Metadata;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.qp.executor.OverflowQPExecutor;
+import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.crud.QueryPlan;
+import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
+import org.apache.iotdb.db.query.control.OpenedFilePathsManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.service.rpc.thrift.*;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.metadata.Metadata;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.qp.logical.Operator;
import org.apache.thrift.TException;
import org.apache.thrift.server.ServerContext;
import org.slf4j.Logger;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/Utils.java b/iotdb/src/main/java/org/apache/iotdb/db/service/Utils.java
similarity index 83%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/Utils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/service/Utils.java
index 3c965fb5d4d..3f37384fa2d 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/service/Utils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/Utils.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.service;
+package org.apache.iotdb.db.service;
import java.io.IOException;
import java.nio.ByteBuffer;
@@ -7,15 +7,16 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import cn.edu.tsinghua.iotdb.metadata.ColumnSchema;
-import cn.edu.tsinghua.service.rpc.thrift.TSColumnSchema;
-import cn.edu.tsinghua.service.rpc.thrift.TSDataValue;
-import cn.edu.tsinghua.service.rpc.thrift.TSQueryDataSet;
-import cn.edu.tsinghua.service.rpc.thrift.TSRowRecord;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.read.common.Field;
-import cn.edu.tsinghua.tsfile.read.common.RowRecord;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.service.rpc.thrift.TSColumnSchema;
+import org.apache.iotdb.service.rpc.thrift.TSDataValue;
+import org.apache.iotdb.service.rpc.thrift.TSQueryDataSet;
+import org.apache.iotdb.service.rpc.thrift.TSRowRecord;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.read.common.Field;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.metadata.ColumnSchema;
/**
* TimeValuePairUtils to convert between thrift format and TsFile format
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/ParseGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/ParseGenerator.java
similarity index 52%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/ParseGenerator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/ParseGenerator.java
index f15f1721687..f15b0bbaeb3 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/ParseGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/ParseGenerator.java
@@ -1,10 +1,13 @@
-package cn.edu.tsinghua.iotdb.sql;
+package org.apache.iotdb.db.sql;
-import cn.edu.tsinghua.iotdb.sql.parse.ASTNode;
-import cn.edu.tsinghua.iotdb.sql.parse.ParseDriver;
-import cn.edu.tsinghua.iotdb.sql.parse.ParseException;
+import org.apache.iotdb.db.sql.parse.ASTNode;
+import org.apache.iotdb.db.sql.parse.ParseDriver;
+import org.apache.iotdb.db.sql.parse.ParseException;
+import org.apache.iotdb.db.sql.parse.ASTNode;
+import org.apache.iotdb.db.sql.parse.ParseDriver;
+import org.apache.iotdb.db.sql.parse.ParseException;
/**
* ParseContextGenerator is a class that offers methods to generate ASTNode Tree
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTErrorNode.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTErrorNode.java
similarity index 94%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTErrorNode.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTErrorNode.java
index 7253bdc1762..c61683daa5b 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTErrorNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTErrorNode.java
@@ -1,5 +1,5 @@
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.Token;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTNode.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTNode.java
similarity index 99%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTNode.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTNode.java
index e740691c243..83c25ef037e 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTNode.java
@@ -1,5 +1,5 @@
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
import java.io.Serializable;
import java.util.ArrayDeque;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTNodeOrigin.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTNodeOrigin.java
similarity index 98%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTNodeOrigin.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTNodeOrigin.java
index 58a3c12e1e3..975c1920b90 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ASTNodeOrigin.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ASTNodeOrigin.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
/**
* ASTNodeOrigin contains contextual information about the object from whose
* definition a particular ASTNode originated. For example, suppose a view v is
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/Node.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/Node.java
similarity index 97%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/Node.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/Node.java
index 4efcab961b8..85c7503ecfd 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/Node.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/Node.java
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
import java.util.List;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseDriver.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseDriver.java
similarity index 99%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseDriver.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseDriver.java
index 5e7d344c036..7c1e36775b5 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseDriver.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseDriver.java
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseError.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseError.java
similarity index 94%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseError.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseError.java
index 51c12e8b738..b983e957208 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseError.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseError.java
@@ -1,5 +1,5 @@
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
import org.antlr.runtime.BaseRecognizer;
import org.antlr.runtime.RecognitionException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseException.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseException.java
similarity index 92%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseException.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseException.java
index ed08a0b7b97..5322b5aad4f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseException.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseException.java
@@ -1,5 +1,5 @@
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseUtils.java
similarity index 93%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseUtils.java
index 15fd91d5464..aee5acda780 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/sql/parse/ParseUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/ParseUtils.java
@@ -1,5 +1,5 @@
-package cn.edu.tsinghua.iotdb.sql.parse;
+package org.apache.iotdb.db.sql.parse;
/**
* Library of utility functions used in the parse code.
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/AuthUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/AuthUtils.java
similarity index 96%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/AuthUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/AuthUtils.java
index 5d130060aa3..c82b4087160 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/AuthUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/AuthUtils.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.iotdb.auth.AuthException;
-import cn.edu.tsinghua.iotdb.auth.entity.PathPrivilege;
-import cn.edu.tsinghua.iotdb.auth.entity.PrivilegeType;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
+import org.apache.iotdb.db.auth.AuthException;
+import org.apache.iotdb.db.auth.entity.PathPrivilege;
+import org.apache.iotdb.db.auth.entity.PrivilegeType;
+import org.apache.iotdb.db.conf.IoTDBConstant;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/CommonUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/CommonUtils.java
similarity index 97%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/CommonUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/CommonUtils.java
index c05cfa19601..3bde3d5c6bf 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/CommonUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/CommonUtils.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/FileSchemaUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/FileSchemaUtils.java
similarity index 79%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/FileSchemaUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/FileSchemaUtils.java
index bcc2d0bac4a..4ecbc4c5493 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/FileSchemaUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/FileSchemaUtils.java
@@ -1,16 +1,18 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import java.util.List;
import java.util.Map.Entry;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
import org.json.JSONArray;
import org.json.JSONObject;
-import cn.edu.tsinghua.iotdb.metadata.ColumnSchema;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.tsfile.common.constant.JsonFormatConstant;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.tsfile.common.constant.JsonFormatConstant;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
public class FileSchemaUtils {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/FileUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/FileUtils.java
similarity index 97%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/FileUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/FileUtils.java
index c82fc30b046..9e037a19c7a 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/FileUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/FileUtils.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import java.io.File;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/IOUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/IOUtils.java
similarity index 95%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/IOUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/IOUtils.java
index 80c56b585ad..5dee450845b 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/IOUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/IOUtils.java
@@ -1,11 +1,10 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.iotdb.auth.entity.PathPrivilege;
-import cn.edu.tsinghua.iotdb.auth.entity.PrivilegeType;
+import org.apache.iotdb.db.auth.entity.PathPrivilege;
+import org.apache.iotdb.db.auth.entity.PrivilegeType;
import java.io.*;
import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
public class IOUtils {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/LoadDataUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/LoadDataUtils.java
similarity index 87%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/LoadDataUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/LoadDataUtils.java
index 528a55c56b9..287afada45d 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/LoadDataUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/LoadDataUtils.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -12,20 +12,25 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.metadata.ColumnSchema;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
/**
* @author kangrong
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/MemUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/MemUtils.java
similarity index 90%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/MemUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/MemUtils.java
index cbb1bc4ed09..2f5ff2ade2a 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/MemUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/MemUtils.java
@@ -1,10 +1,10 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.tsfile.utils.Binary;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.DataPoint;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.*;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.tsfile.utils.Binary;
+import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/OpenFileNumUtil.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/OpenFileNumUtil.java
similarity index 97%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/OpenFileNumUtil.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/OpenFileNumUtil.java
index 68349e8bf19..0a55efcc62f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/OpenFileNumUtil.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/OpenFileNumUtil.java
@@ -1,8 +1,8 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.iotdb.conf.directories.Directories;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PostbackUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/PostbackUtils.java
similarity index 97%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PostbackUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/PostbackUtils.java
index a6802e560a5..a9a3d3085c6 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PostbackUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/PostbackUtils.java
@@ -1,12 +1,12 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
+
+import org.apache.iotdb.db.postback.conf.PostBackSenderDescriptor;
import java.io.File;
import java.text.DecimalFormat;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
-
-import cn.edu.tsinghua.iotdb.postback.conf.PostBackSenderDescriptor;
+import java.util.Set;
/**
* @author lta
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayList.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java
similarity index 99%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayList.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java
index 3092bbad49c..cea1b33f820 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayList.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import java.lang.reflect.Array;
import java.util.ArrayList;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayListFactory.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayListFactory.java
similarity index 77%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayListFactory.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayListFactory.java
index d79a40fb52c..aa23e4f156f 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayListFactory.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayListFactory.java
@@ -1,8 +1,8 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.Binary;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.Binary;
public class PrimitiveArrayListFactory {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/RandomDeleteCache.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/RandomDeleteCache.java
similarity index 90%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/RandomDeleteCache.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/RandomDeleteCache.java
index b8cdacc8823..0c503788635 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/RandomDeleteCache.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/RandomDeleteCache.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.tsfile.exception.cache.CacheException;
-import cn.edu.tsinghua.tsfile.common.cache.Cache;
+import org.apache.iotdb.tsfile.exception.cache.CacheException;
+import org.apache.iotdb.tsfile.common.cache.Cache;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/RecordUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/RecordUtils.java
similarity index 90%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/RecordUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/RecordUtils.java
index 71c473bfafc..7b7955dd4d3 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/RecordUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/RecordUtils.java
@@ -1,11 +1,11 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.tsfile.common.constant.JsonFormatConstant;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.Binary;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.*;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.tsfile.common.constant.JsonFormatConstant;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.Binary;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.*;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TimeValuePair.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/TimeValuePair.java
similarity index 97%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TimeValuePair.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/TimeValuePair.java
index 20bf706f57d..5a4ccff9316 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TimeValuePair.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/TimeValuePair.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import java.io.Serializable;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TimeValuePairUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/TimeValuePairUtils.java
similarity index 86%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TimeValuePairUtils.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/TimeValuePairUtils.java
index 540b9db4d71..07d99040d3a 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TimeValuePairUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/TimeValuePairUtils.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.read.common.BatchData;
public class TimeValuePairUtils {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TsPrimitiveType.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/TsPrimitiveType.java
similarity index 96%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TsPrimitiveType.java
rename to iotdb/src/main/java/org/apache/iotdb/db/utils/TsPrimitiveType.java
index 8a0da66d23d..82d239369f3 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/utils/TsPrimitiveType.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/TsPrimitiveType.java
@@ -1,8 +1,8 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.Binary;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.Binary;
import java.io.Serializable;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/LogPosition.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/LogPosition.java
similarity index 72%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/LogPosition.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/LogPosition.java
index eb0a82c6ce7..fdb4236b9af 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/LogPosition.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/LogPosition.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.writelog;
+package org.apache.iotdb.db.writelog;
public class LogPosition {
public String logPath;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/RecoverStage.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/RecoverStage.java
similarity index 95%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/RecoverStage.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/RecoverStage.java
index 15c9eb6c4c3..2dc6076bcaa 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/RecoverStage.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/RecoverStage.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.writelog;
+package org.apache.iotdb.db.writelog;
public enum RecoverStage {
/**
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/ILogReader.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogReader.java
similarity index 69%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/ILogReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogReader.java
index c6e6aa4ef77..f441b26566e 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/ILogReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogReader.java
@@ -1,6 +1,6 @@
-package cn.edu.tsinghua.iotdb.writelog.io;
+package org.apache.iotdb.db.writelog.io;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import java.io.File;
import java.io.FileNotFoundException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/ILogWriter.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java
similarity index 80%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/ILogWriter.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java
index 0d8c84de2c4..81d6a9468e6 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/ILogWriter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.writelog.io;
+package org.apache.iotdb.db.writelog.io;
import java.io.IOException;
import java.util.List;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/LogWriter.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/LogWriter.java
similarity index 96%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/LogWriter.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/io/LogWriter.java
index 4398295e6a8..ad85098a8c4 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/LogWriter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/LogWriter.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.writelog.io;
+package org.apache.iotdb.db.writelog.io;
import java.io.File;
import java.io.FileOutputStream;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/RAFLogReader.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/RAFLogReader.java
similarity index 91%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/RAFLogReader.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/io/RAFLogReader.java
index e77cd646fbc..f436d49af09 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/io/RAFLogReader.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/RAFLogReader.java
@@ -1,7 +1,8 @@
-package cn.edu.tsinghua.iotdb.writelog.io;
+package org.apache.iotdb.db.writelog.io;
-import cn.edu.tsinghua.iotdb.writelog.transfer.PhysicalPlanLogTransfer;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/manager/MultiFileLogNodeManager.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
similarity index 89%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/manager/MultiFileLogNodeManager.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
index 5628a59c7b7..0e715797da6 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/manager/MultiFileLogNodeManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
@@ -1,15 +1,18 @@
-package cn.edu.tsinghua.iotdb.writelog.manager;
+package org.apache.iotdb.db.writelog.manager;
-import cn.edu.tsinghua.iotdb.concurrent.ThreadName;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
-import cn.edu.tsinghua.iotdb.service.IService;
-import cn.edu.tsinghua.iotdb.service.ServiceType;
-import cn.edu.tsinghua.iotdb.writelog.node.ExclusiveWriteLogNode;
-import cn.edu.tsinghua.iotdb.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.concurrent.ThreadName;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.service.IService;
+import org.apache.iotdb.db.service.ServiceType;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.concurrent.ThreadName;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.exception.StartupException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/manager/WriteLogNodeManager.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/WriteLogNodeManager.java
similarity index 85%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/manager/WriteLogNodeManager.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/WriteLogNodeManager.java
index a4a12a1e372..b477aba0785 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/manager/WriteLogNodeManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/WriteLogNodeManager.java
@@ -1,7 +1,8 @@
-package cn.edu.tsinghua.iotdb.writelog.manager;
+package org.apache.iotdb.db.writelog.manager;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
-import cn.edu.tsinghua.iotdb.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.exception.RecoverException;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/node/ExclusiveWriteLogNode.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
similarity index 87%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/node/ExclusiveWriteLogNode.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
index 0dfdabc1bff..4b5a16c8ba5 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/node/ExclusiveWriteLogNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
@@ -1,17 +1,21 @@
-package cn.edu.tsinghua.iotdb.writelog.node;
+package org.apache.iotdb.db.writelog.node;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
-import cn.edu.tsinghua.iotdb.utils.MemUtils;
-import cn.edu.tsinghua.iotdb.writelog.LogPosition;
-import cn.edu.tsinghua.iotdb.writelog.io.ILogWriter;
-import cn.edu.tsinghua.iotdb.writelog.io.LogWriter;
-import cn.edu.tsinghua.iotdb.writelog.recover.ExclusiveLogRecoverPerformer;
-import cn.edu.tsinghua.iotdb.writelog.recover.RecoverPerformer;
-import cn.edu.tsinghua.iotdb.writelog.transfer.PhysicalPlanLogTransfer;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.db.writelog.LogPosition;
+import org.apache.iotdb.db.writelog.io.ILogWriter;
+import org.apache.iotdb.db.writelog.io.LogWriter;
+import org.apache.iotdb.db.writelog.recover.ExclusiveLogRecoverPerformer;
+import org.apache.iotdb.db.writelog.recover.RecoverPerformer;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.commons.io.FileUtils;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.writelog.recover.ExclusiveLogRecoverPerformer;
+import org.apache.iotdb.db.writelog.recover.RecoverPerformer;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/node/WriteLogNode.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/WriteLogNode.java
similarity index 85%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/node/WriteLogNode.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/node/WriteLogNode.java
index 74bac5d1131..2b02cfe8659 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/node/WriteLogNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/WriteLogNode.java
@@ -1,8 +1,9 @@
-package cn.edu.tsinghua.iotdb.writelog.node;
+package org.apache.iotdb.db.writelog.node;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
-import cn.edu.tsinghua.iotdb.writelog.LogPosition;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.writelog.LogPosition;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.exception.RecoverException;
import java.io.IOException;
import java.util.List;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/ExclusiveLogRecoverPerformer.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/ExclusiveLogRecoverPerformer.java
similarity index 94%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/ExclusiveLogRecoverPerformer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/ExclusiveLogRecoverPerformer.java
index 75abc17fb6b..9bfd30c4017 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/ExclusiveLogRecoverPerformer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/ExclusiveLogRecoverPerformer.java
@@ -1,16 +1,18 @@
-package cn.edu.tsinghua.iotdb.writelog.recover;
+package org.apache.iotdb.db.writelog.recover;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.writelog.RecoverStage;
-import cn.edu.tsinghua.iotdb.writelog.replay.ConcreteLogReplayer;
-import cn.edu.tsinghua.iotdb.writelog.io.RAFLogReader;
-import cn.edu.tsinghua.iotdb.writelog.replay.LogReplayer;
-import cn.edu.tsinghua.iotdb.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.writelog.RecoverStage;
+import org.apache.iotdb.db.writelog.replay.ConcreteLogReplayer;
+import org.apache.iotdb.db.writelog.io.RAFLogReader;
+import org.apache.iotdb.db.writelog.replay.LogReplayer;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
import org.apache.commons.io.FileUtils;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.RecoverException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -20,7 +22,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import static cn.edu.tsinghua.iotdb.writelog.RecoverStage.*;
+import static org.apache.iotdb.db.writelog.RecoverStage.*;
public class ExclusiveLogRecoverPerformer implements RecoverPerformer {
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/FileNodeRecoverPerformer.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/FileNodeRecoverPerformer.java
similarity index 68%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/FileNodeRecoverPerformer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/FileNodeRecoverPerformer.java
index ca4c579d4d2..50b83c42fa7 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/FileNodeRecoverPerformer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/FileNodeRecoverPerformer.java
@@ -1,9 +1,12 @@
-package cn.edu.tsinghua.iotdb.writelog.recover;
+package org.apache.iotdb.db.writelog.recover;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.FileNodeProcessorException;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.FileNodeProcessorException;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.FileNodeProcessorException;
+import org.apache.iotdb.db.exception.RecoverException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/RecoverPerformer.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/RecoverPerformer.java
similarity index 57%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/RecoverPerformer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/RecoverPerformer.java
index 6035098b0fd..f8e71d71e33 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/recover/RecoverPerformer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/RecoverPerformer.java
@@ -1,6 +1,7 @@
-package cn.edu.tsinghua.iotdb.writelog.recover;
+package org.apache.iotdb.db.writelog.recover;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.exception.RecoverException;
public interface RecoverPerformer {
/**
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/replay/ConcreteLogReplayer.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/replay/ConcreteLogReplayer.java
similarity index 73%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/replay/ConcreteLogReplayer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/replay/ConcreteLogReplayer.java
index 8f124d698bd..de256bbe23d 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/replay/ConcreteLogReplayer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/replay/ConcreteLogReplayer.java
@@ -1,19 +1,21 @@
-package cn.edu.tsinghua.iotdb.writelog.replay;
+package org.apache.iotdb.db.writelog.replay;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.utils.Pair;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.DataPoint;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
import java.util.List;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/replay/LogReplayer.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/replay/LogReplayer.java
new file mode 100644
index 00000000000..35c90795da6
--- /dev/null
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/replay/LogReplayer.java
@@ -0,0 +1,8 @@
+package org.apache.iotdb.db.writelog.replay;
+
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+
+public interface LogReplayer {
+ void replay(PhysicalPlan plan) throws ProcessorException;
+}
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/Codec.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/Codec.java
similarity index 57%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/Codec.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/Codec.java
index 33d62a00a37..71c3ac0257b 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/Codec.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/Codec.java
@@ -1,6 +1,6 @@
-package cn.edu.tsinghua.iotdb.writelog.transfer;
+package org.apache.iotdb.db.writelog.transfer;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import java.io.IOException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/PhysicalPlanCodec.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/PhysicalPlanCodec.java
similarity index 94%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/PhysicalPlanCodec.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/PhysicalPlanCodec.java
index 67e06faa671..7534e2a73ec 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/PhysicalPlanCodec.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/PhysicalPlanCodec.java
@@ -1,13 +1,13 @@
-package cn.edu.tsinghua.iotdb.writelog.transfer;
+package org.apache.iotdb.db.writelog.transfer;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.utils.BytesUtils;
-import cn.edu.tsinghua.tsfile.utils.Pair;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.BytesUtils;
+import org.apache.iotdb.tsfile.utils.Pair;
import java.io.IOException;
import java.nio.ByteBuffer;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/PhysicalPlanLogTransfer.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/PhysicalPlanLogTransfer.java
similarity index 86%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/PhysicalPlanLogTransfer.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/PhysicalPlanLogTransfer.java
index 1cd08e5941a..0979f305220 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/PhysicalPlanLogTransfer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/PhysicalPlanLogTransfer.java
@@ -1,7 +1,8 @@
-package cn.edu.tsinghua.iotdb.writelog.transfer;
+package org.apache.iotdb.db.writelog.transfer;
-import cn.edu.tsinghua.iotdb.exception.WALOverSizedException;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.exception.WALOverSizedException;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.exception.WALOverSizedException;
import java.io.IOException;
import java.nio.BufferOverflowException;
diff --git a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/SystemLogOperator.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/SystemLogOperator.java
similarity index 72%
rename from iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/SystemLogOperator.java
rename to iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/SystemLogOperator.java
index dee4ae74958..1d4351263e7 100644
--- a/iotdb/src/main/java/cn/edu/tsinghua/iotdb/writelog/transfer/SystemLogOperator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/SystemLogOperator.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.writelog.transfer;
+package org.apache.iotdb.db.writelog.transfer;
/**
- * To avoid conflict with cn.edu.thu.tsfiledb.qp.constant.SQLConstant.Operator.
+ * To avoid conflict with org.apache.iotdb.tsfiledb.qp.constant.SQLConstant.Operator.
*/
public class SystemLogOperator {
public static final int INSERT = 0;
diff --git a/iotdb/src/test/java/PerformanceTest.java b/iotdb/src/test/java/PerformanceTest.java
index 0b9954698cb..547c88b37a6 100644
--- a/iotdb/src/test/java/PerformanceTest.java
+++ b/iotdb/src/test/java/PerformanceTest.java
@@ -1,15 +1,15 @@
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.query.executor.EngineQueryRouter;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.common.RowRecord;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.expression.QueryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.TimeFilter;
-import cn.edu.tsinghua.tsfile.read.filter.ValueFilter;
-import cn.edu.tsinghua.tsfile.read.filter.basic.Filter;
-import cn.edu.tsinghua.tsfile.read.filter.factory.FilterFactory;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.query.executor.EngineQueryRouter;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.TimeFilter;
+import org.apache.iotdb.tsfile.read.filter.ValueFilter;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.factory.FilterFactory;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/jdbc/JDBCClientTest.java b/iotdb/src/test/java/cn/edu/tsinghua/iotdb/jdbc/JDBCClientTest.java
deleted file mode 100644
index 14540c0a4ae..00000000000
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/jdbc/JDBCClientTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package cn.edu.tsinghua.iotdb.jdbc;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-public class JDBCClientTest {
-
- public static void main(String[] args) throws ClassNotFoundException, SQLException {
- Class.forName(Config.JDBC_DRIVER_NAME);
- Connection connection = null;
- try {
- connection = DriverManager.getConnection(Config.IOTDB_URL_PREFIX+"127.0.0.1:6667/", "root", "root");
- DatabaseMetaData databaseMetaData = connection.getMetaData();
-// ResultSet resultSet = databaseMetaData.getColumns(null, null, "root.vehicle.d1.s0", null);
-// while(resultSet.next()){
-// //System.out.println(String.format("column %s, type %s", resultSet.getString("COLUMN_NAME"), resultSet.getString("COLUMN_TYPE")));
-// System.out.println(String.format("column %s, type %s", resultSet.getString(0), resultSet.getString(1)));
-// }
-
- ResultSet resultSet = databaseMetaData.getColumns(null, null, "root.*", null);
- while(resultSet.next()){
- //System.out.println(String.format("column %s, type %s", resultSet.getString("COLUMN_NAME"), resultSet.getString("COLUMN_TYPE")));
- System.out.println(String.format("column %s", resultSet.getString(0)));
- }
- } finally {
- connection.close();
- }
- }
-
-}
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/OpenedFilePathsManagerTest.java b/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/OpenedFilePathsManagerTest.java
deleted file mode 100644
index 515925594ff..00000000000
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/OpenedFilePathsManagerTest.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package cn.edu.tsinghua.iotdb.query.control;
-
-
-public class OpenedFilePathsManagerTest {
-}
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFIleRoleAccessorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFIleRoleAccessorTest.java
similarity index 88%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFIleRoleAccessorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFIleRoleAccessorTest.java
index b5ab9a4f098..f041248a46f 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFIleRoleAccessorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFIleRoleAccessorTest.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.auth;
+package org.apache.iotdb.db.auth;
-import cn.edu.tsinghua.iotdb.auth.Role.LocalFileRoleAccessor;
-import cn.edu.tsinghua.iotdb.auth.entity.PathPrivilege;
-import cn.edu.tsinghua.iotdb.auth.entity.Role;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.auth.Role.LocalFileRoleAccessor;
+import org.apache.iotdb.db.auth.entity.PathPrivilege;
+import org.apache.iotdb.db.auth.entity.Role;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileAuthorizerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileAuthorizerTest.java
similarity index 96%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileAuthorizerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileAuthorizerTest.java
index 7bf2b4e2390..35aa357743f 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileAuthorizerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileAuthorizerTest.java
@@ -1,10 +1,10 @@
-package cn.edu.tsinghua.iotdb.auth;
+package org.apache.iotdb.db.auth;
-import cn.edu.tsinghua.iotdb.auth.authorizer.IAuthorizer;
-import cn.edu.tsinghua.iotdb.auth.authorizer.LocalFileAuthorizer;
-import cn.edu.tsinghua.iotdb.auth.entity.User;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.auth.authorizer.IAuthorizer;
+import org.apache.iotdb.db.auth.authorizer.LocalFileAuthorizer;
+import org.apache.iotdb.db.auth.entity.User;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileRoleManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileRoleManagerTest.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileRoleManagerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileRoleManagerTest.java
index bdbbd0bfbc5..30b0d41044f 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileRoleManagerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileRoleManagerTest.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.auth;
+package org.apache.iotdb.db.auth;
-import cn.edu.tsinghua.iotdb.auth.Role.LocalFileRoleManager;
-import cn.edu.tsinghua.iotdb.auth.entity.PathPrivilege;
-import cn.edu.tsinghua.iotdb.auth.entity.Role;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.auth.Role.LocalFileRoleManager;
+import org.apache.iotdb.db.auth.entity.PathPrivilege;
+import org.apache.iotdb.db.auth.entity.Role;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileUserAccessorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileUserAccessorTest.java
similarity index 91%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileUserAccessorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileUserAccessorTest.java
index 11b97e57ace..3cbacb044a2 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileUserAccessorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileUserAccessorTest.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.auth;
+package org.apache.iotdb.db.auth;
-import cn.edu.tsinghua.iotdb.auth.entity.PathPrivilege;
-import cn.edu.tsinghua.iotdb.auth.entity.User;
-import cn.edu.tsinghua.iotdb.auth.user.LocalFileUserAccessor;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.auth.entity.PathPrivilege;
+import org.apache.iotdb.db.auth.entity.User;
+import org.apache.iotdb.db.auth.user.LocalFileUserAccessor;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileUserManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileUserManagerTest.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileUserManagerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileUserManagerTest.java
index ec454a81655..8c9276c2af1 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/auth/LocalFileUserManagerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/auth/LocalFileUserManagerTest.java
@@ -1,11 +1,11 @@
-package cn.edu.tsinghua.iotdb.auth;
+package org.apache.iotdb.db.auth;
-import cn.edu.tsinghua.iotdb.auth.entity.PathPrivilege;
-import cn.edu.tsinghua.iotdb.auth.entity.User;
-import cn.edu.tsinghua.iotdb.auth.user.LocalFileUserManager;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.AuthUtils;
+import org.apache.iotdb.db.auth.entity.PathPrivilege;
+import org.apache.iotdb.db.auth.entity.User;
+import org.apache.iotdb.db.auth.user.LocalFileUserManager;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.AuthUtils;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/concurrent/IoTDBDefaultThreadExceptionHandlerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/concurrent/IoTDBDefaultThreadExceptionHandlerTest.java
similarity index 89%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/concurrent/IoTDBDefaultThreadExceptionHandlerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/concurrent/IoTDBDefaultThreadExceptionHandlerTest.java
index eb094b935ae..465d28e3fad 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/concurrent/IoTDBDefaultThreadExceptionHandlerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/concurrent/IoTDBDefaultThreadExceptionHandlerTest.java
@@ -1,12 +1,13 @@
-package cn.edu.tsinghua.iotdb.concurrent;
-
-import static org.junit.Assert.*;
-import java.util.concurrent.atomic.AtomicInteger;
+package org.apache.iotdb.db.concurrent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.junit.Assert.assertEquals;
+
public class IoTDBDefaultThreadExceptionHandlerTest {
private Thread.UncaughtExceptionHandler handler;
private AtomicInteger count;
@@ -31,8 +32,8 @@ public class IoTDBDefaultThreadExceptionHandlerTest {
TestThread thread = new TestThread();
thread.start();
}
- Thread.sleep(100);
- assertEquals(count.get(), num);
+ Thread.sleep(500);
+ assertEquals(num, count.get());
}
class TestThread extends Thread{
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/concurrent/IoTDBThreadPoolFactoryTest.java b/iotdb/src/test/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactoryTest.java
similarity index 99%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/concurrent/IoTDBThreadPoolFactoryTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactoryTest.java
index 588763501d9..4cb40ce2623 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/concurrent/IoTDBThreadPoolFactoryTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactoryTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.concurrent;
+package org.apache.iotdb.db.concurrent;
import static org.junit.Assert.*;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/MetadataManagerHelper.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/MetadataManagerHelper.java
similarity index 96%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/MetadataManagerHelper.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/MetadataManagerHelper.java
index 8abda8f43c2..9fce3f70476 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/MetadataManagerHelper.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/MetadataManagerHelper.java
@@ -1,6 +1,7 @@
-package cn.edu.tsinghua.iotdb.engine;
+package org.apache.iotdb.db.engine;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.metadata.MManager;
/**
* @author liukun
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/PathUtils.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/PathUtils.java
similarity index 88%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/PathUtils.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/PathUtils.java
index e21e1090484..f55cdc55b2a 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/PathUtils.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/PathUtils.java
@@ -1,10 +1,10 @@
-package cn.edu.tsinghua.iotdb.engine;
+package org.apache.iotdb.db.engine;
import java.io.File;
-import cn.edu.tsinghua.iotdb.conf.directories.Directories;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
public class PathUtils {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/ProcessorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/ProcessorTest.java
similarity index 92%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/ProcessorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/ProcessorTest.java
index ed017f11f65..140803b3c9c 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/ProcessorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/ProcessorTest.java
@@ -1,15 +1,16 @@
-package cn.edu.tsinghua.iotdb.engine;
+package org.apache.iotdb.db.engine;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.exception.ProcessorException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
import java.io.IOException;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteBenchmark.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteBenchmark.java
similarity index 86%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteBenchmark.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteBenchmark.java
index e315d92c71c..baf475d690a 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteBenchmark.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteBenchmark.java
@@ -1,13 +1,14 @@
-package cn.edu.tsinghua.iotdb.engine.bufferwrite;
+package org.apache.iotdb.db.engine.bufferwrite;
-import cn.edu.tsinghua.iotdb.exception.BufferWriteProcessorException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.LongDataPoint;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
-import cn.edu.tsinghua.tsfile.write.schema.MeasurementSchema;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.LongDataPoint;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
import org.apache.commons.io.FileUtils;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
import java.io.File;
import java.io.IOException;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteProcessorNewTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorNewTest.java
similarity index 81%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteProcessorNewTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorNewTest.java
index e550580f9e0..c14f6797b5b 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteProcessorNewTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorNewTest.java
@@ -1,16 +1,20 @@
-package cn.edu.tsinghua.iotdb.engine.bufferwrite;
+package org.apache.iotdb.db.engine.bufferwrite;
-import cn.edu.tsinghua.iotdb.conf.directories.Directories;
-import cn.edu.tsinghua.iotdb.engine.MetadataManagerHelper;
-import cn.edu.tsinghua.iotdb.engine.querycontext.ReadOnlyMemChunk;
-import cn.edu.tsinghua.iotdb.exception.BufferWriteProcessorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.FileSchemaUtils;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.Pair;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.engine.MetadataManagerHelper;
+import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteProcessorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorTest.java
similarity index 85%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteProcessorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorTest.java
index 46f413c1d5a..5a420e1f94f 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/BufferWriteProcessorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorTest.java
@@ -1,21 +1,26 @@
-package cn.edu.tsinghua.iotdb.engine.bufferwrite;
+package org.apache.iotdb.db.engine.bufferwrite;
-import cn.edu.tsinghua.iotdb.conf.directories.Directories;
-import cn.edu.tsinghua.iotdb.engine.MetadataManagerHelper;
-import cn.edu.tsinghua.iotdb.engine.PathUtils;
-import cn.edu.tsinghua.iotdb.engine.querycontext.ReadOnlyMemChunk;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.FileSchemaUtils;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.Pair;
-import cn.edu.tsinghua.tsfile.write.writer.TsFileIOWriter;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.engine.MetadataManagerHelper;
+import org.apache.iotdb.db.engine.PathUtils;
+import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.write.writer.TsFileIOWriter;
+import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -193,9 +198,9 @@ public class BufferWriteProcessorTest {
ReadOnlyMemChunk rawSeriesChunk = (ReadOnlyMemChunk) pair.left;
assertEquals(false, rawSeriesChunk.isEmpty());
assertEquals(87, rawSeriesChunk.getMinTimestamp());
- assertEquals(87, rawSeriesChunk.getValueAtMinTime().getInt());
+ Assert.assertEquals(87, rawSeriesChunk.getValueAtMinTime().getInt());
assertEquals(100, rawSeriesChunk.getMaxTimestamp());
- assertEquals(100, rawSeriesChunk.getValueAtMaxTime().getInt());
+ Assert.assertEquals(100, rawSeriesChunk.getValueAtMaxTime().getInt());
Iterator iterator = rawSeriesChunk.getIterator();
for (int i = 87; i <= 100; i++) {
iterator.hasNext();
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/RestorableTsFileIOWriterTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriterTest.java
similarity index 86%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/RestorableTsFileIOWriterTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriterTest.java
index 61ad2716374..6112e6f4775 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/bufferwrite/RestorableTsFileIOWriterTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriterTest.java
@@ -1,22 +1,25 @@
-package cn.edu.tsinghua.iotdb.engine.bufferwrite;
+package org.apache.iotdb.db.engine.bufferwrite;
-import cn.edu.tsinghua.iotdb.engine.memtable.IMemTable;
-import cn.edu.tsinghua.iotdb.engine.memtable.MemTableFlushUtil;
-import cn.edu.tsinghua.iotdb.engine.memtable.MemTableTestUtils;
-import cn.edu.tsinghua.iotdb.engine.memtable.PrimitiveMemTable;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkGroupMetaData;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
-import cn.edu.tsinghua.tsfile.file.metadata.TsDeviceMetadata;
-import cn.edu.tsinghua.tsfile.file.metadata.TsFileMetaData;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.read.TsFileSequenceReader;
-import cn.edu.tsinghua.tsfile.utils.BytesUtils;
-import cn.edu.tsinghua.tsfile.utils.Pair;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
-import cn.edu.tsinghua.tsfile.write.schema.MeasurementSchema;
-import cn.edu.tsinghua.tsfile.write.writer.TsFileIOWriter;
+import org.apache.iotdb.db.engine.memtable.IMemTable;
+import org.apache.iotdb.db.engine.memtable.MemTableFlushUtil;
+import org.apache.iotdb.db.engine.memtable.MemTableTestUtils;
+import org.apache.iotdb.db.engine.memtable.PrimitiveMemTable;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.file.metadata.ChunkGroupMetaData;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.file.metadata.TsDeviceMetadata;
+import org.apache.iotdb.tsfile.file.metadata.TsFileMetaData;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.utils.BytesUtils;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
+import org.apache.iotdb.tsfile.write.writer.TsFileIOWriter;
+import org.apache.iotdb.db.engine.memtable.IMemTable;
+import org.apache.iotdb.db.engine.memtable.MemTableFlushUtil;
+import org.apache.iotdb.db.engine.memtable.PrimitiveMemTable;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/filenode/SerializeUtilTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/filenode/SerializeUtilTest.java
similarity index 97%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/filenode/SerializeUtilTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/filenode/SerializeUtilTest.java
index fa60458f2ae..9d349cc9b59 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/filenode/SerializeUtilTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/filenode/SerializeUtilTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.engine.filenode;
+package org.apache.iotdb.db.engine.filenode;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -16,7 +16,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
/**
* @author liukun
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/filenodeV2/FileNodeManagerBenchmark.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeManagerBenchmark.java
similarity index 75%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/filenodeV2/FileNodeManagerBenchmark.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeManagerBenchmark.java
index 055a200b9b2..fb09ef7efc8 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/filenodeV2/FileNodeManagerBenchmark.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeManagerBenchmark.java
@@ -1,16 +1,22 @@
-package cn.edu.tsinghua.iotdb.engine.filenodeV2;
+package org.apache.iotdb.db.engine.filenodeV2;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.MetadataArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.postback.utils.RandomNum;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.LongDataPoint;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+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.postback.utils.RandomNum;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.LongDataPoint;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+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.postback.utils.RandomNum;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/BufferwriteFileSizeControlTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/BufferwriteFileSizeControlTest.java
similarity index 79%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/BufferwriteFileSizeControlTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/BufferwriteFileSizeControlTest.java
index 9b5f94621b8..652130a8fdb 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/BufferwriteFileSizeControlTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/BufferwriteFileSizeControlTest.java
@@ -1,25 +1,32 @@
-package cn.edu.tsinghua.iotdb.engine.memcontrol;
+package org.apache.iotdb.db.engine.memcontrol;
-import cn.edu.tsinghua.iotdb.conf.directories.Directories;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.MetadataManagerHelper;
-import cn.edu.tsinghua.iotdb.engine.PathUtils;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.Action;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.BufferWriteProcessor;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.FileNodeConstants;
-import cn.edu.tsinghua.iotdb.exception.BufferWriteProcessorException;
-import cn.edu.tsinghua.iotdb.metadata.ColumnSchema;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.MemUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.common.constant.JsonFormatConstant;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.MetadataManagerHelper;
+import org.apache.iotdb.db.engine.PathUtils;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.BufferWriteProcessor;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.common.constant.JsonFormatConstant;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.BufferWriteProcessor;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.utils.MemUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.After;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/BufferwriteMetaSizeControlTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/BufferwriteMetaSizeControlTest.java
similarity index 79%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/BufferwriteMetaSizeControlTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/BufferwriteMetaSizeControlTest.java
index 6518d3751bd..465576e9ad6 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/BufferwriteMetaSizeControlTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/BufferwriteMetaSizeControlTest.java
@@ -1,25 +1,32 @@
-package cn.edu.tsinghua.iotdb.engine.memcontrol;
+package org.apache.iotdb.db.engine.memcontrol;
-import cn.edu.tsinghua.iotdb.conf.directories.Directories;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.MetadataManagerHelper;
-import cn.edu.tsinghua.iotdb.engine.PathUtils;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.Action;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.BufferWriteProcessor;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.FileNodeConstants;
-import cn.edu.tsinghua.iotdb.exception.BufferWriteProcessorException;
-import cn.edu.tsinghua.iotdb.metadata.ColumnSchema;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.MemUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.common.constant.JsonFormatConstant;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.MetadataManagerHelper;
+import org.apache.iotdb.db.engine.PathUtils;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.BufferWriteProcessor;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.common.constant.JsonFormatConstant;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.BufferWriteProcessor;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.metadata.ColumnSchema;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.utils.MemUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.After;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/IoTDBMemControlTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/IoTDBMemControlTest.java
similarity index 88%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/IoTDBMemControlTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/IoTDBMemControlTest.java
index 9d4446506ec..6a46a018d7d 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/IoTDBMemControlTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/IoTDBMemControlTest.java
@@ -1,19 +1,19 @@
-package cn.edu.tsinghua.iotdb.engine.memcontrol;
+package org.apache.iotdb.db.engine.memcontrol;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.integration.Constant;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.MemUtils;
-import cn.edu.tsinghua.tsfile.utils.Binary;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.FloatDataPoint;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.IntDataPoint;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.LongDataPoint;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.StringDataPoint;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.integration.Constant;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.tsfile.utils.Binary;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.FloatDataPoint;
+import org.apache.iotdb.tsfile.write.record.datapoint.IntDataPoint;
+import org.apache.iotdb.tsfile.write.record.datapoint.LongDataPoint;
+import org.apache.iotdb.tsfile.write.record.datapoint.StringDataPoint;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/MemControllerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/MemControllerTest.java
similarity index 91%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/MemControllerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/MemControllerTest.java
index 7314d524106..edf3e70042d 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/MemControllerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/MemControllerTest.java
@@ -1,8 +1,9 @@
-package cn.edu.tsinghua.iotdb.engine.memcontrol;
+package org.apache.iotdb.db.engine.memcontrol;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
+import org.apache.iotdb.db.exception.BufferWriteProcessorException;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/OverflowFileSizeControlTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/OverflowFileSizeControlTest.java
similarity index 71%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/OverflowFileSizeControlTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/OverflowFileSizeControlTest.java
index 04565cd803f..04b6acb5be4 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/OverflowFileSizeControlTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/OverflowFileSizeControlTest.java
@@ -1,22 +1,28 @@
-package cn.edu.tsinghua.iotdb.engine.memcontrol;
+package org.apache.iotdb.db.engine.memcontrol;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.MetadataManagerHelper;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.Action;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.FileNodeConstants;
-import cn.edu.tsinghua.iotdb.engine.overflow.ioV2.OverflowProcessor;
-import cn.edu.tsinghua.iotdb.exception.OverflowProcessorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.FileSchemaUtils;
-import cn.edu.tsinghua.iotdb.utils.MemUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.DataPoint;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.MetadataManagerHelper;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.engine.overflow.ioV2.OverflowProcessor;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.engine.overflow.ioV2.OverflowProcessor;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.MemUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/OverflowMetaSizeControlTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/OverflowMetaSizeControlTest.java
similarity index 69%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/OverflowMetaSizeControlTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/OverflowMetaSizeControlTest.java
index 72b6558db32..06c64663b59 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memcontrol/OverflowMetaSizeControlTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/OverflowMetaSizeControlTest.java
@@ -1,22 +1,28 @@
-package cn.edu.tsinghua.iotdb.engine.memcontrol;
+package org.apache.iotdb.db.engine.memcontrol;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.MetadataManagerHelper;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.Action;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.FileNodeConstants;
-import cn.edu.tsinghua.iotdb.engine.overflow.ioV2.OverflowProcessor;
-import cn.edu.tsinghua.iotdb.exception.OverflowProcessorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.FileSchemaUtils;
-import cn.edu.tsinghua.iotdb.utils.MemUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.exception.write.WriteProcessException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.DataPoint;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.MetadataManagerHelper;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.engine.overflow.ioV2.OverflowProcessor;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.engine.overflow.ioV2.OverflowProcessor;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
+import org.apache.iotdb.db.utils.FileSchemaUtils;
+import org.apache.iotdb.db.utils.MemUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/MemTableTestUtils.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/MemTableTestUtils.java
similarity index 74%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/MemTableTestUtils.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/MemTableTestUtils.java
index 9e1faa35693..8dc6f9ea296 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/MemTableTestUtils.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/MemTableTestUtils.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.engine.memtable;
+package org.apache.iotdb.db.engine.memtable;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
-import cn.edu.tsinghua.tsfile.write.schema.MeasurementSchema;
+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.FileSchema;
+import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
public class MemTableTestUtils {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/MemtableBenchmark.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/MemtableBenchmark.java
similarity index 91%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/MemtableBenchmark.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/MemtableBenchmark.java
index 2718b2ab398..f2dbafdfe87 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/MemtableBenchmark.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/MemtableBenchmark.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.engine.memtable;
+package org.apache.iotdb.db.engine.memtable;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
/**
* Memtable insert benchmark.
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/PrimitiveMemTableTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java
similarity index 92%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/PrimitiveMemTableTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java
index 1b8d4b0002b..285c8b8f6f0 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/memtable/PrimitiveMemTableTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java
@@ -1,10 +1,12 @@
-package cn.edu.tsinghua.iotdb.engine.memtable;
+package org.apache.iotdb.db.engine.memtable;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.exception.write.UnSupportedDataTypeException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.utils.Binary;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.utils.Binary;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
import org.junit.Assert;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowIOTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowIOTest.java
similarity index 87%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowIOTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowIOTest.java
index 5ed16c9b5e6..0a0062343ce 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowIOTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowIOTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.ioV2;
+package org.apache.iotdb.db.engine.overflow.ioV2;
import static org.junit.Assert.assertEquals;
@@ -6,13 +6,11 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import cn.edu.tsinghua.tsfile.read.reader.TsFileInput;
+import org.apache.iotdb.tsfile.read.reader.TsFileInput;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-
public class OverflowIOTest {
private String overflowFilePath = "overflowfile";
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowProcessorBenchmark.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowProcessorBenchmark.java
similarity index 79%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowProcessorBenchmark.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowProcessorBenchmark.java
index 099fb4bb394..7082ccf3771 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowProcessorBenchmark.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowProcessorBenchmark.java
@@ -1,17 +1,20 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.ioV2;
+package org.apache.iotdb.db.engine.overflow.ioV2;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.Action;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.FileNodeConstants;
-import cn.edu.tsinghua.iotdb.exception.OverflowProcessorException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.LongDataPoint;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
-import cn.edu.tsinghua.tsfile.write.schema.MeasurementSchema;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.LongDataPoint;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
import org.apache.commons.io.FileUtils;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
import java.io.File;
import java.io.IOException;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowProcessorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowProcessorTest.java
similarity index 82%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowProcessorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowProcessorTest.java
index dea0b9100ba..02103d0bbc8 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowProcessorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowProcessorTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.ioV2;
+package org.apache.iotdb.db.engine.overflow.ioV2;
import static org.junit.Assert.assertEquals;
@@ -9,19 +9,22 @@ import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.engine.querycontext.MergeSeriesDataSource;
+import org.apache.iotdb.db.engine.querycontext.OverflowSeriesDataSource;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.junit.*;
-import cn.edu.tsinghua.iotdb.engine.PathUtils;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.Action;
-import cn.edu.tsinghua.iotdb.engine.bufferwrite.FileNodeConstants;
-import cn.edu.tsinghua.iotdb.engine.querycontext.MergeSeriesDataSource;
-import cn.edu.tsinghua.iotdb.engine.querycontext.OverflowSeriesDataSource;
-import cn.edu.tsinghua.iotdb.exception.OverflowProcessorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.engine.PathUtils;
+import org.apache.iotdb.db.engine.bufferwrite.Action;
+import org.apache.iotdb.db.engine.bufferwrite.FileNodeConstants;
+import org.apache.iotdb.db.engine.querycontext.MergeSeriesDataSource;
+import org.apache.iotdb.db.engine.querycontext.OverflowSeriesDataSource;
+import org.apache.iotdb.db.exception.OverflowProcessorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
public class OverflowProcessorTest {
@@ -66,7 +69,7 @@ public class OverflowProcessorTest {
OverflowSeriesDataSource overflowSeriesDataSource = processor.query(OverflowTestUtils.deviceId1,
OverflowTestUtils.measurementId1, null, OverflowTestUtils.dataType1);
assertEquals(OverflowTestUtils.dataType1, overflowSeriesDataSource.getDataType());
- assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
+ Assert.assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
assertEquals(1, overflowSeriesDataSource.getOverflowInsertFileList().size());
assertEquals(0,
overflowSeriesDataSource.getOverflowInsertFileList().get(0).getChunkMetaDataList().size());
@@ -80,7 +83,7 @@ public class OverflowProcessorTest {
overflowSeriesDataSource = processor.query(OverflowTestUtils.deviceId1, OverflowTestUtils.measurementId1,
null, OverflowTestUtils.dataType1);
assertEquals(OverflowTestUtils.dataType1, overflowSeriesDataSource.getDataType());
- assertEquals(false, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
+ Assert.assertEquals(false, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
assertEquals(1, overflowSeriesDataSource.getOverflowInsertFileList().size());
Iterator iterator = overflowSeriesDataSource.getReadableMemChunk().getIterator();
for (int i = 1; i <= 3; i++) {
@@ -93,7 +96,7 @@ public class OverflowProcessorTest {
processor.close();
overflowSeriesDataSource = processor.query(OverflowTestUtils.deviceId1, OverflowTestUtils.measurementId1,
null, OverflowTestUtils.dataType1);
- assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
+ Assert.assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
assertEquals(1, overflowSeriesDataSource.getOverflowInsertFileList().size());
assertEquals(1,
overflowSeriesDataSource.getOverflowInsertFileList().get(0).getChunkMetaDataList().size());
@@ -125,7 +128,7 @@ public class OverflowProcessorTest {
// test query
OverflowSeriesDataSource overflowSeriesDataSource = processor.query(OverflowTestUtils.deviceId1,
OverflowTestUtils.measurementId1, null, OverflowTestUtils.dataType2);
- assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
+ Assert.assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
assertEquals(0,
overflowSeriesDataSource.getOverflowInsertFileList().get(0).getChunkMetaDataList().size());
processor.clear();
@@ -163,7 +166,7 @@ public class OverflowProcessorTest {
overflowProcessor.switchWorkToMerge();
OverflowSeriesDataSource overflowSeriesDataSource = overflowProcessor.query(OverflowTestUtils.deviceId1,
OverflowTestUtils.measurementId1, null, OverflowTestUtils.dataType1);
- assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
+ Assert.assertEquals(true, overflowSeriesDataSource.getReadableMemChunk().isEmpty());
assertEquals(2, overflowSeriesDataSource.getOverflowInsertFileList().size());
overflowProcessor.switchMergeToWork();
overflowProcessor.close();
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowResourceTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowResourceTest.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowResourceTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowResourceTest.java
index a3aa3db8a95..cb5455f2ad0 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowResourceTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowResourceTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.ioV2;
+package org.apache.iotdb.db.engine.overflow.ioV2;
import static org.junit.Assert.assertEquals;
@@ -7,12 +7,12 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
public class OverflowResourceTest {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowSupportTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowSupportTest.java
similarity index 90%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowSupportTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowSupportTest.java
index de3209ff8b6..79f4fd410c3 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowSupportTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowSupportTest.java
@@ -1,14 +1,15 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.ioV2;
+package org.apache.iotdb.db.engine.overflow.ioV2;
import static org.junit.Assert.assertEquals;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.tsfile.utils.BytesUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.tsfile.utils.BytesUtils;
+import org.apache.iotdb.db.utils.TimeValuePair;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
public class OverflowSupportTest {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowTestUtils.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowTestUtils.java
similarity index 82%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowTestUtils.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowTestUtils.java
index 87871ffdeae..4282ad6f588 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/ioV2/OverflowTestUtils.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowTestUtils.java
@@ -1,16 +1,15 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.ioV2;
+package org.apache.iotdb.db.engine.overflow.ioV2;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.utils.BytesUtils;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.DataPoint;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
-import cn.edu.tsinghua.tsfile.write.schema.FileSchema;
-import cn.edu.tsinghua.tsfile.write.schema.MeasurementSchema;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.schema.FileSchema;
+import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
public class OverflowTestUtils {
public static String deviceId1 = "d1";
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFFileMetadataTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFFileMetadataTest.java
similarity index 97%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFFileMetadataTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFFileMetadataTest.java
index e654b5f96ae..685bb5d3b61 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFFileMetadataTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFFileMetadataTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.metadata;
+package org.apache.iotdb.db.engine.overflow.metadata;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFRowGroupListMetadataTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFRowGroupListMetadataTest.java
similarity index 97%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFRowGroupListMetadataTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFRowGroupListMetadataTest.java
index b5bf493d784..d91f61ed76f 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFRowGroupListMetadataTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFRowGroupListMetadataTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.metadata;
+package org.apache.iotdb.db.engine.overflow.metadata;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFSeriesListMetadataTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFSeriesListMetadataTest.java
similarity index 97%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFSeriesListMetadataTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFSeriesListMetadataTest.java
index 84e1146f3d4..ad839cdb7fc 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OFSeriesListMetadataTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OFSeriesListMetadataTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.metadata;
+package org.apache.iotdb.db.engine.overflow.metadata;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OverflowTestHelper.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OverflowTestHelper.java
similarity index 86%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OverflowTestHelper.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OverflowTestHelper.java
index dc8c26278fe..0f2d7555040 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OverflowTestHelper.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OverflowTestHelper.java
@@ -1,10 +1,8 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.metadata;
+package org.apache.iotdb.db.engine.overflow.metadata;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
-import cn.edu.tsinghua.tsfile.file.metadata.TsDigest;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.write.schema.MeasurementSchema;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
+import org.apache.iotdb.tsfile.file.metadata.TsDigest;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import java.util.ArrayList;
import java.util.List;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OverflowUtils.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OverflowUtils.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OverflowUtils.java
rename to iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OverflowUtils.java
index c133cd4d536..57bfaf82d47 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/engine/overflow/metadata/OverflowUtils.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/metadata/OverflowUtils.java
@@ -1,11 +1,8 @@
-package cn.edu.tsinghua.iotdb.engine.overflow.metadata;
+package org.apache.iotdb.db.engine.overflow.metadata;
-import cn.edu.tsinghua.tsfile.file.metadata.ChunkMetaData;
-import cn.edu.tsinghua.tsfile.file.metadata.TsDeviceMetadataIndex;
-import cn.edu.tsinghua.tsfile.file.metadata.TsFileMetaData;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
import java.nio.ByteBuffer;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/exception/ExceptionBuilderTest.java b/iotdb/src/test/java/org/apache/iotdb/db/exception/ExceptionBuilderTest.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/exception/ExceptionBuilderTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/exception/ExceptionBuilderTest.java
index 851fb76477f..b28a414f64a 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/exception/ExceptionBuilderTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/exception/ExceptionBuilderTest.java
@@ -1,6 +1,7 @@
-package cn.edu.tsinghua.iotdb.exception;
+package org.apache.iotdb.db.exception;
-import cn.edu.tsinghua.iotdb.exception.builder.ExceptionBuilder;
+import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
+import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/Constant.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/Constant.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/Constant.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/Constant.java
index ad5124088d0..2ab26881dae 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/Constant.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/Constant.java
@@ -1,8 +1,8 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.DataPoint;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
public class Constant {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBAuthorizationTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationTest.java
similarity index 99%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBAuthorizationTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationTest.java
index 4f3a71bf2ff..b9b58d4c033 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBAuthorizationTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBAuthorizationTest.java
@@ -1,9 +1,10 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.service.IoTDB;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBCompleteTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBCompleteTest.java
similarity index 97%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBCompleteTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBCompleteTest.java
index 0aa039774f2..116781e2988 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBCompleteTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBCompleteTest.java
@@ -1,16 +1,20 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import java.sql.*;
-
-import static cn.edu.tsinghua.iotdb.integration.Constant.TIMESTAMP_STR;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
/**
* Notice that, all test begins with "IoTDB" is integration test.
@@ -379,7 +383,7 @@ public class IoTDBCompleteTest {
result = "";
while (resultSet.next()) {
for (int i = 1; i <= count; i++) {
- if (now_start > 0L && column[i - 1] == TIMESTAMP_STR) {
+ if (now_start > 0L && column[i - 1] == Constant.TIMESTAMP_STR) {
String timestr = resultSet.getString(i);
Long tn = Long.valueOf(timestr);
Long now = System.currentTimeMillis();
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBDaemonTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBDaemonTest.java
similarity index 95%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBDaemonTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBDaemonTest.java
index d09525e0ab0..fb5ee44da96 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBDaemonTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBDaemonTest.java
@@ -1,16 +1,26 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
-import static cn.edu.tsinghua.iotdb.integration.Constant.*;
+import static org.apache.iotdb.db.integration.Constant.TIMESTAMP_STR;
+import static org.apache.iotdb.db.integration.Constant.d0s0;
+import static org.apache.iotdb.db.integration.Constant.d0s1;
+import static org.apache.iotdb.db.integration.Constant.d0s2;
+import static org.apache.iotdb.db.integration.Constant.d0s3;
+import static org.apache.iotdb.db.integration.Constant.d0s4;
+import static org.apache.iotdb.db.integration.Constant.d1s0;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBEngineTimeGeneratorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBEngineTimeGeneratorTest.java
similarity index 84%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBEngineTimeGeneratorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBEngineTimeGeneratorTest.java
index 533271d1d41..be503562e29 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBEngineTimeGeneratorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBEngineTimeGeneratorTest.java
@@ -1,20 +1,20 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.query.control.OpenedFilePathsManager;
-import cn.edu.tsinghua.iotdb.query.timegenerator.EngineTimeGenerator;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.BinaryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.TimeFilter;
-import cn.edu.tsinghua.tsfile.read.filter.ValueFilter;
-import cn.edu.tsinghua.tsfile.read.filter.factory.FilterFactory;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.query.control.OpenedFilePathsManager;
+import org.apache.iotdb.db.query.timegenerator.EngineTimeGenerator;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.BinaryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.TimeFilter;
+import org.apache.iotdb.tsfile.read.filter.ValueFilter;
+import org.apache.iotdb.tsfile.read.filter.factory.FilterFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -25,8 +25,9 @@ import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
-import static cn.edu.tsinghua.iotdb.integration.Constant.*;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
* Notice that, all test begins with "IoTDB" is integration test.
@@ -92,7 +93,7 @@ public class IoTDBEngineTimeGeneratorTest {
public void testOneSeriesWithValueAndTimeFilter() throws IOException, FileNodeManagerException {
System.out.println("Test >>> root.vehicle.d0.s0 >= 14 && time > 500");
- Path pd0s0 = new Path(d0s0);
+ Path pd0s0 = new Path(Constant.d0s0);
ValueFilter.ValueGtEq valueGtEq = ValueFilter.gtEq(14);
TimeFilter.TimeGt timeGt = TimeFilter.gt(500);
@@ -117,7 +118,7 @@ public class IoTDBEngineTimeGeneratorTest {
public void testEmptySeriesWithValueFilter() throws IOException, FileNodeManagerException {
System.out.println("Test >>> root.vehicle.d1.s0 >= 5");
- Path pd1s0 = new Path(d1s0);
+ Path pd1s0 = new Path(Constant.d1s0);
ValueFilter.ValueGtEq valueGtEq = ValueFilter.gtEq(5);
OpenedFilePathsManager.getInstance().setJobIdForCurrentRequestThread(0);
@@ -138,8 +139,8 @@ public class IoTDBEngineTimeGeneratorTest {
public void testMultiSeriesWithValueFilterAndTimeFilter() throws IOException, FileNodeManagerException {
System.out.println("Test >>> root.vehicle.d0.s0 >= 5 && root.vehicle.d0.s2 >= 11.5 || time > 900");
- Path pd0s0 = new Path(d0s0);
- Path pd0s2 = new Path(d0s2);
+ Path pd0s0 = new Path(Constant.d0s0);
+ Path pd0s2 = new Path(Constant.d0s2);
ValueFilter.ValueGtEq valueGtEq5 = ValueFilter.gtEq(5);
ValueFilter.ValueGtEq valueGtEq11 = ValueFilter.gtEq(11.5f);
@@ -169,7 +170,7 @@ public class IoTDBEngineTimeGeneratorTest {
Statement statement = connection.createStatement();
//create storage group and measurement
- for (String sql : create_sql) {
+ for (String sql : Constant.create_sql) {
statement.execute(sql);
}
@@ -181,7 +182,7 @@ public class IoTDBEngineTimeGeneratorTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time % 31);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[(int) time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[(int) time % 5]);
statement.execute(sql);
if (satisfyTimeFilter1(time)) {
@@ -209,7 +210,7 @@ public class IoTDBEngineTimeGeneratorTest {
}
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time % 31);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[(int) time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[(int) time % 5]);
statement.execute(sql);
}
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBLargeDataTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBLargeDataTest.java
similarity index 85%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBLargeDataTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBLargeDataTest.java
index d117c4fb99d..72135d58627 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBLargeDataTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBLargeDataTest.java
@@ -1,19 +1,24 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
-import static cn.edu.tsinghua.iotdb.integration.Constant.*;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
* Notice that, all test begins with "IoTDB" is integration test.
@@ -89,9 +94,9 @@ public class IoTDBLargeDataTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(d0s0)
- + "," + resultSet.getString(d0s1) + "," + resultSet.getString(d0s2) + "," + resultSet.getString(d0s3)
- + "," + resultSet.getString(d0s4) + "," + resultSet.getString(d0s5);
+ String ans = resultSet.getString(Constant.TIMESTAMP_STR) + "," + resultSet.getString(Constant.d0s0)
+ + "," + resultSet.getString(Constant.d0s1) + "," + resultSet.getString(Constant.d0s2) + "," + resultSet.getString(Constant.d0s3)
+ + "," + resultSet.getString(Constant.d0s4) + "," + resultSet.getString(Constant.d0s5);
cnt++;
}
@@ -124,7 +129,7 @@ public class IoTDBLargeDataTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(d0s0);
+ String ans = resultSet.getString(Constant.TIMESTAMP_STR) + "," + resultSet.getString(Constant.d0s0);
//System.out.println("===" + ans);
cnt++;
}
@@ -158,7 +163,7 @@ public class IoTDBLargeDataTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(d0s0);
+ String ans = resultSet.getString(Constant.TIMESTAMP_STR) + "," + resultSet.getString(Constant.d0s0);
//System.out.println(ans);
cnt++;
}
@@ -192,8 +197,8 @@ public class IoTDBLargeDataTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- long time = Long.valueOf(resultSet.getString(TIMESTAMP_STR));
- String value = resultSet.getString(d0s1);
+ long time = Long.valueOf(resultSet.getString(Constant.TIMESTAMP_STR));
+ String value = resultSet.getString(Constant.d0s1);
if (time > 200900) {
assertEquals("7777", value);
}
@@ -220,7 +225,7 @@ public class IoTDBLargeDataTest {
connection = DriverManager.getConnection(Config.IOTDB_URL_PREFIX+"127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement();
- for (String sql : create_sql) {
+ for (String sql : Constant.create_sql) {
statement.execute(sql);
}
@@ -244,9 +249,9 @@ public class IoTDBLargeDataTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time % 22);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[time % 5]);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, booleanValue[time % 2]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, Constant.booleanValue[time % 2]);
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s5) values(%s, %s)", time, time);
statement.execute(sql);
@@ -290,7 +295,7 @@ public class IoTDBLargeDataTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time + 2);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[time % 5]);
statement.execute(sql);
}
@@ -305,7 +310,7 @@ public class IoTDBLargeDataTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, "goodman");
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, booleanValue[time % 2]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, Constant.booleanValue[time % 2]);
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s5) values(%s, %s)", time, 9999);
statement.execute(sql);
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBLimitSlimitTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBLimitSlimitTest.java
similarity index 95%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBLimitSlimitTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBLimitSlimitTest.java
index d6db7505bdc..c6e66ca6d03 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBLimitSlimitTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBLimitSlimitTest.java
@@ -1,17 +1,22 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.IoTDBDatabaseMetadata;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.jdbc.IoTDBDatabaseMetadata;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
-import static cn.edu.tsinghua.iotdb.integration.Constant.TIMESTAMP_STR;
import static org.junit.Assert.fail;
/**
@@ -179,7 +184,7 @@ public class IoTDBLimitSlimitTest {
result = "";
while (resultSet.next()) {
for (int i = 1; i <= count; i++) {
- if (now_start > 0L && column[i - 1] == TIMESTAMP_STR) {
+ if (now_start > 0L && column[i - 1] == Constant.TIMESTAMP_STR) {
String timestr = resultSet.getString(i);
Long tn = Long.valueOf(timestr);
Long now = System.currentTimeMillis();
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBMetadataFetchTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchTest.java
similarity index 97%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBMetadataFetchTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchTest.java
index ced609e36d1..83ecbaf503c 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBMetadataFetchTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchTest.java
@@ -1,10 +1,11 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.Constant;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.jdbc.IoTDBMetadataResultSet;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Constant;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.jdbc.IoTDBMetadataResultSet;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.service.IoTDB;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBMultiSeriesTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesTest.java
similarity index 85%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBMultiSeriesTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesTest.java
index fab94a42410..b08758f6fc5 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBMultiSeriesTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesTest.java
@@ -1,19 +1,24 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
-import static cn.edu.tsinghua.iotdb.integration.Constant.*;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
* Notice that, all test begins with "IoTDB" is integration test.
@@ -89,9 +94,9 @@ public class IoTDBMultiSeriesTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(d0s0)
- + "," + resultSet.getString(d0s1) + "," + resultSet.getString(d0s2) + "," + resultSet.getString(d0s3)
- + "," + resultSet.getString(d0s4) + "," + resultSet.getString(d0s5);
+ String ans = resultSet.getString(Constant.TIMESTAMP_STR) + "," + resultSet.getString(Constant.d0s0)
+ + "," + resultSet.getString(Constant.d0s1) + "," + resultSet.getString(Constant.d0s2) + "," + resultSet.getString(Constant.d0s3)
+ + "," + resultSet.getString(Constant.d0s4) + "," + resultSet.getString(Constant.d0s5);
cnt++;
}
@@ -124,7 +129,7 @@ public class IoTDBMultiSeriesTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(d0s0);
+ String ans = resultSet.getString(Constant.TIMESTAMP_STR) + "," + resultSet.getString(Constant.d0s0);
//System.out.println("===" + ans);
cnt++;
}
@@ -158,7 +163,7 @@ public class IoTDBMultiSeriesTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(d0s0);
+ String ans = resultSet.getString(Constant.TIMESTAMP_STR) + "," + resultSet.getString(Constant.d0s0);
//System.out.println(ans);
cnt++;
}
@@ -192,8 +197,8 @@ public class IoTDBMultiSeriesTest {
ResultSet resultSet = statement.getResultSet();
int cnt = 0;
while (resultSet.next()) {
- long time = Long.valueOf(resultSet.getString(TIMESTAMP_STR));
- String value = resultSet.getString(d0s1);
+ long time = Long.valueOf(resultSet.getString(Constant.TIMESTAMP_STR));
+ String value = resultSet.getString(Constant.d0s1);
if (time > 200900) {
assertEquals("7777", value);
}
@@ -220,7 +225,7 @@ public class IoTDBMultiSeriesTest {
connection = DriverManager.getConnection(Config.IOTDB_URL_PREFIX+"127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement();
- for (String sql : create_sql) {
+ for (String sql : Constant.create_sql) {
statement.execute(sql);
}
@@ -244,9 +249,9 @@ public class IoTDBMultiSeriesTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time % 22);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[time % 5]);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, booleanValue[time % 2]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, Constant.booleanValue[time % 2]);
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s5) values(%s, %s)", time, time);
statement.execute(sql);
@@ -290,7 +295,7 @@ public class IoTDBMultiSeriesTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time + 2);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[time % 5]);
statement.execute(sql);
}
@@ -305,7 +310,7 @@ public class IoTDBMultiSeriesTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, "goodman");
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, booleanValue[time % 2]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, Constant.booleanValue[time % 2]);
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s5) values(%s, %s)", time, 9999);
statement.execute(sql);
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBSequenceDataQueryTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBSequenceDataQueryTest.java
similarity index 75%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBSequenceDataQueryTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBSequenceDataQueryTest.java
index 6b6e63118c1..b789c649f8a 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBSequenceDataQueryTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBSequenceDataQueryTest.java
@@ -1,21 +1,21 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.query.control.QueryTokenManager;
-import cn.edu.tsinghua.iotdb.query.executor.EngineQueryRouter;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.common.RowRecord;
-import cn.edu.tsinghua.tsfile.read.expression.QueryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.GlobalTimeExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.TimeFilter;
-import cn.edu.tsinghua.tsfile.read.filter.ValueFilter;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.query.executor.EngineQueryRouter;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.GlobalTimeExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.TimeFilter;
+import org.apache.iotdb.tsfile.read.filter.ValueFilter;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -26,7 +26,6 @@ import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
-import static cn.edu.tsinghua.iotdb.integration.Constant.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -95,7 +94,7 @@ public class IoTDBSequenceDataQueryTest {
Statement statement = connection.createStatement();
//create storage group and measurement
- for (String sql : create_sql) {
+ for (String sql : Constant.create_sql) {
statement.execute(sql);
}
@@ -107,7 +106,7 @@ public class IoTDBSequenceDataQueryTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time % 31);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[(int) time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[(int) time % 5]);
statement.execute(sql);
if (time % 17 >= 14) {
@@ -131,7 +130,7 @@ public class IoTDBSequenceDataQueryTest {
}
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time % 31);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[(int) time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[(int) time % 5]);
statement.execute(sql);
}
@@ -151,13 +150,13 @@ public class IoTDBSequenceDataQueryTest {
EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create();
- queryExpression.addSelectedPath(new Path(d0s0));
- queryExpression.addSelectedPath(new Path(d0s1));
- queryExpression.addSelectedPath(new Path(d0s2));
- queryExpression.addSelectedPath(new Path(d0s3));
- queryExpression.addSelectedPath(new Path(d0s4));
- queryExpression.addSelectedPath(new Path(d1s0));
- queryExpression.addSelectedPath(new Path(d1s1));
+ queryExpression.addSelectedPath(new Path(Constant.d0s0));
+ queryExpression.addSelectedPath(new Path(Constant.d0s1));
+ queryExpression.addSelectedPath(new Path(Constant.d0s2));
+ queryExpression.addSelectedPath(new Path(Constant.d0s3));
+ queryExpression.addSelectedPath(new Path(Constant.d0s4));
+ queryExpression.addSelectedPath(new Path(Constant.d1s0));
+ queryExpression.addSelectedPath(new Path(Constant.d1s1));
queryExpression.setExpression(null);
QueryDataSet queryDataSet = engineExecutor.query(queryExpression);
@@ -177,9 +176,9 @@ public class IoTDBSequenceDataQueryTest {
public void readWithTimeFilterTest() throws IOException, FileNodeManagerException {
EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create();
- queryExpression.addSelectedPath(new Path(d0s0));
- queryExpression.addSelectedPath(new Path(d1s0));
- queryExpression.addSelectedPath(new Path(d1s1));
+ queryExpression.addSelectedPath(new Path(Constant.d0s0));
+ queryExpression.addSelectedPath(new Path(Constant.d1s0));
+ queryExpression.addSelectedPath(new Path(Constant.d1s1));
GlobalTimeExpression globalTimeExpression = new GlobalTimeExpression(TimeFilter.gtEq(800L));
queryExpression.setExpression(globalTimeExpression);
@@ -204,15 +203,15 @@ public class IoTDBSequenceDataQueryTest {
// select * from root where root.vehicle.d0.s0 >=14
EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create();
- queryExpression.addSelectedPath(new Path(d0s0));
- queryExpression.addSelectedPath(new Path(d0s1));
- queryExpression.addSelectedPath(new Path(d0s2));
- queryExpression.addSelectedPath(new Path(d0s3));
- queryExpression.addSelectedPath(new Path(d0s4));
- queryExpression.addSelectedPath(new Path(d1s0));
- queryExpression.addSelectedPath(new Path(d1s1));
+ queryExpression.addSelectedPath(new Path(Constant.d0s0));
+ queryExpression.addSelectedPath(new Path(Constant.d0s1));
+ queryExpression.addSelectedPath(new Path(Constant.d0s2));
+ queryExpression.addSelectedPath(new Path(Constant.d0s3));
+ queryExpression.addSelectedPath(new Path(Constant.d0s4));
+ queryExpression.addSelectedPath(new Path(Constant.d1s0));
+ queryExpression.addSelectedPath(new Path(Constant.d1s1));
- Path queryPath = new Path(d0s0);
+ Path queryPath = new Path(Constant.d0s0);
SingleSeriesExpression singleSeriesExpression = new SingleSeriesExpression(queryPath, ValueFilter.gtEq(14));
queryExpression.setExpression(singleSeriesExpression);
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBSeriesReaderTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderTest.java
similarity index 85%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBSeriesReaderTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderTest.java
index 3d503a7838d..842f4e47e03 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBSeriesReaderTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderTest.java
@@ -1,20 +1,20 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.query.control.QueryTokenManager;
-import cn.edu.tsinghua.iotdb.query.executor.EngineQueryRouter;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.common.RowRecord;
-import cn.edu.tsinghua.tsfile.read.expression.QueryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.TimeFilter;
-import cn.edu.tsinghua.tsfile.read.filter.ValueFilter;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.query.executor.EngineQueryRouter;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.TimeFilter;
+import org.apache.iotdb.tsfile.read.filter.ValueFilter;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -25,7 +25,6 @@ import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
-import static cn.edu.tsinghua.iotdb.integration.Constant.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -91,14 +90,14 @@ public class IoTDBSeriesReaderTest {
EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create();
- queryExpression.addSelectedPath(new Path(d0s0));
- queryExpression.addSelectedPath(new Path(d0s1));
- queryExpression.addSelectedPath(new Path(d0s2));
- queryExpression.addSelectedPath(new Path(d0s3));
- queryExpression.addSelectedPath(new Path(d0s4));
- queryExpression.addSelectedPath(new Path(d0s5));
- queryExpression.addSelectedPath(new Path(d1s0));
- queryExpression.addSelectedPath(new Path(d1s1));
+ queryExpression.addSelectedPath(new Path(Constant.d0s0));
+ queryExpression.addSelectedPath(new Path(Constant.d0s1));
+ queryExpression.addSelectedPath(new Path(Constant.d0s2));
+ queryExpression.addSelectedPath(new Path(Constant.d0s3));
+ queryExpression.addSelectedPath(new Path(Constant.d0s4));
+ queryExpression.addSelectedPath(new Path(Constant.d0s5));
+ queryExpression.addSelectedPath(new Path(Constant.d1s0));
+ queryExpression.addSelectedPath(new Path(Constant.d1s1));
queryExpression.setExpression(null);
QueryDataSet queryDataSet = engineExecutor.query(queryExpression);
@@ -121,7 +120,7 @@ public class IoTDBSeriesReaderTest {
EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create();
- Path p = new Path(d0s0);
+ Path p = new Path(Constant.d0s0);
queryExpression.addSelectedPath(p);
SingleSeriesExpression singleSeriesExpression = new SingleSeriesExpression(p, ValueFilter.gtEq(20));
queryExpression.setExpression(singleSeriesExpression);
@@ -147,7 +146,7 @@ public class IoTDBSeriesReaderTest {
EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create();
- Path path = new Path(d0s0);
+ Path path = new Path(Constant.d0s0);
queryExpression.addSelectedPath(path);
SingleSeriesExpression expression = new SingleSeriesExpression(path, TimeFilter.gt(22987L));
queryExpression.setExpression(expression);
@@ -171,8 +170,8 @@ public class IoTDBSeriesReaderTest {
System.out.println("Test >>> select s1 from root.vehicle.d0 where s0 < 111");
EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create();
- Path path1 = new Path(d0s0);
- Path path2 = new Path(d0s1);
+ Path path1 = new Path(Constant.d0s0);
+ Path path2 = new Path(Constant.d0s1);
queryExpression.addSelectedPath(path1);
queryExpression.addSelectedPath(path2);
SingleSeriesExpression singleSeriesExpression = new SingleSeriesExpression(path1, ValueFilter.lt(111));
@@ -199,7 +198,7 @@ public class IoTDBSeriesReaderTest {
connection = DriverManager.getConnection(Config.IOTDB_URL_PREFIX+"127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement();
- for (String sql : create_sql) {
+ for (String sql : Constant.create_sql) {
statement.execute(sql);
}
@@ -212,9 +211,9 @@ public class IoTDBSeriesReaderTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time % 22);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[time % 5]);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, booleanValue[time % 2]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, Constant.booleanValue[time % 2]);
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s5) values(%s, %s)", time, time);
statement.execute(sql);
@@ -270,7 +269,7 @@ public class IoTDBSeriesReaderTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s2) values(%s,%s)", time, time + 2);
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, stringValue[time % 5]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, Constant.stringValue[time % 5]);
statement.execute(sql);
}
@@ -285,7 +284,7 @@ public class IoTDBSeriesReaderTest {
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s3) values(%s,'%s')", time, "goodman");
statement.execute(sql);
- sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, booleanValue[time % 2]);
+ sql = String.format("insert into root.vehicle.d0(timestamp,s4) values(%s, %s)", time, Constant.booleanValue[time % 2]);
statement.execute(sql);
sql = String.format("insert into root.vehicle.d0(timestamp,s5) values(%s, %s)", time, 9999);
statement.execute(sql);
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBTimeZoneTest.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBTimeZoneTest.java
similarity index 95%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBTimeZoneTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBTimeZoneTest.java
index 6bdba26c216..51eab456c4b 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/integration/IoTDBTimeZoneTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBTimeZoneTest.java
@@ -1,9 +1,10 @@
-package cn.edu.tsinghua.iotdb.integration;
+package org.apache.iotdb.db.integration;
-import cn.edu.tsinghua.iotdb.jdbc.IoTDBConnection;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.IoTDBConnection;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.service.IoTDB;
import org.apache.thrift.TException;
import org.junit.After;
import org.junit.Assert;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerAdvancedTest.java b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerAdvancedTest.java
similarity index 92%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerAdvancedTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerAdvancedTest.java
index 484cc590a7a..ecc341176b4 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerAdvancedTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerAdvancedTest.java
@@ -1,9 +1,11 @@
-package cn.edu.tsinghua.iotdb.metadata;
+package org.apache.iotdb.db.metadata;
-import cn.edu.tsinghua.iotdb.exception.MetadataArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerBasicTest.java b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
similarity index 89%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerBasicTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
index 367182588bb..7b8fcc9f597 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerBasicTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.metadata;
+package org.apache.iotdb.db.metadata;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -7,14 +7,17 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.exception.MetadataArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.read.common.Path;
public class MManagerBasicTest {
@@ -45,7 +48,7 @@ public class MManagerBasicTest {
try {
manager.setStorageLevelToMTree("root.laptop");
} catch (PathErrorException | IOException e) {
- assertEquals("The seriesPath of root.laptop already exist, it can't be set to the storage group", e.getMessage());
+ Assert.assertEquals("The seriesPath of root.laptop already exist, it can't be set to the storage group", e.getMessage());
}
try {
@@ -125,7 +128,7 @@ public class MManagerBasicTest {
try {
manager.setStorageLevelToMTree("root.laptop.d2");
} catch (PathErrorException | IOException e) {
- assertEquals(String.format("The seriesPath of %s already exist, it can't be set to the storage group", "root.laptop.d2"),e.getMessage());
+ Assert.assertEquals(String.format("The seriesPath of %s already exist, it can't be set to the storage group", "root.laptop.d2"),e.getMessage());
}
/*
* check file level
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerEfficiencyTest.java b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerEfficiencyTest.java
similarity index 95%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerEfficiencyTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerEfficiencyTest.java
index 41d4e5ef3c5..5dcc4ca423d 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerEfficiencyTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerEfficiencyTest.java
@@ -1,8 +1,8 @@
-package cn.edu.tsinghua.iotdb.metadata;
+package org.apache.iotdb.db.metadata;
-import cn.edu.tsinghua.iotdb.exception.MetadataArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.tsfile.exception.cache.CacheException;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.tsfile.exception.cache.CacheException;
import org.junit.Before;
import org.junit.Ignore;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerImproveTest.java b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerImproveTest.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerImproveTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerImproveTest.java
index e7b86b28e55..c001f943ec9 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MManagerImproveTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MManagerImproveTest.java
@@ -1,11 +1,14 @@
-package cn.edu.tsinghua.iotdb.metadata;
+package org.apache.iotdb.db.metadata;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MTreeTest.java b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MTreeTest.java
similarity index 94%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MTreeTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/metadata/MTreeTest.java
index 92665028faf..ad4d41a3495 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/metadata/MTreeTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/metadata/MTreeTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.metadata;
+package org.apache.iotdb.db.metadata;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -7,13 +7,14 @@ import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.HashMap;
+import org.apache.iotdb.db.exception.PathErrorException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
public class MTreeTest {
@@ -130,7 +131,7 @@ public class MTreeTest {
try {
root.setStorageGroup("root.laptop");
} catch (PathErrorException e) {
- assertEquals("The seriesPath of root.laptop already exist, it can't be set to the storage group", e.getMessage());
+ Assert.assertEquals("The seriesPath of root.laptop already exist, it can't be set to the storage group", e.getMessage());
}
// check timeseries
assertEquals(root.isPathExist("root.laptop.d1.s0"), false);
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/monitor/MonitorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/monitor/MonitorTest.java
similarity index 83%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/monitor/MonitorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/monitor/MonitorTest.java
index 2f79dcb7915..52f3f71f61e 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/monitor/MonitorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/monitor/MonitorTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.monitor;
+package org.apache.iotdb.db.monitor;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
@@ -7,18 +7,21 @@ import static org.junit.Assert.fail;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicLong;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.metadata.MManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.write.record.datapoint.DataPoint;
-import cn.edu.tsinghua.tsfile.write.record.TSRecord;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
/**
* @author Liliang
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/FileManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/postback/sender/FileManagerTest.java
similarity index 99%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/FileManagerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/postback/sender/FileManagerTest.java
index 27d4dd58496..f73a656ef7d 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/FileManagerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/postback/sender/FileManagerTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.postback.sender;
+package org.apache.iotdb.db.postback.sender;
import java.io.File;
import java.io.IOException;
@@ -13,7 +13,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.postback.sender.FileManager;
+import org.apache.iotdb.db.postback.sender.FileManager;
public class FileManagerTest {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/IoTDBSingleClientPostBackTest.java b/iotdb/src/test/java/org/apache/iotdb/db/postback/sender/IoTDBSingleClientPostBackTest.java
similarity index 98%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/IoTDBSingleClientPostBackTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/postback/sender/IoTDBSingleClientPostBackTest.java
index 559ef3a601b..f07fa11445b 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/IoTDBSingleClientPostBackTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/postback/sender/IoTDBSingleClientPostBackTest.java
@@ -1,6 +1,13 @@
-package cn.edu.tsinghua.iotdb.postback.sender;
+package org.apache.iotdb.db.postback.sender;
-import static org.junit.Assert.*;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.integration.Constant;
+import org.apache.iotdb.db.postback.conf.PostBackSenderConfig;
+import org.apache.iotdb.db.postback.conf.PostBackSenderDescriptor;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.jdbc.Config;
import java.io.File;
import java.sql.Connection;
@@ -11,14 +18,7 @@ import java.sql.Statement;
import java.util.HashSet;
import java.util.Set;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.postback.conf.PostBackSenderConfig;
-import cn.edu.tsinghua.iotdb.postback.conf.PostBackSenderDescriptor;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.integration.Constant;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
+import static org.junit.Assert.fail;
/**
* The test is to run a complete postback function
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/MultipleClientPostBackTest.java b/iotdb/src/test/java/org/apache/iotdb/db/postback/sender/MultipleClientPostBackTest.java
similarity index 97%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/MultipleClientPostBackTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/postback/sender/MultipleClientPostBackTest.java
index 3245415fc1e..4462046226f 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/postback/sender/MultipleClientPostBackTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/postback/sender/MultipleClientPostBackTest.java
@@ -1,10 +1,9 @@
-package cn.edu.tsinghua.iotdb.postback.sender;
+package org.apache.iotdb.db.postback.sender;
-import static org.junit.Assert.*;
+import org.apache.iotdb.jdbc.Config;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.Connection;
@@ -18,11 +17,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import cn.edu.tsinghua.iotdb.jdbc.Config;
+import static org.junit.Assert.fail;
public class MultipleClientPostBackTest {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/bench/QueryParseBenchmark.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/bench/QueryParseBenchmark.java
similarity index 84%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/bench/QueryParseBenchmark.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/bench/QueryParseBenchmark.java
index 373e6ba13c5..18b43bc8399 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/bench/QueryParseBenchmark.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/bench/QueryParseBenchmark.java
@@ -1,11 +1,14 @@
-package cn.edu.tsinghua.iotdb.qp.bench;
+package org.apache.iotdb.db.qp.bench;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.QueryProcessor;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
/**
* SQL Parse benchmark.
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/other/TSPlanContextAuthorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextAuthorTest.java
similarity index 81%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/other/TSPlanContextAuthorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextAuthorTest.java
index edff2e151a5..df7a55c9ebd 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/other/TSPlanContextAuthorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextAuthorTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.qp.other;
+package org.apache.iotdb.db.qp.other;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.fail;
@@ -6,18 +6,19 @@ import static org.junit.Assert.fail;
import java.util.Arrays;
import java.util.Collection;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.qp.QueryProcessor;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.AuthorPlan;
-import cn.edu.tsinghua.iotdb.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.common.Path;
/**
* test ast node parsing on authorization
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/other/TSPlanContextPropertyTest.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextPropertyTest.java
similarity index 84%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/other/TSPlanContextPropertyTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextPropertyTest.java
index 0614a69ab9e..166ffa04dad 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/other/TSPlanContextPropertyTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextPropertyTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.qp.other;
+package org.apache.iotdb.db.qp.other;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
@@ -6,19 +6,20 @@ import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collection;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
-import cn.edu.tsinghua.iotdb.qp.QueryProcessor;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.logical.sys.PropertyOperator.PropertyType;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.PropertyPlan;
-import cn.edu.tsinghua.iotdb.qp.utils.MemIntQpExecutor;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.logical.sys.PropertyOperator.PropertyType;
+import org.apache.iotdb.db.qp.physical.sys.PropertyPlan;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.tsfile.read.common.Path;
/**
* test ast node parsing on authorization
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/LogicalPlanSmallTest.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/LogicalPlanSmallTest.java
similarity index 82%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/LogicalPlanSmallTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/plan/LogicalPlanSmallTest.java
index 37abcf161f5..5565df3ab58 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/LogicalPlanSmallTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/LogicalPlanSmallTest.java
@@ -1,25 +1,30 @@
-package cn.edu.tsinghua.iotdb.qp.plan;
+package org.apache.iotdb.db.qp.plan;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.qp.IllegalASTFormatException;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOperatorException;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOptimizeException;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.logical.RootOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.QueryOperator;
-import cn.edu.tsinghua.iotdb.qp.logical.crud.SFWOperator;
-import cn.edu.tsinghua.iotdb.qp.strategy.LogicalGenerator;
-import cn.edu.tsinghua.iotdb.qp.strategy.optimizer.ConcatPathOptimizer;
-import cn.edu.tsinghua.iotdb.qp.utils.MemIntQpExecutor;
-import cn.edu.tsinghua.iotdb.sql.ParseGenerator;
-import cn.edu.tsinghua.iotdb.sql.parse.ASTNode;
-import cn.edu.tsinghua.iotdb.sql.parse.ParseException;
-import cn.edu.tsinghua.iotdb.sql.parse.ParseUtils;
-import cn.edu.tsinghua.tsfile.common.constant.SystemConstant;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.utils.StringContainer;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.qp.IllegalASTFormatException;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.logical.RootOperator;
+import org.apache.iotdb.db.qp.logical.crud.QueryOperator;
+import org.apache.iotdb.db.qp.logical.crud.SFWOperator;
+import org.apache.iotdb.db.qp.strategy.LogicalGenerator;
+import org.apache.iotdb.db.qp.strategy.optimizer.ConcatPathOptimizer;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.db.sql.ParseGenerator;
+import org.apache.iotdb.db.sql.parse.ASTNode;
+import org.apache.iotdb.db.sql.parse.ParseException;
+import org.apache.iotdb.db.sql.parse.ParseUtils;
+import org.apache.iotdb.tsfile.common.constant.SystemConstant;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.StringContainer;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.qp.logical.RootOperator;
+import org.apache.iotdb.db.qp.logical.crud.QueryOperator;
+import org.apache.iotdb.db.qp.logical.crud.SFWOperator;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/PhysicalPlanTest.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java
similarity index 86%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/PhysicalPlanTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java
index b6ee7fba837..1037db02889 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/PhysicalPlanTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java
@@ -1,38 +1,39 @@
-package cn.edu.tsinghua.iotdb.qp.plan;
+package org.apache.iotdb.db.qp.plan;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.AggregationPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.FillQueryPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.GroupByPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.QueryPlan;
-import cn.edu.tsinghua.iotdb.query.fill.LinearFill;
-import cn.edu.tsinghua.iotdb.query.fill.PreviousFill;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.BinaryExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.GlobalTimeExpression;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.TimeFilter;
-import cn.edu.tsinghua.tsfile.read.filter.ValueFilter;
-import cn.edu.tsinghua.tsfile.read.filter.factory.FilterFactory;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.qp.physical.crud.AggregationPlan;
+import org.apache.iotdb.db.qp.physical.crud.FillQueryPlan;
+import org.apache.iotdb.db.qp.physical.crud.GroupByPlan;
+import org.apache.iotdb.db.qp.physical.crud.QueryPlan;
+import org.apache.iotdb.db.query.fill.LinearFill;
+import org.apache.iotdb.db.query.fill.PreviousFill;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.BinaryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.GlobalTimeExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.TimeFilter;
+import org.apache.iotdb.tsfile.read.filter.ValueFilter;
+import org.apache.iotdb.tsfile.read.filter.factory.FilterFactory;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
import org.junit.Before;
import org.junit.Test;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.qp.QueryProcessor;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.AuthorPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.MetadataPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.sys.PropertyPlan;
-import cn.edu.tsinghua.iotdb.qp.utils.MemIntQpExecutor;
-import cn.edu.tsinghua.tsfile.common.constant.SystemConstant;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.utils.StringContainer;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
+import org.apache.iotdb.db.qp.physical.sys.MetadataPlan;
+import org.apache.iotdb.db.qp.physical.sys.PropertyPlan;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.tsfile.common.constant.SystemConstant;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.StringContainer;
public class PhysicalPlanTest {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/QPUpdateTest.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/QPUpdateTest.java
similarity index 92%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/QPUpdateTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/plan/QPUpdateTest.java
index 43a204974e8..d330f2bb179 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/QPUpdateTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/QPUpdateTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.qp.plan;
+package org.apache.iotdb.db.qp.plan;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -11,16 +11,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.qp.utils.MemIntQpExecutor;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
import org.junit.After;
-import cn.edu.tsinghua.iotdb.qp.QueryProcessor;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.junit.Test;
public class QPUpdateTest {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/TestConcatOptimizer.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/TestConcatOptimizer.java
similarity index 80%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/TestConcatOptimizer.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/plan/TestConcatOptimizer.java
index 5fed71e23d6..fdd0815c0a2 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/plan/TestConcatOptimizer.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/plan/TestConcatOptimizer.java
@@ -1,17 +1,18 @@
-package cn.edu.tsinghua.iotdb.qp.plan;
+package org.apache.iotdb.db.qp.plan;
-import cn.edu.tsinghua.iotdb.exception.ArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.qp.QueryProcessor;
-import cn.edu.tsinghua.iotdb.exception.qp.QueryProcessorException;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.QueryPlan;
-import cn.edu.tsinghua.iotdb.qp.utils.MemIntQpExecutor;
-import cn.edu.tsinghua.iotdb.qp.strategy.optimizer.ConcatPathOptimizer;
-import cn.edu.tsinghua.tsfile.read.expression.impl.SingleSeriesExpression;
-import cn.edu.tsinghua.tsfile.read.filter.ValueFilter;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.ArgsErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.qp.QueryProcessor;
+import org.apache.iotdb.db.exception.qp.QueryProcessorException;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.crud.QueryPlan;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
+import org.apache.iotdb.db.qp.strategy.optimizer.ConcatPathOptimizer;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.ValueFilter;
+import org.apache.iotdb.tsfile.read.common.Path;
import org.antlr.runtime.RecognitionException;
+import org.apache.iotdb.db.qp.utils.MemIntQpExecutor;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/strategy/LogicalGeneratorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/strategy/LogicalGeneratorTest.java
similarity index 90%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/strategy/LogicalGeneratorTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/strategy/LogicalGeneratorTest.java
index a0f4e6d87d3..c5285d48ecd 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/strategy/LogicalGeneratorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/strategy/LogicalGeneratorTest.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.qp.strategy;
+package org.apache.iotdb.db.qp.strategy;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOperatorException;
-import cn.edu.tsinghua.iotdb.qp.constant.SQLConstant;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.qp.constant.SQLConstant;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/utils/MemIntQpExecutor.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/utils/MemIntQpExecutor.java
similarity index 87%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/utils/MemIntQpExecutor.java
rename to iotdb/src/test/java/org/apache/iotdb/db/qp/utils/MemIntQpExecutor.java
index c54572f67c1..1d8c0b41f74 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/qp/utils/MemIntQpExecutor.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/utils/MemIntQpExecutor.java
@@ -1,17 +1,17 @@
-package cn.edu.tsinghua.iotdb.qp.utils;
+package org.apache.iotdb.db.qp.utils;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.qp.constant.SQLConstant;
-import cn.edu.tsinghua.iotdb.qp.executor.QueryProcessExecutor;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.read.expression.IExpression;
-import cn.edu.tsinghua.tsfile.read.query.dataset.QueryDataSet;
-import cn.edu.tsinghua.tsfile.utils.Pair;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.qp.constant.SQLConstant;
+import org.apache.iotdb.db.qp.executor.QueryProcessExecutor;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.tsfile.utils.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/component/SimpleFileWriter.java b/iotdb/src/test/java/org/apache/iotdb/db/query/component/SimpleFileWriter.java
similarity index 95%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/component/SimpleFileWriter.java
rename to iotdb/src/test/java/org/apache/iotdb/db/query/component/SimpleFileWriter.java
index 8e09da37f2e..d47e42116f0 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/component/SimpleFileWriter.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/query/component/SimpleFileWriter.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.query.component;
+package org.apache.iotdb.db.query.component;
import org.junit.Ignore;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/FileReaderManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/query/control/FileReaderManagerTest.java
similarity index 95%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/FileReaderManagerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/query/control/FileReaderManagerTest.java
index befefe3a54f..8304127bd63 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/FileReaderManagerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/query/control/FileReaderManagerTest.java
@@ -1,7 +1,7 @@
-package cn.edu.tsinghua.iotdb.query.control;
+package org.apache.iotdb.db.query.control;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/query/control/OpenedFilePathsManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/query/control/OpenedFilePathsManagerTest.java
new file mode 100644
index 00000000000..4ff90174b4b
--- /dev/null
+++ b/iotdb/src/test/java/org/apache/iotdb/db/query/control/OpenedFilePathsManagerTest.java
@@ -0,0 +1,5 @@
+package org.apache.iotdb.db.query.control;
+
+
+public class OpenedFilePathsManagerTest {
+}
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/QueryTokenManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/query/control/QueryTokenManagerTest.java
similarity index 65%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/QueryTokenManagerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/query/control/QueryTokenManagerTest.java
index 5328d6310c6..0a148827caf 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/control/QueryTokenManagerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/query/control/QueryTokenManagerTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.query.control;
+package org.apache.iotdb.db.query.control;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderByTimestampTest.java b/iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderByTimestampTest.java
similarity index 95%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderByTimestampTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderByTimestampTest.java
index c6f4721d03d..ca0a32b1113 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderByTimestampTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderByTimestampTest.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.query.reader.merge;
+package org.apache.iotdb.db.query.reader.merge;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
import org.junit.Assert;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderTest.java b/iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderTest.java
similarity index 88%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderTest.java
index eb01f54e10b..6101cafb42b 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/PriorityMergeReaderTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReaderTest.java
@@ -1,10 +1,10 @@
-package cn.edu.tsinghua.iotdb.query.reader.merge;
+package org.apache.iotdb.db.query.reader.merge;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
import org.junit.Assert;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/SeriesMergeSortReaderTest.java b/iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/SeriesMergeSortReaderTest.java
similarity index 90%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/SeriesMergeSortReaderTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/SeriesMergeSortReaderTest.java
index 5f2dddd65d8..3f34e4e8bd6 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/query/reader/merge/SeriesMergeSortReaderTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/query/reader/merge/SeriesMergeSortReaderTest.java
@@ -1,9 +1,9 @@
-package cn.edu.tsinghua.iotdb.query.reader.merge;
+package org.apache.iotdb.db.query.reader.merge;
-import cn.edu.tsinghua.iotdb.query.reader.IReader;
-import cn.edu.tsinghua.iotdb.utils.TimeValuePair;
-import cn.edu.tsinghua.iotdb.utils.TsPrimitiveType;
-import cn.edu.tsinghua.tsfile.read.common.BatchData;
+import org.apache.iotdb.db.query.reader.IReader;
+import org.apache.iotdb.db.utils.TimeValuePair;
+import org.apache.iotdb.db.utils.TsPrimitiveType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
import org.junit.Assert;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/script/IoTDBStartServerScriptTest.java b/iotdb/src/test/java/org/apache/iotdb/db/script/IoTDBStartServerScriptTest.java
similarity index 98%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/script/IoTDBStartServerScriptTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/script/IoTDBStartServerScriptTest.java
index 813791f2742..40a6d986bdb 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/script/IoTDBStartServerScriptTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/script/IoTDBStartServerScriptTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.script;
+package org.apache.iotdb.db.script;
import static org.junit.Assert.assertEquals;
@@ -11,7 +11,6 @@ import java.util.List;
import org.junit.After;
import org.junit.Before;
-import org.junit.Test;
public class IoTDBStartServerScriptTest {
private final String START_IOTDB_STR = "IoTDB has started.";
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/sql/DatetimeUtilsTest.java b/iotdb/src/test/java/org/apache/iotdb/db/sql/DatetimeUtilsTest.java
similarity index 91%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/sql/DatetimeUtilsTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/sql/DatetimeUtilsTest.java
index 1b0d13b9239..b5041dabeb1 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/sql/DatetimeUtilsTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/sql/DatetimeUtilsTest.java
@@ -1,8 +1,10 @@
-package cn.edu.tsinghua.iotdb.sql;
+package org.apache.iotdb.db.sql;
-import cn.edu.tsinghua.iotdb.exception.qp.LogicalOperatorException;
-import cn.edu.tsinghua.iotdb.qp.constant.DatetimeUtils;
+import org.apache.iotdb.db.exception.qp.LogicalOperatorException;
+import org.apache.iotdb.db.qp.constant.DatetimeUtils;
+import org.apache.iotdb.db.qp.constant.DatetimeUtils;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -47,7 +49,7 @@ public class DatetimeUtilsTest {
long res = 1546413207000L;
for(String str : timeFormatWithoutMs) {
- assertEquals(res, DatetimeUtils.convertDatetimeStrToMillisecond(str, zoneOffset));
+ Assert.assertEquals(res, DatetimeUtils.convertDatetimeStrToMillisecond(str, zoneOffset));
}
for(String str : timeFormatWithoutMs) {
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/sql/SQLParserTest.java b/iotdb/src/test/java/org/apache/iotdb/db/sql/SQLParserTest.java
similarity index 99%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/sql/SQLParserTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/sql/SQLParserTest.java
index 40c880ea03f..d2f7d4eeeac 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/sql/SQLParserTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/sql/SQLParserTest.java
@@ -1,13 +1,12 @@
-package cn.edu.tsinghua.iotdb.sql;
+package org.apache.iotdb.db.sql;
-import cn.edu.tsinghua.iotdb.sql.parse.ASTNode;
-import cn.edu.tsinghua.iotdb.sql.parse.Node;
-import cn.edu.tsinghua.iotdb.sql.parse.ParseException;
-import cn.edu.tsinghua.iotdb.sql.parse.ParseUtils;
+import org.apache.iotdb.db.sql.parse.ASTNode;
+import org.apache.iotdb.db.sql.parse.Node;
+import org.apache.iotdb.db.sql.parse.ParseException;
+import org.apache.iotdb.db.sql.parse.ParseUtils;
import org.antlr.runtime.RecognitionException;
import org.junit.Test;
-import javax.swing.plaf.synth.SynthOptionPaneUI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/EnvironmentUtils.java b/iotdb/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
similarity index 65%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/EnvironmentUtils.java
rename to iotdb/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
index 93c0c12ac26..f043c502041 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/EnvironmentUtils.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
@@ -1,24 +1,38 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
-import cn.edu.tsinghua.iotdb.auth.AuthException;
-import cn.edu.tsinghua.iotdb.auth.authorizer.IAuthorizer;
-import cn.edu.tsinghua.iotdb.auth.authorizer.LocalFileAuthorizer;
-import cn.edu.tsinghua.iotdb.conf.directories.Directories;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.engine.cache.RowGroupBlockMetaDataCache;
-import cn.edu.tsinghua.iotdb.engine.cache.TsFileMetaDataCache;
-import cn.edu.tsinghua.iotdb.engine.filenode.FileNodeManager;
-import cn.edu.tsinghua.iotdb.engine.memcontrol.BasicMemController;
-import cn.edu.tsinghua.iotdb.exception.FileNodeManagerException;
-import cn.edu.tsinghua.iotdb.exception.StartupException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.monitor.StatMonitor;
-import cn.edu.tsinghua.iotdb.query.control.FileReaderManager;
-import cn.edu.tsinghua.iotdb.query.control.QueryTokenManager;
-import cn.edu.tsinghua.iotdb.writelog.manager.MultiFileLogNodeManager;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.db.auth.AuthException;
+import org.apache.iotdb.db.auth.authorizer.IAuthorizer;
+import org.apache.iotdb.db.auth.authorizer.LocalFileAuthorizer;
+import org.apache.iotdb.db.conf.directories.Directories;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.engine.cache.RowGroupBlockMetaDataCache;
+import org.apache.iotdb.db.engine.cache.TsFileMetaDataCache;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.engine.memcontrol.BasicMemController;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.monitor.StatMonitor;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.db.auth.AuthException;
+import org.apache.iotdb.db.auth.authorizer.IAuthorizer;
+import org.apache.iotdb.db.auth.authorizer.LocalFileAuthorizer;
+import org.apache.iotdb.db.engine.cache.RowGroupBlockMetaDataCache;
+import org.apache.iotdb.db.engine.cache.TsFileMetaDataCache;
+import org.apache.iotdb.db.engine.filenode.FileNodeManager;
+import org.apache.iotdb.db.engine.memcontrol.BasicMemController;
+import org.apache.iotdb.db.exception.FileNodeManagerException;
+import org.apache.iotdb.db.exception.StartupException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.monitor.StatMonitor;
+import org.apache.iotdb.db.query.control.FileReaderManager;
+import org.apache.iotdb.db.query.control.QueryTokenManager;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/OpenFileNumUtilTest.java b/iotdb/src/test/java/org/apache/iotdb/db/utils/OpenFileNumUtilTest.java
similarity index 99%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/OpenFileNumUtilTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/utils/OpenFileNumUtilTest.java
index 28d255fb8b8..0aa599f15bc 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/OpenFileNumUtilTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/utils/OpenFileNumUtilTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import org.junit.After;
import org.junit.Before;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayListTest.java b/iotdb/src/test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java
similarity index 96%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayListTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java
index 88fb6f2d51f..216f50502f1 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/utils/PrimitiveArrayListTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java
@@ -1,4 +1,4 @@
-package cn.edu.tsinghua.iotdb.utils;
+package org.apache.iotdb.db.utils;
import org.junit.Assert;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/IoTDBLogFileSizeTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/IoTDBLogFileSizeTest.java
similarity index 88%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/IoTDBLogFileSizeTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/writelog/IoTDBLogFileSizeTest.java
index 9138f18f936..86ef930c3ac 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/IoTDBLogFileSizeTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/IoTDBLogFileSizeTest.java
@@ -1,17 +1,22 @@
-package cn.edu.tsinghua.iotdb.writelog;
+package org.apache.iotdb.db.writelog;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConstant;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.jdbc.Config;
-import cn.edu.tsinghua.iotdb.writelog.manager.MultiFileLogNodeManager;
-import cn.edu.tsinghua.iotdb.writelog.node.ExclusiveWriteLogNode;
-import cn.edu.tsinghua.iotdb.writelog.node.WriteLogNode;
-import cn.edu.tsinghua.iotdb.service.IoTDB;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.iotdb.utils.MemUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.jdbc.Config;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.db.utils.MemUtils;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/PerformanceTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
similarity index 85%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/PerformanceTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
index ec3a6ee4c17..e67bace471f 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/PerformanceTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
@@ -1,22 +1,27 @@
-package cn.edu.tsinghua.iotdb.writelog;
+package org.apache.iotdb.db.writelog;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.*;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.writelog.transfer.PhysicalPlanLogTransfer;
-import cn.edu.tsinghua.iotdb.writelog.node.ExclusiveWriteLogNode;
-import cn.edu.tsinghua.iotdb.writelog.node.WriteLogNode;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileConfig;
-import cn.edu.tsinghua.tsfile.common.conf.TSFileDescriptor;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.read.common.Path;
-import cn.edu.tsinghua.tsfile.utils.Pair;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.*;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
+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.utils.Pair;
+import org.apache.iotdb.db.exception.*;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/RecoverTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/RecoverTest.java
similarity index 87%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/RecoverTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/writelog/RecoverTest.java
index 5e9502fc91a..2dd60e1b36a 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/RecoverTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/RecoverTest.java
@@ -1,21 +1,29 @@
-package cn.edu.tsinghua.iotdb.writelog;
+package org.apache.iotdb.db.writelog;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.ProcessorException;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.writelog.recover.ExclusiveLogRecoverPerformer;
-import cn.edu.tsinghua.iotdb.writelog.recover.RecoverPerformer;
-import cn.edu.tsinghua.iotdb.writelog.replay.LogReplayer;
-import cn.edu.tsinghua.iotdb.writelog.node.ExclusiveWriteLogNode;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.writelog.recover.ExclusiveLogRecoverPerformer;
+import org.apache.iotdb.db.writelog.recover.RecoverPerformer;
+import org.apache.iotdb.db.writelog.replay.LogReplayer;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.ProcessorException;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.recover.ExclusiveLogRecoverPerformer;
+import org.apache.iotdb.db.writelog.recover.RecoverPerformer;
+import org.apache.iotdb.db.writelog.replay.LogReplayer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -26,8 +34,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import static cn.edu.tsinghua.iotdb.writelog.RecoverStage.backup;
-import static cn.edu.tsinghua.iotdb.writelog.RecoverStage.replayLog;
+import static org.apache.iotdb.db.writelog.RecoverStage.backup;
+import static org.apache.iotdb.db.writelog.RecoverStage.replayLog;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -153,7 +161,7 @@ public class RecoverTest {
try {
// set flag
- File flagFile = new File(logNode.getLogDirectory() + File.separator + ExclusiveLogRecoverPerformer.RECOVER_FLAG_NAME + "-" + backup.name());
+ File flagFile = new File(logNode.getLogDirectory() + File.separator + ExclusiveLogRecoverPerformer.RECOVER_FLAG_NAME + "-" + RecoverStage.backup.name());
flagFile.createNewFile();
InsertPlan bwInsertPlan = new InsertPlan(1, "logTestDevice", 100, Arrays.asList("s1", "s2", "s3", "s4"),
@@ -222,7 +230,7 @@ public class RecoverTest {
try {
// set flag
- File flagFile = new File(logNode.getLogDirectory() + File.separator + ExclusiveLogRecoverPerformer.RECOVER_FLAG_NAME + "-" + replayLog.name());
+ File flagFile = new File(logNode.getLogDirectory() + File.separator + ExclusiveLogRecoverPerformer.RECOVER_FLAG_NAME + "-" + RecoverStage.replayLog.name());
flagFile.createNewFile();
InsertPlan bwInsertPlan = new InsertPlan(1, "logTestDevice", 100, Arrays.asList("s1", "s2", "s3", "s4"),
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/WriteLogNodeManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeManagerTest.java
similarity index 75%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/WriteLogNodeManagerTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeManagerTest.java
index e8f4e75c5fd..29298329365 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/WriteLogNodeManagerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeManagerTest.java
@@ -1,21 +1,28 @@
-package cn.edu.tsinghua.iotdb.writelog;
+package org.apache.iotdb.db.writelog;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.exception.MetadataArgsErrorException;
-import cn.edu.tsinghua.iotdb.exception.PathErrorException;
-import cn.edu.tsinghua.iotdb.exception.RecoverException;
-import cn.edu.tsinghua.iotdb.metadata.MManager;
-import cn.edu.tsinghua.iotdb.writelog.manager.MultiFileLogNodeManager;
-import cn.edu.tsinghua.iotdb.writelog.manager.WriteLogNodeManager;
-import cn.edu.tsinghua.iotdb.writelog.node.WriteLogNode;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSDataType;
-import cn.edu.tsinghua.tsfile.file.metadata.enums.TSEncoding;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
+import org.apache.iotdb.db.writelog.manager.WriteLogNodeManager;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+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.db.exception.MetadataArgsErrorException;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.RecoverException;
+import org.apache.iotdb.db.metadata.MManager;
+import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
+import org.apache.iotdb.db.writelog.manager.WriteLogNodeManager;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/WriteLogNodeTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeTest.java
similarity index 92%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/WriteLogNodeTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeTest.java
index e3bfa4e69a7..6166080a8b4 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/WriteLogNodeTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeTest.java
@@ -1,15 +1,18 @@
-package cn.edu.tsinghua.iotdb.writelog;
+package org.apache.iotdb.db.writelog;
-import cn.edu.tsinghua.iotdb.conf.IoTDBConfig;
-import cn.edu.tsinghua.iotdb.conf.IoTDBDescriptor;
-import cn.edu.tsinghua.iotdb.writelog.transfer.PhysicalPlanLogTransfer;
-import cn.edu.tsinghua.iotdb.writelog.node.ExclusiveWriteLogNode;
-import cn.edu.tsinghua.iotdb.writelog.node.WriteLogNode;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.iotdb.utils.EnvironmentUtils;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.writelog.node.ExclusiveWriteLogNode;
+import org.apache.iotdb.db.writelog.node.WriteLogNode;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/io/LogWriterReaderTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/io/LogWriterReaderTest.java
similarity index 76%
rename from iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/io/LogWriterReaderTest.java
rename to iotdb/src/test/java/org/apache/iotdb/db/writelog/io/LogWriterReaderTest.java
index 653a440c42a..023328fef8e 100644
--- a/iotdb/src/test/java/cn/edu/tsinghua/iotdb/writelog/io/LogWriterReaderTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/io/LogWriterReaderTest.java
@@ -1,12 +1,14 @@
-package cn.edu.tsinghua.iotdb.writelog.io;
+package org.apache.iotdb.db.writelog.io;
-import cn.edu.tsinghua.iotdb.exception.WALOverSizedException;
-import cn.edu.tsinghua.iotdb.qp.physical.PhysicalPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.DeletePlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.InsertPlan;
-import cn.edu.tsinghua.iotdb.qp.physical.crud.UpdatePlan;
-import cn.edu.tsinghua.iotdb.writelog.transfer.PhysicalPlanLogTransfer;
-import cn.edu.tsinghua.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.WALOverSizedException;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
+import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
+import org.apache.iotdb.db.qp.physical.crud.UpdatePlan;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.db.exception.WALOverSizedException;
+import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
diff --git a/iotdb/src/test/resources/start-postBackTest.sh b/iotdb/src/test/resources/start-postBackTest.sh
index 747ecb58aec..2acac542bfb 100644
--- a/iotdb/src/test/resources/start-postBackTest.sh
+++ b/iotdb/src/test/resources/start-postBackTest.sh
@@ -29,7 +29,7 @@ for f in ${IOTDB_HOME}/lib/*.jar; do
CLASSPATH=${CLASSPATH}":"$f
done
-MAIN_CLASS=cn.edu.tsinghua.iotdb.postback.utils.CreateDataSender1
+MAIN_CLASS=org.apache.iotdb.db.postback.utils.CreateDataSender1
"$JAVA" -DIOTDB_HOME=${IOTDB_HOME} -DTSFILE_HOME=${IOTDB_HOME} -DIOTDB_CONF=${IOTDB_CONF} -Dlogback.configurationFile=${IOTDB_CONF}/logback.xml $IOTDB_DERBY_OPTS $IOTDB_JMX_OPTS -Dname=postBackTest -cp "$CLASSPATH" "$MAIN_CLASS"
diff --git a/jdbc/README.md b/jdbc/README.md
index 0f1d6f41498..88db5291b9e 100644
--- a/jdbc/README.md
+++ b/jdbc/README.md
@@ -20,7 +20,7 @@ In root directory:
```
- cn.edu.tsinghua
+ org.apache.iotdb
iotdb-jdbc
0.8.0-SNAPSHOT
@@ -28,7 +28,7 @@ In root directory:
```
## Example
-(for more detailes, please see example/src/main/java/cn/edu/tsinghua/jdbcDemo/SendDataToIotdb.java)
+(for more detailes, please see example/src/main/java/org/apache/iotdb/jdbc/jdbcDemo/SendDataToIotdb.java)
```Java
import java.sql.Connection;
import java.sql.DriverManager;
@@ -38,7 +38,7 @@ import java.sql.Statement;
public class Example {
public static void main(String[] args) throws ClassNotFoundException, SQLException {
- Class.forName("cn.edu.tsinghua.iotdb.jdbc.TsfileDriver");
+ Class.forName("org.apache.iotdb.jdbc.TsfileDriver");
Connection connection = null;
Statement statement = null;
try {
diff --git a/jdbc/example/readme.md b/jdbc/example/readme.md
index 085b89c5f74..5e8dc2be997 100644
--- a/jdbc/example/readme.md
+++ b/jdbc/example/readme.md
@@ -13,7 +13,7 @@ The example is to show how to send data from localhost to IoTDB through Kafka.
0.8.2.0