Class RingTableTools

java.lang.Object
io.deephaven.engine.table.impl.sources.ring.RingTableTools

public class RingTableTools extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Table
    of(Table parent, int capacity)
    Equivalent to of(parent, capacity, true).
    static Table
    of(Table parent, int capacity, boolean initialize)
    Constructs a "ring" table, whereby the latest capacity rows from the parent are retained and re-indexed by the resulting ring table.
    static Table
    of2(Table parent, int capacity, boolean initialize)
    Constructs a "ring" table, where the next-power-of-2 capacity from the parent are retained and re-indexed, with an additional TableOperations.tail(long) to restructure for capacity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RingTableTools

      public RingTableTools()
  • Method Details

    • of

      public static Table of(Table parent, int capacity)
      Equivalent to of(parent, capacity, true).
      Parameters:
      parent - the parent
      capacity - the capacity
      Returns:
      the ring table
      See Also:
    • of

      public static Table of(Table parent, int capacity, boolean initialize)
      Constructs a "ring" table, whereby the latest capacity rows from the parent are retained and re-indexed by the resulting ring table. Latest is determined solely by the TableUpdate.added() updates, TableUpdate.removed() are ignored; and TableUpdate.modified() / TableUpdate.shifted() are not expected. In particular, this is a useful construction with blink tables which do not retain their own data for more than an update cycle.
      Parameters:
      parent - the parent
      capacity - the capacity
      initialize - if the resulting table should source initial data from the snapshot of parent
      Returns:
      the ring table
    • of2

      public static Table of2(Table parent, int capacity, boolean initialize)
      Constructs a "ring" table, where the next-power-of-2 capacity from the parent are retained and re-indexed, with an additional TableOperations.tail(long) to restructure for capacity.

      Logically equivalent to of(parent, Integer.highestOneBit(capacity - 1) << 1, initialize).tail(capacity).

      This setup may be useful when consumers need to maximize random access fill speed from a ring table.

      Parameters:
      parent - the parent
      capacity - the capacity
      initialize - if the resulting table should source initial data from the snapshot of parent
      Returns:
      the ring table
      See Also: