Package com.illumon.iris.db.v2.dataindex
Interface GroupingBuilder
- All Known Implementing Classes:
AbstractGroupingBuilder
public interface GroupingBuilder
A builder interface used to create grouping tables or maps.
-
Method Summary
Modifier and TypeMethodDescriptionaddRegionMutator
(Function<Table, Table> mutator) Add a method that will process tables per region.<T> Map<T,
ReadOnlyIndex> Build a Map of the Grouping values based on the current configuration of this builder.Build a Grouping table based on the current configuration of this builder.default GroupingBuilder
clampToIndex
(ReadOnlyIndex index) Indicate that only groups which intersect the specified index are returned in the final table.clampToIndex
(ReadOnlyIndex index, boolean strict) Clamp the returned table of indices to the specified range.long
Estimate the total size of the resultant grouping table based on the current builder parameters.default String
Get the name of the column containing the grouping indices.Get the name of the column containing the grouping keys.static <DATA_TYPE>
TablemakeNullOnlyGroupingTable
(com.illumon.dataobjects.ColumnDefinition<DATA_TYPE> columnDefinition, long firstKey, long lastKey) Only include keys in the resultant grouping that match the specified set of grouping keys, optionally ignoring case or inverting the match.positionally
(ReadOnlyIndex inverter) Construct groupings as positions, as if the source index were flat.Sort the final grouping table by the first key within each group.
-
Method Details
-
makeNullOnlyGroupingTable
static <DATA_TYPE> Table makeNullOnlyGroupingTable(com.illumon.dataobjects.ColumnDefinition<DATA_TYPE> columnDefinition, long firstKey, long lastKey) -
addRegionMutator
Add a method that will process tables per region. If the mutator returns a null or empty table, it will not be passed to the following mutators.- Parameters:
mutator
- a function to process the input tables.- Returns:
- this
GroupingBuilder
-
clampToIndex
Clamp the returned table of indices to the specified range. In strict mode, guarantees that the indices returned for each group include ony indices in the specified index.- Parameters:
index
- the index of intereststrict
- when true, the final table will contain only indices that are part of 'index'- Returns:
- this
GroupingBuilder
-
clampToIndex
Indicate that only groups which intersect the specified index are returned in the final table. Note that this may include indices in specified groups that are outside the index, but allows the implementation to optimize out entire regions which may not be contained in the specified index.Users may use
clampToIndex(ReadOnlyIndex, boolean)
for more control over this behavior.- Parameters:
index
- the index to constrain with- Returns:
- this
GroupingBuilder
-
sortByFirstKey
Sort the final grouping table by the first key within each group. This can be useful to maintain visitation order.- Returns:
- this
GroupingBuilder
-
matching
Only include keys in the resultant grouping that match the specified set of grouping keys, optionally ignoring case or inverting the match. The grouping keys must not be empty.- Parameters:
matchCase
- if matches should consider caseinvert
- if the match should be invertedgroupKeys
- the set of keys to match- Returns:
- this
GroupingBuilder
-
positionally
Construct groupings as positions, as if the source index were flat.- Returns:
- this
GroupingBuilder
-
buildTable
Build a Grouping table based on the current configuration of this builder.- Returns:
- the data index table.
-
buildGroupingMap
Build a Map of the Grouping values based on the current configuration of this builder. Note that the returned map will respect the table order of the final table.- Returns:
- a properly ordered Map of key to read only index.
-
estimateGroupingSize
long estimateGroupingSize()Estimate the total size of the resultant grouping table based on the current builder parameters. This method is guaranteed to return a worse-case size, that is, the final grouping may be smaller than reported, but will never be larger.- Returns:
- the estimated size of the grouping provided current parameters.
-
getIndexColumnName
Get the name of the column containing the grouping indices.- Returns:
- the name of the index column
-
getValueColumnName
Get the name of the column containing the grouping keys.- Returns:
- the name of the key column
-