Package org.apache.iotdb.db.qp.executor
Class PlanExecutor
- java.lang.Object
-
- org.apache.iotdb.db.qp.executor.PlanExecutor
-
- All Implemented Interfaces:
IPlanExecutor
public class PlanExecutor extends java.lang.Object implements IPlanExecutor
-
-
Field Summary
Fields Modifier and Type Field Description protected IQueryRouterqueryRouter
-
Constructor Summary
Constructors Constructor Description PlanExecutor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<org.apache.iotdb.commons.path.PartialPath>checkStorageGroupExist(java.util.List<org.apache.iotdb.commons.path.PartialPath> storageGroups)voiddelete(org.apache.iotdb.commons.path.PartialPath path, long startTime, long endTime, long planIndex, DataRegion.TimePartitionFilter timePartitionFilter)execute delete command and return whether the operator is successful.voiddelete(DeletePlan deletePlan)execute delete command and return whether the operator is successful.protected booleandeleteStorageGroups(DeleteStorageGroupPlan deleteStorageGroupPlan)protected booleandeleteTimeSeries(DeleteTimeSeriesPlan deleteTimeSeriesPlan)static voidflushSpecifiedStorageGroups(FlushPlan plan)protected AlignByDeviceDataSetgetAlignByDeviceDataSet(AlignByDevicePlan plan, QueryContext context, IQueryRouter router)protected java.util.List<IStorageGroupMNode>getAllStorageGroupNodes()protected intgetDevicesNum(org.apache.iotdb.commons.path.PartialPath path, boolean isPrefixMatch)protected java.util.Set<java.lang.String>getNodeNextChildren(org.apache.iotdb.commons.path.PartialPath path)protected java.util.List<org.apache.iotdb.commons.path.PartialPath>getNodesList(org.apache.iotdb.commons.path.PartialPath schemaPattern, int level)protected intgetNodesNumInGivenLevel(org.apache.iotdb.commons.path.PartialPath path, int level, boolean isPrefixMatch)protected java.util.Set<org.apache.iotdb.common.rpc.thrift.TSchemaNode>getPathNextChildren(org.apache.iotdb.commons.path.PartialPath path)protected java.util.List<MeasurementPath>getPathsName(org.apache.iotdb.commons.path.PartialPath path)protected intgetPathsNum(org.apache.iotdb.commons.path.PartialPath path, boolean isPrefixMatch)protected java.util.List<org.apache.iotdb.commons.path.PartialPath>getStorageGroupNames(org.apache.iotdb.commons.path.PartialPath path, boolean isPrefixMatch)voidinsert(InsertRowPlan insertRowPlan)execute insert command and return whether the operator is successful.voidinsert(InsertRowsOfOneDevicePlan insertRowsOfOneDevicePlan)execute insert command and return whether the operator is successful.voidinsert(InsertRowsPlan plan)execute insert command and return whether the operator is successful.voidinsertTablet(InsertMultiTabletsPlan insertMultiTabletsPlan)execute multi batch insert planvoidinsertTablet(InsertTabletPlan insertTabletPlan)execute batch insert planprotected voidloadConfiguration(LoadConfigurationPlan plan)static voidoperateClearCache()protected org.apache.iotdb.tsfile.read.query.dataset.QueryDataSetprocessAuthorQuery(AuthorPlan plan)protected org.apache.iotdb.tsfile.read.query.dataset.QueryDataSetprocessDataQuery(QueryPlan queryPlan, QueryContext context)booleanprocessNonQuery(PhysicalPlan plan)Process Non-Query Physical plan, including insert/update/delete operation of data/metadata/Privilegeorg.apache.iotdb.tsfile.read.query.dataset.QueryDataSetprocessQuery(PhysicalPlan queryPlan, QueryContext context)process query plan of qp layer, construct queryDataSet.protected org.apache.iotdb.tsfile.read.query.dataset.QueryDataSetprocessShowQuery(ShowPlan showPlan, QueryContext context)booleansetStorageGroup(SetStorageGroupPlan setStorageGroupPlan)voidupdate(org.apache.iotdb.commons.path.PartialPath path, long startTime, long endTime, java.lang.String value)execute update command and return whether the operator is successful.
-
-
-
Field Detail
-
queryRouter
protected IQueryRouter queryRouter
-
-
Constructor Detail
-
PlanExecutor
public PlanExecutor() throws QueryProcessException- Throws:
QueryProcessException
-
-
Method Detail
-
processQuery
public org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet processQuery(PhysicalPlan queryPlan, QueryContext context) throws java.io.IOException, StorageEngineException, org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException, QueryProcessException, org.apache.iotdb.commons.exception.MetadataException, java.lang.InterruptedException
Description copied from interface:IPlanExecutorprocess query plan of qp layer, construct queryDataSet.- Specified by:
processQueryin interfaceIPlanExecutor- Parameters:
queryPlan- QueryPlan- Returns:
- QueryDataSet
- Throws:
java.io.IOExceptionStorageEngineExceptionorg.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationExceptionQueryProcessExceptionorg.apache.iotdb.commons.exception.MetadataExceptionjava.lang.InterruptedException
-
processNonQuery
public boolean processNonQuery(PhysicalPlan plan) throws QueryProcessException, StorageGroupNotSetException, StorageEngineException
Description copied from interface:IPlanExecutorProcess Non-Query Physical plan, including insert/update/delete operation of data/metadata/Privilege- Specified by:
processNonQueryin interfaceIPlanExecutor- Parameters:
plan- Physical Non-Query Plan- Throws:
QueryProcessExceptionStorageGroupNotSetExceptionStorageEngineException
-
operateClearCache
public static void operateClearCache()
-
flushSpecifiedStorageGroups
public static void flushSpecifiedStorageGroups(FlushPlan plan) throws StorageGroupNotSetException
- Throws:
StorageGroupNotSetException
-
processDataQuery
protected org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet processDataQuery(QueryPlan queryPlan, QueryContext context) throws StorageEngineException, org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException, QueryProcessException, java.io.IOException, java.lang.InterruptedException
- Throws:
StorageEngineExceptionorg.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationExceptionQueryProcessExceptionjava.io.IOExceptionjava.lang.InterruptedException
-
getAlignByDeviceDataSet
protected AlignByDeviceDataSet getAlignByDeviceDataSet(AlignByDevicePlan plan, QueryContext context, IQueryRouter router) throws QueryProcessException
- Throws:
QueryProcessException
-
processShowQuery
protected org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet processShowQuery(ShowPlan showPlan, QueryContext context) throws QueryProcessException, org.apache.iotdb.commons.exception.MetadataException
- Throws:
QueryProcessExceptionorg.apache.iotdb.commons.exception.MetadataException
-
getDevicesNum
protected int getDevicesNum(org.apache.iotdb.commons.path.PartialPath path, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getPathsNum
protected int getPathsNum(org.apache.iotdb.commons.path.PartialPath path, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getNodesNumInGivenLevel
protected int getNodesNumInGivenLevel(org.apache.iotdb.commons.path.PartialPath path, int level, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getPathsName
protected java.util.List<MeasurementPath> getPathsName(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataException
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getNodesList
protected java.util.List<org.apache.iotdb.commons.path.PartialPath> getNodesList(org.apache.iotdb.commons.path.PartialPath schemaPattern, int level) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getPathNextChildren
protected java.util.Set<org.apache.iotdb.common.rpc.thrift.TSchemaNode> getPathNextChildren(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getNodeNextChildren
protected java.util.Set<java.lang.String> getNodeNextChildren(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getStorageGroupNames
protected java.util.List<org.apache.iotdb.commons.path.PartialPath> getStorageGroupNames(org.apache.iotdb.commons.path.PartialPath path, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllStorageGroupNodes
protected java.util.List<IStorageGroupMNode> getAllStorageGroupNodes()
-
delete
public void delete(DeletePlan deletePlan) throws QueryProcessException
Description copied from interface:IPlanExecutorexecute delete command and return whether the operator is successful.- Specified by:
deletein interfaceIPlanExecutor- Parameters:
deletePlan- physical delete plan- Throws:
QueryProcessException
-
update
public void update(org.apache.iotdb.commons.path.PartialPath path, long startTime, long endTime, java.lang.String value)Description copied from interface:IPlanExecutorexecute update command and return whether the operator is successful.- Specified by:
updatein interfaceIPlanExecutor- Parameters:
path- : update series seriesPathstartTime- start time in update commandendTime- end time in update commandvalue- - in type of string
-
delete
public void delete(org.apache.iotdb.commons.path.PartialPath path, long startTime, long endTime, long planIndex, DataRegion.TimePartitionFilter timePartitionFilter) throws QueryProcessExceptionDescription copied from interface:IPlanExecutorexecute delete command and return whether the operator is successful.- Specified by:
deletein interfaceIPlanExecutor- Parameters:
path- delete series seriesPathstartTime- start time in delete commandendTime- end time in delete commandplanIndex- index of the deletion plantimePartitionFilter- specify involving time partitions, if null, all partitions are involved- Throws:
QueryProcessException
-
insert
public void insert(InsertRowsOfOneDevicePlan insertRowsOfOneDevicePlan) throws QueryProcessException
Description copied from interface:IPlanExecutorexecute insert command and return whether the operator is successful.- Specified by:
insertin interfaceIPlanExecutor- Parameters:
insertRowsOfOneDevicePlan- physical insert plan- Throws:
QueryProcessException
-
insert
public void insert(InsertRowsPlan plan) throws QueryProcessException
Description copied from interface:IPlanExecutorexecute insert command and return whether the operator is successful.- Specified by:
insertin interfaceIPlanExecutor- Parameters:
plan- physical insert rows plan, which contains multi insertRowPlans- Throws:
QueryProcessException
-
insert
public void insert(InsertRowPlan insertRowPlan) throws QueryProcessException
Description copied from interface:IPlanExecutorexecute insert command and return whether the operator is successful.- Specified by:
insertin interfaceIPlanExecutor- Parameters:
insertRowPlan- physical insert plan- Throws:
QueryProcessException
-
insertTablet
public void insertTablet(InsertMultiTabletsPlan insertMultiTabletsPlan) throws QueryProcessException
Description copied from interface:IPlanExecutorexecute multi batch insert plan- Specified by:
insertTabletin interfaceIPlanExecutor- Throws:
QueryProcessException- when some of the rows failed
-
insertTablet
public void insertTablet(InsertTabletPlan insertTabletPlan) throws QueryProcessException
Description copied from interface:IPlanExecutorexecute batch insert plan- Specified by:
insertTabletin interfaceIPlanExecutor- Throws:
BatchProcessException- when some of the rows failedQueryProcessException
-
deleteTimeSeries
protected boolean deleteTimeSeries(DeleteTimeSeriesPlan deleteTimeSeriesPlan) throws QueryProcessException
- Throws:
QueryProcessException
-
setStorageGroup
public boolean setStorageGroup(SetStorageGroupPlan setStorageGroupPlan) throws QueryProcessException
- Throws:
QueryProcessException
-
deleteStorageGroups
protected boolean deleteStorageGroups(DeleteStorageGroupPlan deleteStorageGroupPlan) throws QueryProcessException
- Throws:
QueryProcessException
-
processAuthorQuery
protected org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet processAuthorQuery(AuthorPlan plan) throws QueryProcessException
- Throws:
QueryProcessException
-
loadConfiguration
protected void loadConfiguration(LoadConfigurationPlan plan) throws QueryProcessException
- Throws:
QueryProcessException
-
checkStorageGroupExist
public static java.util.List<org.apache.iotdb.commons.path.PartialPath> checkStorageGroupExist(java.util.List<org.apache.iotdb.commons.path.PartialPath> storageGroups)
- Parameters:
storageGroups- the storage groups to check- Returns:
- List of PartialPath the storage groups that not exist
-
-