Class MemoryBoundedColumnIteration

java.lang.Object
io.camunda.zeebe.engine.state.migration.MemoryBoundedColumnIteration

public final class MemoryBoundedColumnIteration extends Object
  • Constructor Details

    • MemoryBoundedColumnIteration

      public MemoryBoundedColumnIteration()
    • MemoryBoundedColumnIteration

      public MemoryBoundedColumnIteration(long memoryLimitBytes)
  • Method Details

    • drain

      public <KeyT extends DbKey, ValueT extends DbValue> void drain(ColumnFamily<KeyT,ValueT> columnFamily, BiConsumer<KeyT,ValueT> consumer)
      Drains iterates through all key value pairs of a column family and feeds them a consumer. Once the consumer returns, it will remove the key from the column.

      This iteration is done in chunks to minimize memory usage of the transaction. The usage is estimated based on the key and value length, which is only roughly accurate; do improve this in the future when there's a need (e.g. fanning out a key-value pair to multiple columns, for example).

      Type Parameters:
      KeyT - the type of the key
      ValueT - the type of the value
      Parameters:
      columnFamily - the column family to drain
      consumer - the consumer which handles the drained pairs