Package com.illumon.iris.db.v2.dataindex
Class StaticGroupingProvider
java.lang.Object
com.illumon.iris.db.v2.dataindex.MemoizingGroupingProvider
com.illumon.iris.db.v2.dataindex.StaticGroupingProvider
- All Implemented Interfaces:
GroupingProvider
A
GroupingProvider
implementation that constructs groupings from a statically precomputed grouping table.
Users should construct instances using buildFrom(ColumnSource, String, Index)
-
Method Summary
Modifier and TypeMethodDescriptionstatic StaticGroupingProvider
Wrap the specified grouping in a newStaticGroupingProvider
.static <T> StaticGroupingProvider
buildFrom
(ColumnSource<T> source, String keyColumnName, Index indexOfInterest) Construct a newStaticGroupingProvider
from the specified column source and index of interest.static <T> StaticGroupingProvider
buildFrom
(ColumnSource<T> source, String keyColumnName, Index indexOfInterest, boolean useExistingGrouping) Construct a newStaticGroupingProvider
from the specified column source and index of interest.static <T> StaticGroupingProvider
buildFrom
(Map<T, ReadOnlyIndex> baseGrouping, com.illumon.dataobjects.ColumnDefinition<T> groupingColDef) Construct a newStaticGroupingProvider
from the specified grouping map.static <T> StaticGroupingProvider
buildFrom
(Map<T, ReadOnlyIndex> baseGrouping, String groupingColumnName) Construct a newStaticGroupingProvider
from the specified grouping map.static <T> StaticGroupingProvider
buildFrom
(Map<T, ReadOnlyIndex> baseGrouping, String groupingColumnName, Class<T> groupingValueType, Class<?> groupingValueComponentType) Construct a newStaticGroupingProvider
from the specified grouping map.com.illumon.iris.db.v2.dataindex.StaticGroupingProvider.StaticGroupingBuilder
Get aGroupingBuilder
suitable for creating groups with specific properties.boolean
Check if this provider is able to create a grouping or not.Methods inherited from class com.illumon.iris.db.v2.dataindex.MemoizingGroupingProvider
clearMemoizedGroupings, memoizeGrouping
-
Method Details
-
getGroupingBuilder
@NotNull public com.illumon.iris.db.v2.dataindex.StaticGroupingProvider.StaticGroupingBuilder getGroupingBuilder()Description copied from interface:GroupingProvider
Get aGroupingBuilder
suitable for creating groups with specific properties.- Specified by:
getGroupingBuilder
in interfaceGroupingProvider
- 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 interfaceGroupingProvider
- 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 newStaticGroupingProvider
.- Parameters:
inputGrouping
- The input grouping table to wrapvalueColumnName
- The name of the value column in the provided groupingindexColumnName
- 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 newStaticGroupingProvider
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 groupindexOfInterest
- 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 newStaticGroupingProvider
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 groupindexOfInterest
- the index to use as the whole table indexuseExistingGrouping
- 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 newStaticGroupingProvider
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 newStaticGroupingProvider
from the specified grouping map.- Type Parameters:
T
- the key type.- Parameters:
baseGrouping
- the base grouping map.groupingColDef
- TheColumnDefinition
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 newStaticGroupingProvider
from the specified grouping map.- Type Parameters:
T
- the key type.- Parameters:
baseGrouping
- the base grouping map.groupingValueType
- The type of the grouping columngroupingValueComponentType
- the component type of the grouping column, if it was an array.- Returns:
- a new
StaticGroupingProvider
-