Class EvenlyDividedTableMap

java.lang.Object
com.illumon.iris.db.v2.EvenlyDividedTableMap

public class EvenlyDividedTableMap
extends Object
Divide a table evenly into slices and put the slices into a TableMap. This enables the use of parallelism on a table without the full cost of a byExternal operation.
  • Method Details

    • makeEvenlyDividedTableMap

      public static TableMap makeEvenlyDividedTableMap​(Table table, int divisions, int minimumSize)
      Divide the table into even slices, inserting the results into a TableMap.

      This method is intended to be used to enable parallelism by creating a TableMap without the cost of a full byExternal. It is important to note that any natural boundaries in the data are not respected, thus when doing operations in parallel and calling TransformableTableMap.merge() the result is very likely not the same as doing the operations individually. Care must be taken to preserve your desired semantics.

      Parameters:
      table - the table to divide
      divisions - how many divisions should be created, you may want to align this value with TableMapTransformThreadPool.getTransformThreads().
      minimumSize - the minimum size of each division
      Returns:
      a TableMap with constituents representing the slices of the original table