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.

  • 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

      @NotNull public ReadOnlyIndex applyUpdates(@NotNull IndexShiftData shiftsToApply)
    • forAllModifiedSlots

      public void forAllModifiedSlots(@NotNull UpdateBySlotTracker.ModifiedSlotConsumer slotConsumer)
      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

      public UpdateBySlotTracker.UpdateTracker getTracker(int slot)