/** * Notifies this <code>Builder</code> that a new row is being processed. * * @param partitionKey the partition key of the new row * @param clustering the clustering of the new row */ public void newRow(DecoratedKey partitionKey, Clustering clustering) { // The groupMaker needs to be called for each row boolean isNewAggregate = groupMaker == null || groupMaker.isNewGroup(partitionKey, clustering); if (current != null) { selectors.addInputRow(protocolVersion, this); if (isNewAggregate) { resultSet.addRow(getOutputRow()); selectors.reset(); } } current = new ArrayList<>(columns.size()); // Timestamps and TTLs are arrays per row, we must null them out between rows if (timestamps != null) Arrays.fill(timestamps, Long.MIN_VALUE); if (ttls != null) Arrays.fill(ttls, -1); }
/** * Notifies this <code>Builder</code> that a new row is being processed. * * @param partitionKey the partition key of the new row * @param clustering the clustering of the new row */ public void newRow(DecoratedKey partitionKey, Clustering clustering) { // The groupMaker needs to be called for each row boolean isNewAggregate = groupMaker == null || groupMaker.isNewGroup(partitionKey, clustering); if (current != null) { selectors.addInputRow(protocolVersion, this); if (isNewAggregate) { resultSet.addRow(getOutputRow()); selectors.reset(); } } current = new ArrayList<>(columns.size()); // Timestamps and TTLs are arrays per row, we must null them out between rows if (timestamps != null) Arrays.fill(timestamps, Long.MIN_VALUE); if (ttls != null) Arrays.fill(ttls, -1); }
/** * Notifies this <code>Builder</code> that a new row is being processed. * * @param partitionKey the partition key of the new row * @param clustering the clustering of the new row */ public void newRow(DecoratedKey partitionKey, Clustering clustering) { // The groupMaker needs to be called for each row boolean isNewAggregate = groupMaker == null || groupMaker.isNewGroup(partitionKey, clustering); if (current != null) { selectors.addInputRow(protocolVersion, this); if (isNewAggregate) { resultSet.addRow(getOutputRow()); selectors.reset(); } } current = new ArrayList<>(columns.size()); // Timestamps and TTLs are arrays per row, we must null them out between rows if (timestamps != null) Arrays.fill(timestamps, Long.MIN_VALUE); if (ttls != null) Arrays.fill(ttls, -1); }
/** * Builds the <code>ResultSet</code> */ public ResultSet build() { if (current != null) { selectors.addInputRow(protocolVersion, this); resultSet.addRow(getOutputRow()); selectors.reset(); current = null; } // For aggregates we need to return a row even it no records have been found if (resultSet.isEmpty() && groupMaker != null && groupMaker.returnAtLeastOneRow()) resultSet.addRow(getOutputRow()); return resultSet; }
/** * Builds the <code>ResultSet</code> */ public ResultSet build() { if (current != null) { selectors.addInputRow(protocolVersion, this); resultSet.addRow(getOutputRow()); selectors.reset(); current = null; } // For aggregates we need to return a row even it no records have been found if (resultSet.isEmpty() && groupMaker != null && groupMaker.returnAtLeastOneRow()) resultSet.addRow(getOutputRow()); return resultSet; }
/** * Builds the <code>ResultSet</code> */ public ResultSet build() { if (current != null) { selectors.addInputRow(protocolVersion, this); resultSet.addRow(getOutputRow()); selectors.reset(); current = null; } // For aggregates we need to return a row even it no records have been found if (resultSet.isEmpty() && groupMaker != null && groupMaker.returnAtLeastOneRow()) resultSet.addRow(getOutputRow()); return resultSet; }