Class UpdateBySlotTracker
java.lang.Object
com.illumon.iris.db.v2.updateby.hashing.UpdateBySlotTracker
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 ClassesModifier and TypeClassDescriptionstatic interface
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.applyUpdates
(IndexShiftData shiftsToApply) void
ensureCapacity
(long capacity) void
forAllModifiedSlots
(UpdateBySlotTracker.ModifiedSlotConsumer slotConsumer) For each value, call slotConsumer.long
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. -
ensureCapacity
public void ensureCapacity(long capacity) -
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
-