Class InsertTabletPlan
- 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.InsertTabletPlan
-
- All Implemented Interfaces:
org.apache.iotdb.consensus.common.request.IConsensusRequest,SerializedSize,WALEntryValue
public class InsertTabletPlan 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 InsertTabletPlan()InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.lang.String[] measurements)InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.lang.String[] measurements, java.util.List<java.lang.Integer> dataTypes)InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.lang.String[] measurements, java.util.List<java.lang.Integer> dataTypes, boolean isAligned)InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.util.List<java.lang.String> measurements)
-
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.TimeValuePaircomposeLastTimeValuePair(int measurementIndex)voiddeserialize(java.io.DataInputStream stream)voiddeserialize(java.nio.ByteBuffer buffer)Deserialize the plan from the given buffer.booleanequals(java.lang.Object o)org.apache.iotdb.tsfile.utils.BitMap[]getBitMaps()java.lang.Object[]getColumns()java.lang.ObjectgetFirstValueOfIndex(int index)longgetMaxTime()longgetMinTime()java.util.List<org.apache.iotdb.commons.path.PartialPath>getPaths()InsertPlangetPlanFromFailed()Reconstruct this plan with the failed measurements.java.util.List<java.lang.Integer>getRange()intgetRowCount()long[]getTimes()inthashCode()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.intserializedSize(int start, int end)voidserializeImpl(java.nio.ByteBuffer buffer)voidserializeToWAL(IWALByteBufferView buffer)Serialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.voidserializeToWAL(IWALByteBufferView buffer, int start, int end)voidsetBitMaps(org.apache.iotdb.tsfile.utils.BitMap[] bitMaps)voidsetColumn(int index, java.lang.Object column)voidsetColumns(java.lang.Object[] columns)voidsetDataTypes(java.util.List<java.lang.Integer> dataTypes)voidsetRange(java.util.List<java.lang.Integer> range)voidsetRowCount(int size)voidsetTimes(long[] times)java.lang.StringtoString()-
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
-
InsertTabletPlan
public InsertTabletPlan()
-
InsertTabletPlan
public InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.util.List<java.lang.String> measurements)
-
InsertTabletPlan
public InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.lang.String[] measurements)
-
InsertTabletPlan
public InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.lang.String[] measurements, java.util.List<java.lang.Integer> dataTypes)
-
InsertTabletPlan
public InsertTabletPlan(org.apache.iotdb.commons.path.PartialPath prefixPath, java.lang.String[] measurements, java.util.List<java.lang.Integer> dataTypes, boolean isAligned)
-
-
Method Detail
-
getRange
public java.util.List<java.lang.Integer> getRange()
-
setRange
public void setRange(java.util.List<java.lang.Integer> range)
-
getPaths
public java.util.List<org.apache.iotdb.commons.path.PartialPath> getPaths()
- Specified by:
getPathsin classPhysicalPlan
-
serializedSize
public int serializedSize()
Description copied from interface:SerializedSizeCalculate size after serialization.- Specified by:
serializedSizein interfaceSerializedSize- Returns:
- bytes number
-
serializedSize
public int serializedSize(int start, int end)
-
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
-
serializeToWAL
public void serializeToWAL(IWALByteBufferView buffer)
Description copied from interface:WALEntryValueSerialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.- Specified by:
serializeToWALin interfaceWALEntryValue
-
serializeToWAL
public void serializeToWAL(IWALByteBufferView buffer, int start, int end)
-
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
-
setDataTypes
public void setDataTypes(java.util.List<java.lang.Integer> dataTypes)
-
getColumns
public java.lang.Object[] getColumns()
-
setColumns
public void setColumns(java.lang.Object[] columns)
-
setColumn
public void setColumn(int index, java.lang.Object column)
-
getBitMaps
public org.apache.iotdb.tsfile.utils.BitMap[] getBitMaps()
-
setBitMaps
public void setBitMaps(org.apache.iotdb.tsfile.utils.BitMap[] bitMaps)
-
getMinTime
public long getMinTime()
- Specified by:
getMinTimein classInsertPlan
-
getMaxTime
public long getMaxTime()
-
getFirstValueOfIndex
public java.lang.Object getFirstValueOfIndex(int index)
- Specified by:
getFirstValueOfIndexin classInsertPlan
-
composeLastTimeValuePair
public org.apache.iotdb.tsfile.read.TimeValuePair composeLastTimeValuePair(int measurementIndex)
-
getTimes
public long[] getTimes()
-
setTimes
public void setTimes(long[] times)
-
getRowCount
public int getRowCount()
-
setRowCount
public void setRowCount(int size)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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
-
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.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
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
-
-