Class GroupMaker
java.lang.Object
org.apache.cassandra.db.aggregation.GroupMaker
A
GroupMaker can be used to determine if some sorted rows belongs to the same group or not.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GroupMakerGroupMakerthat groups all the rows together. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanisNewGroup(DecoratedKey partitionKey, Clustering<?> clustering) Checks if a given row belongs to the same group that the previous row or not.static GroupMakernewPkPrefixGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize) static GroupMakernewPkPrefixGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize, GroupingState state) static GroupMakernewSelectorGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize, Selector selector, List<ColumnMetadata> columns) static GroupMakernewSelectorGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize, Selector selector, List<ColumnMetadata> columns, GroupingState state) booleanSpecify if at least one row must be returned.
-
Field Details
-
GROUP_EVERYTHING
GroupMakerthat groups all the rows together.
-
-
Constructor Details
-
GroupMaker
public GroupMaker()
-
-
Method Details
-
newPkPrefixGroupMaker
public static GroupMaker newPkPrefixGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize, GroupingState state) -
newPkPrefixGroupMaker
public static GroupMaker newPkPrefixGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize) -
newSelectorGroupMaker
public static GroupMaker newSelectorGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize, Selector selector, List<ColumnMetadata> columns, GroupingState state) -
newSelectorGroupMaker
public static GroupMaker newSelectorGroupMaker(ClusteringComparator comparator, int clusteringPrefixSize, Selector selector, List<ColumnMetadata> columns) -
isNewGroup
Checks if a given row belongs to the same group that the previous row or not.- Parameters:
partitionKey- the partition key.clustering- the row clustering key- Returns:
trueif the row belongs to the same group that the previous one,falseotherwise.
-
returnAtLeastOneRow
public boolean returnAtLeastOneRow()Specify if at least one row must be returned. If the selection is performing some aggregations on all the rows, one row should be returned even if no records were processed.- Returns:
trueif at least one row must be returned,falseotherwise.
-