Class InsertRowNode
- java.lang.Object
-
- org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNode
-
- org.apache.iotdb.db.mpp.plan.planner.plan.node.WritePlanNode
-
- org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertNode
-
- org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowNode
-
- All Implemented Interfaces:
org.apache.iotdb.consensus.common.request.IConsensusRequest,IPartitionRelatedNode,SerializedSize,WALEntryValue
public class InsertRowNode extends InsertNode implements WALEntryValue
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertNode
InsertNode.FailedMeasurementInfo
-
-
Field Summary
-
Fields inherited from class org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertNode
dataRegionReplicaSet, dataTypes, deviceID, devicePath, failedMeasurementIndex2Info, isAligned, measurements, measurementSchemas, NO_CONSENSUS_INDEX, searchIndex
-
Fields inherited from class org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNode
CHILD_COUNT_NO_LIMIT, NO_CHILD_ALLOWED, ONE_CHILD
-
-
Constructor Summary
Constructors Constructor Description InsertRowNode(PlanNodeId id)InsertRowNode(PlanNodeId id, org.apache.iotdb.commons.path.PartialPath devicePath, boolean isAligned, java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, long time, java.lang.Object[] values, boolean isNeedInferType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,C>
Raccept(PlanVisitor<R,C> visitor, C context)voidaddChild(PlanNode child)intallowedChildCount()PlanNodeclone()org.apache.iotdb.tsfile.read.TimeValuePaircomposeTimeValuePair(int columnIndex)static InsertRowNodedeserialize(java.nio.ByteBuffer byteBuffer)static InsertRowNodedeserializeFromWAL(java.io.DataInputStream stream)Deserialize from walstatic InsertRowNodedeserializeFromWAL(java.nio.ByteBuffer buffer)Deserialize from walbooleanequals(java.lang.Object o)voidfillDataTypesAndValuesFromWAL(java.io.DataInputStream stream)Make sure the dataTypes and values have been created before calling thisvoidfillDataTypesAndValuesFromWAL(java.nio.ByteBuffer buffer)Make sure the dataTypes and values have been created before calling thisjava.util.List<PlanNode>getChildren()org.apache.iotdb.tsfile.file.metadata.enums.TSDataTypegetDataType(int index)org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[]getDataTypes()java.lang.ObjectgetFirstValueOfIndex(int index)longgetMinTime()java.util.List<java.lang.String>getOutputColumnNames()longgetTime()java.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot>getTimePartitionSlots()java.lang.Object[]getValues()inthashCode()booleanisNeedInferType()voidmarkFailedMeasurement(int index, java.lang.Exception cause)Mark failed measurement, measurements[index], dataTypes[index] and values/columns[index] would be null.protected voidserializeAttributes(java.io.DataOutputStream stream)protected voidserializeAttributes(java.nio.ByteBuffer byteBuffer)intserializedSize()Serialized size for walvoidserializeToWAL(IWALByteBufferView buffer)Compared with {@link this#serialize(ByteBuffer)}, more info: search index, less info: isNeedInferTypevoidsetNeedInferType(boolean needInferType)voidsetTime(long time)voidsetValues(java.lang.Object[] values)java.util.List<WritePlanNode>splitByPartition(Analysis analysis)booleanvalidateAndSetSchema(ISchemaTree schemaTree)-
Methods inherited from class org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertNode
deserializeMeasurementSchemas, deserializeMeasurementSchemas, getDataRegionReplicaSet, getDeviceID, getDevicePath, getFailedExceptions, getFailedMeasurementNumber, getFailedMeasurements, getFailedMessages, getMeasurements, getMeasurementSchemas, getRegionReplicaSet, getSearchIndex, hasFailedMeasurements, hasValidMeasurements, isAligned, selfCheckDataTypes, serializeMeasurementSchemasSize, serializeMeasurementSchemasToWAL, setAligned, setDataRegionReplicaSet, setDataTypes, setDeviceID, setDevicePath, setMeasurementSchemas, setSearchIndex
-
Methods inherited from class org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNode
cloneWithChildren, getPlanNodeId, serialize, serialize, serializeToByteBuffer, setPlanNodeId
-
-
-
-
Constructor Detail
-
InsertRowNode
public InsertRowNode(PlanNodeId id)
-
InsertRowNode
public InsertRowNode(PlanNodeId id, org.apache.iotdb.commons.path.PartialPath devicePath, boolean isAligned, java.lang.String[] measurements, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] dataTypes, long time, java.lang.Object[] values, boolean isNeedInferType)
-
-
Method Detail
-
splitByPartition
public java.util.List<WritePlanNode> splitByPartition(Analysis analysis)
- Specified by:
splitByPartitionin classWritePlanNode
-
getChildren
public java.util.List<PlanNode> getChildren()
- Specified by:
getChildrenin classPlanNode
-
allowedChildCount
public int allowedChildCount()
- Specified by:
allowedChildCountin classPlanNode
-
getOutputColumnNames
public java.util.List<java.lang.String> getOutputColumnNames()
- Specified by:
getOutputColumnNamesin classPlanNode
-
getDataTypes
public org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] getDataTypes()
- Overrides:
getDataTypesin classInsertNode
-
getDataType
public org.apache.iotdb.tsfile.file.metadata.enums.TSDataType getDataType(int index)
- Overrides:
getDataTypein classInsertNode
-
getValues
public java.lang.Object[] getValues()
-
setValues
public void setValues(java.lang.Object[] values)
-
getTime
public long getTime()
-
setTime
public void setTime(long time)
-
isNeedInferType
public boolean isNeedInferType()
-
setNeedInferType
public void setNeedInferType(boolean needInferType)
-
getTimePartitionSlots
public java.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot> getTimePartitionSlots()
-
validateAndSetSchema
public boolean validateAndSetSchema(ISchemaTree schemaTree)
- Specified by:
validateAndSetSchemain classInsertNode
-
markFailedMeasurement
public void markFailedMeasurement(int index, java.lang.Exception cause)Description copied from class:InsertNodeMark failed measurement, measurements[index], dataTypes[index] and values/columns[index] would be null. We'd better use "measurements[index] == null" to determine if the measurement failed.
This method is not concurrency-safe.- Overrides:
markFailedMeasurementin classInsertNode- Parameters:
index- failed measurement indexcause- cause Exception of failure
-
serializeAttributes
protected void serializeAttributes(java.nio.ByteBuffer byteBuffer)
- Overrides:
serializeAttributesin classInsertNode
-
serializeAttributes
protected void serializeAttributes(java.io.DataOutputStream stream) throws java.io.IOException- Overrides:
serializeAttributesin classInsertNode- Throws:
java.io.IOException
-
deserialize
public static InsertRowNode deserialize(java.nio.ByteBuffer byteBuffer)
-
getMinTime
public long getMinTime()
- Specified by:
getMinTimein classInsertNode
-
getFirstValueOfIndex
public java.lang.Object getFirstValueOfIndex(int index)
- Specified by:
getFirstValueOfIndexin classInsertNode
-
serializedSize
public int serializedSize()
Serialized size for wal- Specified by:
serializedSizein interfaceSerializedSize- Returns:
- bytes number
-
serializeToWAL
public void serializeToWAL(IWALByteBufferView buffer)
Compared with {@link this#serialize(ByteBuffer)}, more info: search index, less info: isNeedInferType- Specified by:
serializeToWALin interfaceWALEntryValue
-
deserializeFromWAL
public static InsertRowNode deserializeFromWAL(java.io.DataInputStream stream) throws java.io.IOException
Deserialize from wal- Throws:
java.io.IOException
-
fillDataTypesAndValuesFromWAL
public void fillDataTypesAndValuesFromWAL(java.io.DataInputStream stream) throws java.io.IOExceptionMake sure the dataTypes and values have been created before calling this- Throws:
java.io.IOException
-
deserializeFromWAL
public static InsertRowNode deserializeFromWAL(java.nio.ByteBuffer buffer)
Deserialize from wal
-
fillDataTypesAndValuesFromWAL
public void fillDataTypesAndValuesFromWAL(java.nio.ByteBuffer buffer)
Make sure the dataTypes and values have been created before calling this
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classInsertNode
-
hashCode
public int hashCode()
- Overrides:
hashCodein classInsertNode
-
accept
public <R,C> R accept(PlanVisitor<R,C> visitor, C context)
-
composeTimeValuePair
public org.apache.iotdb.tsfile.read.TimeValuePair composeTimeValuePair(int columnIndex)
-
-