Class StaticGroupingProvider

java.lang.Object
com.illumon.iris.db.v2.dataindex.MemoizingGroupingProvider
com.illumon.iris.db.v2.dataindex.StaticGroupingProvider
All Implemented Interfaces:
GroupingProvider

public class StaticGroupingProvider extends MemoizingGroupingProvider implements GroupingProvider
A GroupingProvider implementation that constructs groupings from a statically precomputed grouping table. Users should construct instances using buildFrom(ColumnSource, String, Index)
  • Method Details

    • getGroupingBuilder

      @NotNull public com.illumon.iris.db.v2.dataindex.StaticGroupingProvider.StaticGroupingBuilder getGroupingBuilder()
      Description copied from interface: GroupingProvider
      Get a GroupingBuilder suitable for creating groups with specific properties.
      Specified by:
      getGroupingBuilder in interface GroupingProvider
      Returns:
      a GroupingBuilder
    • hasGrouping

      public boolean hasGrouping()
      Description copied from interface: GroupingProvider
      Check if this provider is able to create a grouping or not.
      Specified by:
      hasGrouping in interface GroupingProvider
      Returns:
      true if this provider can create a grouping.
    • buildFrom

      @NotNull public static StaticGroupingProvider buildFrom(@NotNull Table inputGrouping, @NotNull String valueColumnName, @NotNull String indexColumnName)
      Wrap the specified grouping in a new StaticGroupingProvider.
      Parameters:
      inputGrouping - The input grouping table to wrap
      valueColumnName - The name of the value column in the provided grouping
      indexColumnName - The name of the index column in the provided grouping
      Returns:
      a new StaticGroupingProvider.
    • buildFrom

      @NotNull public static <T> StaticGroupingProvider buildFrom(@NotNull ColumnSource<T> source, @NotNull String keyColumnName, @NotNull Index indexOfInterest)
      Construct a new StaticGroupingProvider from the specified column source and index of interest. Existing groupings will be used if it makes sense, otherwise new groupings will be computed directly.
      Type Parameters:
      T - The type of the column
      Parameters:
      source - The column source to group
      indexOfInterest - the index to use as the whole table index
      Returns:
      a new StaticGroupingProvider.
    • buildFrom

      @NotNull public static <T> StaticGroupingProvider buildFrom(@NotNull ColumnSource<T> source, @NotNull String keyColumnName, @NotNull Index indexOfInterest, boolean useExistingGrouping)
      Construct a new StaticGroupingProvider from the specified column source and index of interest. Existing groupings will be used if it makes sense, otherwise new groupings will be computed directly.
      Type Parameters:
      T - The type of the column
      Parameters:
      source - The column source to group
      indexOfInterest - the index to use as the whole table index
      useExistingGrouping - if existing groups should be used to compute the static grouping.
      Returns:
      a new StaticGroupingProvider.
    • buildFrom

      @NotNull public static <T> StaticGroupingProvider buildFrom(@NotNull Map<T,ReadOnlyIndex> baseGrouping, @NotNull String groupingColumnName)
      Construct a new StaticGroupingProvider from the specified grouping map. This will attempt to infer the grouping column type from the values within the grouping.
      Type Parameters:
      T - the key type.
      Parameters:
      baseGrouping - the base grouping map.
      Returns:
      a new StaticGroupingProvider
    • buildFrom

      @NotNull public static <T> StaticGroupingProvider buildFrom(@NotNull Map<T,ReadOnlyIndex> baseGrouping, @NotNull com.illumon.dataobjects.ColumnDefinition<T> groupingColDef)
      Construct a new StaticGroupingProvider from the specified grouping map.
      Type Parameters:
      T - the key type.
      Parameters:
      baseGrouping - the base grouping map.
      groupingColDef - The ColumnDefinition of the grouping column
      Returns:
      a new StaticGroupingProvider
    • buildFrom

      @NotNull public static <T> StaticGroupingProvider buildFrom(@NotNull Map<T,ReadOnlyIndex> baseGrouping, @NotNull String groupingColumnName, @NotNull Class<T> groupingValueType, @Nullable Class<?> groupingValueComponentType)
      Construct a new StaticGroupingProvider from the specified grouping map.
      Type Parameters:
      T - the key type.
      Parameters:
      baseGrouping - the base grouping map.
      groupingValueType - The type of the grouping column
      groupingValueComponentType - the component type of the grouping column, if it was an array.
      Returns:
      a new StaticGroupingProvider