processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/HashVectorGrouper.java
/**
   * Returns the start of the table within {@link #buffer} after the next growth. Each growth starts from the end of
   * the previous table.
   *
   * @throws IllegalStateException if not initialized or if growing is not possible
   */
Returns the start of the table within  #buffer after the next growth. Each growth starts from the end of
the previous table.

@throws IllegalStateException if not initialized or if growing is not possible
Returns the start of the table within #buffer after the next growth . Each growth starts from the end of the previous table . @throws IllegalStateException if not initialized or if growing is not possible
private int nextTableStart()
  {
    if (!initialized) {
      throw new ISE("Must be initialized");
    }
    final int nextNumBuckets = nextTableNumBuckets();
    final int currentEnd = tableStart + MemoryOpenHashTable.memoryNeeded(hashTable.numBuckets(), bucketSize);
    final int nextTableStart;
    if (nextNumBuckets == maxNumBuckets) {
      assert currentEnd == buffer.capacity();
      nextTableStart = 0;
    } else {
      nextTableStart = currentEnd;
    }
    final long nextEnd = ((long) nextTableStart) + MemoryOpenHashTable.memoryNeeded(nextNumBuckets, bucketSize);
    if (nextEnd > buffer.capacity()) {
      throw new ISE("New table overruns buffer capacity");
    }
    if (nextTableStart < currentEnd && nextEnd > tableStart) {
      throw new ISE("New table overruns old table");
    }
    return nextTableStart;
  }
private int nextTableStart ( ) { if ( ! initialized ) { throw new ISE ( "Must be initialized" ) ; } final int nextNumBuckets = nextTableNumBuckets ( ) ; final int currentEnd = tableStart + MemoryOpenHashTable . memoryNeeded ( hashTable . numBuckets ( ) , bucketSize ) ; final int nextTableStart ; if ( nextNumBuckets == maxNumBuckets ) { assert currentEnd == buffer . capacity ( ) ; nextTableStart = 0 ; } else { nextTableStart = currentEnd ; } final long nextEnd = ( ( long ) nextTableStart ) + MemoryOpenHashTable . memoryNeeded ( nextNumBuckets , bucketSize ) ; if ( nextEnd > buffer . capacity ( ) ) { throw new ISE ( "New table overruns buffer capacity" ) ; } if ( nextTableStart < currentEnd && nextEnd > tableStart ) { throw new ISE ( "New table overruns old table" ) ; } return nextTableStart ; }
Returns the start of the table within {@link #buffer} after the next growth.
Returns the start of the table within { @link #buffer } after the next growth .
// Sanity check on buffer capacity. If this triggers then it is a bug in this class.