Class InsertRowsOfOneDevicePlan
- java.lang.Object
-
- org.apache.iotdb.db.qp.physical.PhysicalPlan
-
- org.apache.iotdb.db.qp.physical.crud.InsertPlan
-
- org.apache.iotdb.db.qp.physical.crud.InsertRowsOfOneDevicePlan
-
- All Implemented Interfaces:
org.apache.iotdb.consensus.common.request.IConsensusRequest,BatchPlan
public class InsertRowsOfOneDevicePlan extends InsertPlan implements BatchPlan
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.iotdb.db.qp.physical.PhysicalPlan
PhysicalPlan.Factory, PhysicalPlan.PhysicalPlanType
-
-
Field Summary
-
Fields inherited from class org.apache.iotdb.db.qp.physical.crud.InsertPlan
dataTypes, deviceID, devicePath, isAligned, measurementMNodes, measurements
-
Fields inherited from class org.apache.iotdb.db.qp.physical.PhysicalPlan
canBeSplit, index
-
-
Constructor Summary
Constructors Constructor Description InsertRowsOfOneDevicePlan()InsertRowsOfOneDevicePlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.util.List<java.lang.Long> insertTimes, java.util.List<java.util.List<java.lang.String>> measurements, java.util.List<java.nio.ByteBuffer> insertValues, boolean isAligned)InsertRowsOfOneDevicePlan(org.apache.iotdb.commons.path.PartialPath prefixPath, InsertRowPlan[] rowPlans, int[] rowPlanIndexList)This constructor is used for splitting parent InsertRowsOfOneDevicePlan into sub ones.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIntegrity()Check the integrity of the plan in case that the plan is generated by a careless user through Session API.voiddeserialize(java.nio.ByteBuffer buffer)Deserialize the plan from the given buffer.booleanequals(java.lang.Object o)intgetBatchSize()Return how many sub-plans are in the planjava.lang.ObjectgetFirstValueOfIndex(int index)longgetMinTime()java.util.List<org.apache.iotdb.commons.path.PartialPath>getPaths()InsertPlangetPlanFromFailed()Reconstruct this plan with the failed measurements.java.util.List<org.apache.iotdb.commons.path.PartialPath>getPrefixPaths()Return prefix paths of all sub-plansjava.util.Map<java.lang.Integer,org.apache.iotdb.common.rpc.thrift.TSStatus>getResults()Return execution status for each pathint[]getRowPlanIndexList()InsertRowPlan[]getRowPlans()inthashCode()booleanisExecuted(int i)Whether the sub-plan at position i has been executed.voidserialize(java.io.DataOutputStream stream)Serialize the plan into the given buffer.voidserializeImpl(java.nio.ByteBuffer buffer)voidsetIndex(long index)voidsetIsExecuted(int i)Mark the sub-plan at position i as executed.java.lang.StringtoString()voidunsetIsExecuted(int i)Mark the sub-plan at position i as not executed.-
Methods inherited from class org.apache.iotdb.db.qp.physical.crud.InsertPlan
getDataTypes, getDeviceID, getDevicePath, getFailedExceptions, getFailedMeasurementNumber, getFailedMeasurements, getMeasurementMNodes, getMeasurements, hasValidMeasurements, isAligned, markFailedMeasurementInsertion, recoverFromFailure, setAligned, setDataTypes, setDeviceID, setDevicePath, setMeasurementMNodes, setMeasurements
-
Methods inherited from class org.apache.iotdb.db.qp.physical.PhysicalPlan
canBeSplit, deserialize, getAggregations, getAuthPaths, getIndex, getLoginUserName, getOperatorName, getOperatorType, isAuthenticationRequired, isDebug, isPrefixMatch, isQuery, isSelectInto, putString, putString, putStrings, putStrings, readString, readStrings, serialize, serializeToByteBuffer, setDebug, setLoginUserName, setOperatorType, setPaths, setPrefixMatch, setQuery
-
-
-
-
Constructor Detail
-
InsertRowsOfOneDevicePlan
public InsertRowsOfOneDevicePlan()
-
InsertRowsOfOneDevicePlan
public InsertRowsOfOneDevicePlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.util.List<java.lang.Long> insertTimes, java.util.List<java.util.List<java.lang.String>> measurements, java.util.List<java.nio.ByteBuffer> insertValues, boolean isAligned) throws QueryProcessException- Throws:
QueryProcessException
-
InsertRowsOfOneDevicePlan
public InsertRowsOfOneDevicePlan(org.apache.iotdb.commons.path.PartialPath prefixPath, InsertRowPlan[] rowPlans, int[] rowPlanIndexList)This constructor is used for splitting parent InsertRowsOfOneDevicePlan into sub ones. So there's no need to validate rowPlans.
-
-
Method Detail
-
checkIntegrity
public void checkIntegrity()
Description copied from class:PhysicalPlanCheck the integrity of the plan in case that the plan is generated by a careless user through Session API.- Overrides:
checkIntegrityin classInsertPlan
-
getPaths
public java.util.List<org.apache.iotdb.commons.path.PartialPath> getPaths()
- Specified by:
getPathsin classPhysicalPlan
-
getMinTime
public long getMinTime()
- Specified by:
getMinTimein classInsertPlan
-
getFirstValueOfIndex
public java.lang.Object getFirstValueOfIndex(int index)
- Specified by:
getFirstValueOfIndexin classInsertPlan
-
serialize
public void serialize(java.io.DataOutputStream stream) throws java.io.IOExceptionDescription copied from class:PhysicalPlanSerialize the plan into the given buffer. All necessary fields will be serialized.- Overrides:
serializein classPhysicalPlan- Throws:
java.io.IOException
-
serializeImpl
public void serializeImpl(java.nio.ByteBuffer buffer)
- Overrides:
serializeImplin classPhysicalPlan
-
deserialize
public void deserialize(java.nio.ByteBuffer buffer) throws org.apache.iotdb.commons.exception.IllegalPathExceptionDescription copied from class:PhysicalPlanDeserialize the plan from the given buffer.- Overrides:
deserializein classPhysicalPlan- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
setIndex
public void setIndex(long index)
- Overrides:
setIndexin classPhysicalPlan
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getPlanFromFailed
public InsertPlan getPlanFromFailed()
Description copied from class:InsertPlanReconstruct this plan with the failed measurements.- Overrides:
getPlanFromFailedin classInsertPlan- Returns:
- the plan itself, with measurements replaced with the previously failed ones.
-
getRowPlans
public InsertRowPlan[] getRowPlans()
-
setIsExecuted
public void setIsExecuted(int i)
Description copied from interface:BatchPlanMark the sub-plan at position i as executed.- Specified by:
setIsExecutedin interfaceBatchPlan- Parameters:
i- the position of the sub-plan
-
isExecuted
public boolean isExecuted(int i)
Description copied from interface:BatchPlanWhether the sub-plan at position i has been executed.- Specified by:
isExecutedin interfaceBatchPlan- Parameters:
i- the position of the sub-plan- Returns:
- whether the sub-plan at position i has been executed.
-
getResults
public java.util.Map<java.lang.Integer,org.apache.iotdb.common.rpc.thrift.TSStatus> getResults()
Description copied from interface:BatchPlanReturn execution status for each path- Specified by:
getResultsin interfaceBatchPlan- Returns:
- execution status for each path
-
getPrefixPaths
public java.util.List<org.apache.iotdb.commons.path.PartialPath> getPrefixPaths()
Description copied from interface:BatchPlanReturn prefix paths of all sub-plans- Specified by:
getPrefixPathsin interfaceBatchPlan- Returns:
- prefix paths of all sub-plans
-
getBatchSize
public int getBatchSize()
Description copied from interface:BatchPlanReturn how many sub-plans are in the plan- Specified by:
getBatchSizein interfaceBatchPlan- Returns:
- how many sub-plans are in the plan.
-
getRowPlanIndexList
public int[] getRowPlanIndexList()
-
unsetIsExecuted
public void unsetIsExecuted(int i)
Description copied from interface:BatchPlanMark the sub-plan at position i as not executed.- Specified by:
unsetIsExecutedin interfaceBatchPlan- Parameters:
i- the position of the sub-plan
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-