GroupMaker (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.db.aggregation

## Class GroupMaker

- java.lang.Object
- - org.apache.cassandra.db.aggregation.GroupMaker

-     public abstract class GroupMaker
      extends java.lang.Object

  A `GroupMaker` can be used to determine if some sorted rows belongs to the same group or not.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static GroupMaker` | `GROUP_EVERYTHING` `GroupMaker` that groups all the rows together.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GroupMaker()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `isNewGroup(DecoratedKey partitionKey, Clustering clustering)` Checks if a given row belongs to the same group that the previous row or not.
    `static GroupMaker` | `newInstance(ClusteringComparator comparator, int clusteringPrefixSize)`
    `static GroupMaker` | `newInstance(ClusteringComparator comparator, int clusteringPrefixSize, GroupingState state)`
    `boolean` | `returnAtLeastOneRow()` Specify if at least one row must be returned.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### GROUP_EVERYTHING

          public static final GroupMaker GROUP_EVERYTHING

      `GroupMaker` that groups all the rows together.

  - ### Constructor Detail

    - #### GroupMaker

          public GroupMaker()

  - ### Method Detail

    - #### newInstance

          public static GroupMaker newInstance(ClusteringComparator comparator,
                                               int clusteringPrefixSize,
                                               GroupingState state)

    - #### newInstance

          public static GroupMaker newInstance(ClusteringComparator comparator,
                                               int clusteringPrefixSize)

    - #### isNewGroup

          public abstract boolean isNewGroup(DecoratedKey partitionKey,
                                             Clustering clustering)

      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:
        `true` if the row belongs to the same group that the previous one, `false` otherwise.

    - #### 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:
        `true` if at least one row must be returned, `false` otherwise.

Copyright © 2018 The Apache Software Foundation