Record Class ReadCommand
java.lang.Object
java.lang.Record
org.apache.iceberg.flink.maintenance.operator.ReadCommand
- All Implemented Interfaces:
Serializable
@Internal
public record ReadCommand(ContentScanTask<?> task, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber, boolean staging)
extends Record
implements Serializable
Envelope from the
EqualityConvertPlanner to the EqualityConvertReader, wrapping
an Iceberg ContentScanTask plus the metadata the reader needs to process it.
The wrapped task is either:
- A
FileScanTaskfor data files: native tasks fromtable.newScan()for main reindex, or aFlinkAddedRowsScanTaskwrapper for bareDataFiles fromSnapshotChanges#addedDataFiles. - An
EqualityDeleteFileScanTaskfor equality delete files.
The equality field IDs are static for the lifetime of the job and carried on the reader itself, not per-record.
mainSnapshotId is sent for diagnostic output.
indexGeneration is used by the index to order eager evictions by.
dataSequenceNumber is the wrapped file's sequence number (data file or equality
delete), propagated to the worker so a delete only deletes rows older than itself.
staging is true for a staging snapshot's new data rows, which the index defers until
after this cycle's delete resolves; false for main reindex data and equality deletes.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionReadCommand(ContentScanTask<?> task, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber, boolean staging) Creates an instance of aReadCommandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReadCommanddataFile(FileScanTask task, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber) longReturns the value of thedataSequenceNumberrecord component.static ReadCommandeqDeleteFile(DeleteFile file, PartitionSpec spec, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theindexGenerationrecord component.Returns the value of themainSnapshotIdrecord component.booleanstaging()Returns the value of thestagingrecord component.static ReadCommandstagingDataFile(FileScanTask task, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber) task()Returns the value of thetaskrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ReadCommand
public ReadCommand(ContentScanTask<?> task, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber, boolean staging) Creates an instance of aReadCommandrecord class.- Parameters:
task- the value for thetaskrecord componentmainSnapshotId- the value for themainSnapshotIdrecord componentindexGeneration- the value for theindexGenerationrecord componentdataSequenceNumber- the value for thedataSequenceNumberrecord componentstaging- the value for thestagingrecord component
-
-
Method Details
-
dataFile
public static ReadCommand dataFile(FileScanTask task, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber) -
stagingDataFile
public static ReadCommand stagingDataFile(FileScanTask task, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber) -
eqDeleteFile
public static ReadCommand eqDeleteFile(DeleteFile file, PartitionSpec spec, Long mainSnapshotId, Long indexGeneration, long dataSequenceNumber) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
task
Returns the value of thetaskrecord component.- Returns:
- the value of the
taskrecord component
-
mainSnapshotId
Returns the value of themainSnapshotIdrecord component.- Returns:
- the value of the
mainSnapshotIdrecord component
-
indexGeneration
Returns the value of theindexGenerationrecord component.- Returns:
- the value of the
indexGenerationrecord component
-
dataSequenceNumber
public long dataSequenceNumber()Returns the value of thedataSequenceNumberrecord component.- Returns:
- the value of the
dataSequenceNumberrecord component
-
staging
public boolean staging()Returns the value of thestagingrecord component.- Returns:
- the value of the
stagingrecord component
-