code: private boolean exceedsThresholds() {
          boolean isFirstAppend = this.operations.size() > 0 && isAppendOperation(this.operations.getFirst());
          long length = isFirstAppend ? this.operations.getFirst().getLength() : 0;
          if (isFirstAppend && length == 0 && !((AggregatedAppendOperation) this.operations.getFirst()).attributes.isEmpty()) {
              // No data, but we have at least one attribute waiting. Pretend as if we had data to flush.
              length = 1;
          }
  
          return length >= this.config.getFlushThresholdBytes()
                  || (length > 0 && getElapsedSinceLastFlush().compareTo(this.config.getFlushThresholdTime()) >= 0);
      }
docs: Gets a value indicating whether the Flush thresholds are exceeded for this SegmentAggregator.