Class InsertRowPlan
- 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.InsertRowPlan
-
- All Implemented Interfaces:
org.apache.iotdb.consensus.common.request.IConsensusRequest,SerializedSize,WALEntryValue
public class InsertRowPlan extends InsertPlan implements WALEntryValue
-
-
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 InsertRowPlan()InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurementList, java.lang.String[] insertValues)InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurementList, java.nio.ByteBuffer values, boolean isAligned)InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, java.lang.String[] insertValues)InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, java.lang.String[] insertValues, boolean isAligned)InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String measurement, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType type, java.lang.String insertValue)InsertRowPlan(InsertRowPlan another)InsertRowPlan(org.apache.iotdb.tsfile.write.record.TSRecord tsRecord)
-
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.org.apache.iotdb.tsfile.read.TimeValuePaircomposeTimeValuePair(int columnIndex)voiddeserialize(java.io.DataInputStream stream)voiddeserialize(java.nio.ByteBuffer buffer)Deserialize the plan from the given buffer.booleanequals(java.lang.Object o)voidfillValues(java.io.DataInputStream stream)voidfillValues(java.nio.ByteBuffer buffer)Make sure the values is already inited before calling thisjava.lang.ObjectgetFirstValueOfIndex(int index)longgetMinTime()java.util.List<org.apache.iotdb.commons.path.PartialPath>getPaths()InsertPlangetPlanFromFailed()Reconstruct this plan with the failed measurements.longgetTime()java.lang.Object[]getValues()inthashCode()booleanisNeedInferType()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.voidserialize(java.io.DataOutputStream stream)Serialize the plan into the given buffer.intserializedSize()Calculate size after serialization.voidserializeImpl(java.nio.ByteBuffer buffer)voidserializeToWAL(IWALByteBufferView buffer)Serialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.voidsetNeedInferType(boolean inferType)voidsetTime(long time)voidsetValues(java.lang.Object[] values)voidsubSerialize(java.io.DataOutputStream stream)java.lang.StringtoString()voidtransferType()if inferType is true, transfer String[] values to specific data types (Integer, Long, Float, Double, Binary)-
Methods inherited from class org.apache.iotdb.db.qp.physical.crud.InsertPlan
getDataTypes, getDeviceID, getDevicePath, getFailedExceptions, getFailedMeasurementNumber, getFailedMeasurements, getMeasurementMNodes, getMeasurements, hasValidMeasurements, isAligned, setAligned, setDataTypes, setDeviceID, setDevicePath, setMeasurementMNodes, setMeasurements
-
Methods inherited from class org.apache.iotdb.db.qp.physical.PhysicalPlan
canBeSplit, getAggregations, getAuthPaths, getIndex, getLoginUserName, getOperatorName, getOperatorType, isAuthenticationRequired, isDebug, isPrefixMatch, isQuery, isSelectInto, putString, putString, putStrings, putStrings, readString, readStrings, serialize, serializeToByteBuffer, setDebug, setIndex, setLoginUserName, setOperatorType, setPaths, setPrefixMatch, setQuery
-
-
-
-
Constructor Detail
-
InsertRowPlan
public InsertRowPlan()
-
InsertRowPlan
public InsertRowPlan(InsertRowPlan another)
-
InsertRowPlan
public InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurementList, java.lang.String[] insertValues)
-
InsertRowPlan
public InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurementList, java.nio.ByteBuffer values, boolean isAligned) throws QueryProcessException- Throws:
QueryProcessException
-
InsertRowPlan
public InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, java.lang.String[] insertValues)
-
InsertRowPlan
public InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, java.lang.String[] insertValues, boolean isAligned)
-
InsertRowPlan
public InsertRowPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, long insertTime, java.lang.String measurement, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType type, java.lang.String insertValue)
-
InsertRowPlan
public InsertRowPlan(org.apache.iotdb.tsfile.write.record.TSRecord tsRecord) throws org.apache.iotdb.commons.exception.IllegalPathException- Throws:
org.apache.iotdb.commons.exception.IllegalPathException
-
-
Method Detail
-
getTime
public long getTime()
-
setTime
public void setTime(long time)
-
isNeedInferType
public boolean isNeedInferType()
-
setNeedInferType
public void setNeedInferType(boolean inferType)
-
transferType
public void transferType() throws QueryProcessExceptionif inferType is true, transfer String[] values to specific data types (Integer, Long, Float, Double, Binary)- Throws:
QueryProcessException
-
getMinTime
public long getMinTime()
- Specified by:
getMinTimein classInsertPlan
-
getFirstValueOfIndex
public java.lang.Object getFirstValueOfIndex(int index)
- Specified by:
getFirstValueOfIndexin classInsertPlan
-
markFailedMeasurementInsertion
public void markFailedMeasurementInsertion(int index, java.lang.Exception e)Description copied from class:InsertPlanThis 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.- Overrides:
markFailedMeasurementInsertionin classInsertPlan- Parameters:
index- failed measurement index
-
getPaths
public java.util.List<org.apache.iotdb.commons.path.PartialPath> getPaths()
- Specified by:
getPathsin classPhysicalPlan
-
getValues
public java.lang.Object[] getValues()
-
setValues
public void setValues(java.lang.Object[] values)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
serializedSize
public int serializedSize()
Description copied from interface:SerializedSizeCalculate size after serialization.- Specified by:
serializedSizein interfaceSerializedSize- Returns:
- bytes number
-
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
-
subSerialize
public void subSerialize(java.io.DataOutputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
fillValues
public void fillValues(java.io.DataInputStream stream) throws java.io.IOException, QueryProcessException- Throws:
java.io.IOExceptionQueryProcessException
-
fillValues
public void fillValues(java.nio.ByteBuffer buffer) throws QueryProcessExceptionMake sure the values is already inited before calling this- Throws:
QueryProcessException
-
serializeImpl
public void serializeImpl(java.nio.ByteBuffer buffer)
- Overrides:
serializeImplin classPhysicalPlan
-
serializeToWAL
public void serializeToWAL(IWALByteBufferView buffer)
Description copied from interface:WALEntryValueSerialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.- Specified by:
serializeToWALin interfaceWALEntryValue
-
deserialize
public void deserialize(java.io.DataInputStream stream) throws java.io.IOException, org.apache.iotdb.commons.exception.IllegalPathException- Overrides:
deserializein classPhysicalPlan- Throws:
java.io.IOExceptionorg.apache.iotdb.commons.exception.IllegalPathException
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
composeTimeValuePair
public org.apache.iotdb.tsfile.read.TimeValuePair composeTimeValuePair(int columnIndex)
-
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.
-
recoverFromFailure
public void recoverFromFailure()
Description copied from class:InsertPlanReset measurements from failed measurements (if any), as if no failure had ever happened.- Overrides:
recoverFromFailurein classInsertPlan
-
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 classInsertPlan- Throws:
QueryProcessException- when the check fails
-
-