Record Class IndexCommand
- All Implemented Interfaces:
Serializable
EqualityConvertPlanner to the EqualityConvertPKIndex.
IndexCommand.Type.ADD_DATA_ROW adds an existing main-data row to the worker's PK index shard
immediately, so this cycle's delete can remove it. IndexCommand.Type.ADD_STAGING_DATA_ROW adds a
staging snapshot's new data row; the index applies it only after this cycle's delete resolves, so
a re-inserted key survives a same-cycle delete. Both carry the row location as rowPosition. IndexCommand.Type.RESOLVE_DELETE resolves an equality delete key against the index and
emits DVPositions for all matching rows. All three flow through the keyed stream and
route via key.
IndexCommand.Type.CLEAR_INDEX is emitted on the broadcast side when the index is rebuilt and the
worker must evict keyed entries that won't be re-added by that rebuild (e.g. PKs whose data file
was removed by CoW). Has no key or row position. Carries the new indexGeneration as the staleness threshold.
rowPosition is the data row's location, set for the two add types and null otherwise;
the data sequence number it carries lets the worker apply a delete only to older rows.
deleteSequenceNumber is the equality delete's sequence number, set for IndexCommand.Type.RESOLVE_DELETE and unused (-1) otherwise. deleteSpecId is the partition spec id of
the delete file, used to scope a partitioned delete to data rows of the same spec; GLOBAL_DELETE_SPEC_ID marks an unpartitioned delete that applies to every spec. Set for IndexCommand.Type.RESOLVE_DELETE and unused (-1) otherwise.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSpec id sentinel for an unpartitioned equality delete, which applies as a global delete. -
Constructor Summary
ConstructorsConstructorDescriptionIndexCommand(IndexCommand.Type type, Long mainSnapshotId, Long indexGeneration, SerializedEqualityValues key, DVPosition rowPosition, long deleteSequenceNumber, int deleteSpecId) Creates an instance of aIndexCommandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic IndexCommandaddDataRow(Long mainSnapshotId, Long indexGeneration, SerializedEqualityValues key, String filePath, long position, int specId, byte[] partition, long dataSequenceNumber, boolean staging) static IndexCommandclearBeforeReindex(long mainSnapshotId, long indexGeneration) longReturns the value of thedeleteSequenceNumberrecord component.intReturns the value of thedeleteSpecIdrecord component.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.key()Returns the value of thekeyrecord component.Returns the value of themainSnapshotIdrecord component.static IndexCommandresolveDelete(Long mainSnapshotId, Long indexGeneration, SerializedEqualityValues key, long deleteSequenceNumber, int deleteSpecId) Returns the value of therowPositionrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
GLOBAL_DELETE_SPEC_ID
public static final int GLOBAL_DELETE_SPEC_IDSpec id sentinel for an unpartitioned equality delete, which applies as a global delete.- See Also:
-
-
Constructor Details
-
IndexCommand
public IndexCommand(IndexCommand.Type type, Long mainSnapshotId, Long indexGeneration, SerializedEqualityValues key, DVPosition rowPosition, long deleteSequenceNumber, int deleteSpecId) Creates an instance of aIndexCommandrecord class.- Parameters:
type- the value for thetyperecord componentmainSnapshotId- the value for themainSnapshotIdrecord componentindexGeneration- the value for theindexGenerationrecord componentkey- the value for thekeyrecord componentrowPosition- the value for therowPositionrecord componentdeleteSequenceNumber- the value for thedeleteSequenceNumberrecord componentdeleteSpecId- the value for thedeleteSpecIdrecord component
-
-
Method Details
-
addDataRow
public static IndexCommand addDataRow(Long mainSnapshotId, Long indexGeneration, SerializedEqualityValues key, String filePath, long position, int specId, byte[] partition, long dataSequenceNumber, boolean staging) -
resolveDelete
public static IndexCommand resolveDelete(Long mainSnapshotId, Long indexGeneration, SerializedEqualityValues key, long deleteSequenceNumber, int deleteSpecId) -
clearBeforeReindex
-
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 '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord 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
-
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
rowPosition
Returns the value of therowPositionrecord component.- Returns:
- the value of the
rowPositionrecord component
-
deleteSequenceNumber
public long deleteSequenceNumber()Returns the value of thedeleteSequenceNumberrecord component.- Returns:
- the value of the
deleteSequenceNumberrecord component
-
deleteSpecId
public int deleteSpecId()Returns the value of thedeleteSpecIdrecord component.- Returns:
- the value of the
deleteSpecIdrecord component
-