Class UpdateBySlotTracker
java.lang.Object
com.illumon.iris.db.v2.updateby.hashing.UpdateBySlotTracker
public class UpdateBySlotTracker extends Object
This class tracks indices by individual bucket. During an update cycle it also provides a means to accumulate updates to each bucket so that they can be processed on a per-bucket basis.
Accumulation of bucketed changes is done by assigning a cookie, incrementally, to each visited bucket. The cookie can be then used to retrieve the changes to that bucket which lets the update use space proportional to the number of visited buckets in the update, instead of the total number of buckets in the table.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceUpdateBySlotTracker.ModifiedSlotConsumerstatic classUpdateBySlotTracker.UpdateTracker -
Constructor Summary
Constructors Constructor Description UpdateBySlotTracker(int chunkSize) -
Method Summary
Modifier and Type Method Description voidaddToBucket(int slot, long keyToAdd)voidaddToBucket(int slot, LongChunk<? extends Attributes.KeyIndices> addedChunk, int startPos, int length)Add a slot in the main table.ReadOnlyIndexapplyUpdates(IndexShiftData shiftsToApply)voidforAllModifiedSlots(UpdateBySlotTracker.ModifiedSlotConsumer slotConsumer)For each value, call slotConsumer.longgetModifiedBucketCount()UpdateBySlotTracker.UpdateTrackergetTracker(int slot)voidmarkForShift(int slot)voidmodifyBucket(int slot, long modifiedKey)voidmodifyBucket(int slot, LongChunk<? extends Attributes.KeyIndices> modifiedChunk, int startPos, int length)voidremoveFromBucket(int slot, long removedKey)voidremoveFromBucket(int slot, LongChunk<? extends Attributes.KeyIndices> removedChunk, int startPos, int length)voidreset()Remove all entries from the tracker.
-
Constructor Details
-
UpdateBySlotTracker
public UpdateBySlotTracker(int chunkSize)
-
-
Method Details
-
getModifiedBucketCount
public long getModifiedBucketCount() -
reset
public void reset()Remove all entries from the tracker. -
applyUpdates
-
forAllModifiedSlots
For each value, call slotConsumer.- Parameters:
slotConsumer- the consumer of our values
-
addToBucket
public void addToBucket(int slot, @NotNull LongChunk<? extends Attributes.KeyIndices> addedChunk, int startPos, int length)Add a slot in the main table.- Parameters:
slot- the slot to add.
-
addToBucket
public void addToBucket(int slot, long keyToAdd) -
modifyBucket
public void modifyBucket(int slot, @NotNull LongChunk<? extends Attributes.KeyIndices> modifiedChunk, int startPos, int length) -
modifyBucket
public void modifyBucket(int slot, long modifiedKey) -
removeFromBucket
public void removeFromBucket(int slot, @NotNull LongChunk<? extends Attributes.KeyIndices> removedChunk, int startPos, int length) -
removeFromBucket
public void removeFromBucket(int slot, long removedKey) -
markForShift
public void markForShift(int slot) -
getTracker
-