Class InsertPlan
- java.lang.Object
-
- org.apache.iotdb.db.qp.physical.PhysicalPlan
-
- org.apache.iotdb.db.qp.physical.crud.InsertPlan
-
- All Implemented Interfaces:
org.apache.iotdb.consensus.common.request.IConsensusRequest
- Direct Known Subclasses:
InsertMultiTabletsPlan,InsertRowPlan,InsertRowsOfOneDevicePlan,InsertRowsPlan,InsertTabletPlan
public abstract class InsertPlan extends PhysicalPlan
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.iotdb.db.qp.physical.PhysicalPlan
PhysicalPlan.Factory, PhysicalPlan.PhysicalPlanType
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[]dataTypesprotected IDeviceIDdeviceIDdevice id reference, for reuse device id in both id table and memtable
used in memtableprotected org.apache.iotdb.commons.path.PartialPathdevicePathif use id table, this filed is id form of device path
if not, this filed is device pathprotected booleanisAlignedprotected IMeasurementMNode[]measurementMNodesprotected java.lang.String[]measurements-
Fields inherited from class org.apache.iotdb.db.qp.physical.PhysicalPlan
canBeSplit, index
-
-
Constructor Summary
Constructors Constructor Description InsertPlan(Operator.OperatorType operatorType)
-
Method Summary
All Methods Instance Methods Abstract 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.org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[]getDataTypes()IDeviceIDgetDeviceID()device id reference, for reuse device id in both id table and memtable
used in memtableorg.apache.iotdb.commons.path.PartialPathgetDevicePath()if use id table, this filed is id form of device path
if not, this filed is device path
used in flush time manager, last cache, tsfile processorjava.util.List<java.lang.Exception>getFailedExceptions()intgetFailedMeasurementNumber()java.util.List<java.lang.String>getFailedMeasurements()abstract java.lang.ObjectgetFirstValueOfIndex(int index)IMeasurementMNode[]getMeasurementMNodes()java.lang.String[]getMeasurements()abstract longgetMinTime()InsertPlangetPlanFromFailed()Reconstruct this plan with the failed measurements.booleanhasValidMeasurements()booleanisAligned()voidmarkFailedMeasurementInsertion(int index, java.lang.Exception e)This method is overrided in InsertRowPlan and InsertTabletPlan.voidrecoverFromFailure()Reset measurements from failed measurements (if any), as if no failure had ever happened.voidsetAligned(boolean aligned)voidsetDataTypes(org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes)voidsetDeviceID(IDeviceID deviceID)voidsetDevicePath(org.apache.iotdb.commons.path.PartialPath devicePath)voidsetMeasurementMNodes(IMeasurementMNode[] mNodes)voidsetMeasurements(java.lang.String[] measurements)-
Methods inherited from class org.apache.iotdb.db.qp.physical.PhysicalPlan
canBeSplit, deserialize, deserialize, getAggregations, getAuthPaths, getIndex, getLoginUserName, getOperatorName, getOperatorType, getPaths, isAuthenticationRequired, isDebug, isPrefixMatch, isQuery, isSelectInto, putString, putString, putStrings, putStrings, readString, readStrings, serialize, serialize, serializeImpl, serializeToByteBuffer, setDebug, setIndex, setLoginUserName, setOperatorType, setPaths, setPrefixMatch, setQuery
-
-
-
-
Field Detail
-
devicePath
protected org.apache.iotdb.commons.path.PartialPath devicePath
if use id table, this filed is id form of device path
if not, this filed is device path
-
isAligned
protected boolean isAligned
-
measurements
protected java.lang.String[] measurements
-
dataTypes
protected org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes
-
measurementMNodes
protected IMeasurementMNode[] measurementMNodes
-
deviceID
protected IDeviceID deviceID
device id reference, for reuse device id in both id table and memtable
used in memtable
-
-
Constructor Detail
-
InsertPlan
public InsertPlan(Operator.OperatorType operatorType)
-
-
Method Detail
-
getDevicePath
public org.apache.iotdb.commons.path.PartialPath getDevicePath()
if use id table, this filed is id form of device path
if not, this filed is device path
used in flush time manager, last cache, tsfile processor
-
setDevicePath
public void setDevicePath(org.apache.iotdb.commons.path.PartialPath devicePath)
-
getMeasurements
public java.lang.String[] getMeasurements()
-
setMeasurements
public void setMeasurements(java.lang.String[] measurements)
-
hasValidMeasurements
public boolean hasValidMeasurements()
-
getDataTypes
public org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] getDataTypes()
-
setDataTypes
public void setDataTypes(org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes)
-
getMeasurementMNodes
public IMeasurementMNode[] getMeasurementMNodes()
-
setMeasurementMNodes
public void setMeasurementMNodes(IMeasurementMNode[] mNodes)
-
getFailedMeasurements
public java.util.List<java.lang.String> getFailedMeasurements()
-
getFailedExceptions
public java.util.List<java.lang.Exception> getFailedExceptions()
-
getFailedMeasurementNumber
public int getFailedMeasurementNumber()
-
isAligned
public boolean isAligned()
-
setAligned
public void setAligned(boolean aligned)
-
getMinTime
public abstract long getMinTime()
-
getFirstValueOfIndex
public abstract java.lang.Object getFirstValueOfIndex(int index)
-
markFailedMeasurementInsertion
public void markFailedMeasurementInsertion(int index, java.lang.Exception e)This method is overrided in InsertRowPlan and InsertTabletPlan. After marking failed measurements, the failed values or columns would be null as well. We'd better use "measurements[index] == null" to determine if the measurement failed.- Parameters:
index- failed measurement index
-
getPlanFromFailed
public InsertPlan getPlanFromFailed()
Reconstruct this plan with the failed measurements.- Returns:
- the plan itself, with measurements replaced with the previously failed ones.
-
recoverFromFailure
public void recoverFromFailure()
Reset measurements from failed measurements (if any), as if no failure had ever happened.
-
checkIntegrity
public void checkIntegrity() throws QueryProcessExceptionDescription 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 classPhysicalPlan- Throws:
QueryProcessException- when the check fails
-
getDeviceID
public IDeviceID getDeviceID()
device id reference, for reuse device id in both id table and memtable
used in memtable
-
setDeviceID
public void setDeviceID(IDeviceID deviceID)
-
-