Class UpdateSizeCalculator

java.lang.Object
com.illumon.iris.db.v2.utils.UpdateSizeCalculator

public class UpdateSizeCalculator
extends Object
Calculate the size of the chunks needed to process an update. The assumption is that the operation processes removed, modified, and added values sequentially (not concurrently); so the largest add/modified/removed index is all that is needed at one time. The effective shifts size is also included in the required update size.
  • Constructor Details

  • Method Details

    • chunkSize

      public static int chunkSize​(ShiftAwareListener.Update upstream, int chunkSize)
      Return the size of chunk needed to process this update (removed, modified, then added sequentially not concurrently).
      Parameters:
      upstream - the update to process
      chunkSize - the maximum chunk size (a maximum for our size)
      Returns:
      an appropriate maximum chunk size for this update
    • chunkSize

      public static int chunkSize​(long updateSize, IndexShiftData shifted, int chunkSize)
      Return the size of chunk needed to process the shifts in this update update.
      Parameters:
      updateSize - the existing update size (a minimum for our size)
      shifted - the shift to get the effective size for (clamped to chunkSize)
      chunkSize - the maximum chunk size (a maximum for our size)
      Returns:
      an appropriate maximum chunk size for this update