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 interface
UpdateBySlotTracker.ModifiedSlotConsumer
static class
UpdateBySlotTracker.UpdateTracker
-
Constructor Summary
Constructors Constructor Description UpdateBySlotTracker(int chunkSize)
-
Method Summary
Modifier and Type Method Description void
addToBucket(int slot, long keyToAdd)
void
addToBucket(int slot, LongChunk<? extends Attributes.KeyIndices> addedChunk, int startPos, int length)
Add a slot in the main table.ReadOnlyIndex
applyUpdates(IndexShiftData shiftsToApply)
void
forAllModifiedSlots(UpdateBySlotTracker.ModifiedSlotConsumer slotConsumer)
For each value, call slotConsumer.long
getModifiedBucketCount()
UpdateBySlotTracker.UpdateTracker
getTracker(int slot)
void
markForShift(int slot)
void
modifyBucket(int slot, long modifiedKey)
void
modifyBucket(int slot, LongChunk<? extends Attributes.KeyIndices> modifiedChunk, int startPos, int length)
void
removeFromBucket(int slot, long removedKey)
void
removeFromBucket(int slot, LongChunk<? extends Attributes.KeyIndices> removedChunk, int startPos, int length)
void
reset()
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
-