code: @Override
      public void add(SegmentOperation operation) throws DataCorruptionException {
          ensureInitializedAndNotClosed();
  
          // Verify the operation is valid with respect to the state of this SegmentAggregator.
          checkValidOperation(operation);
  
          boolean isDelete = isDeleteOperation(operation);
          if (isDelete) {
              addDeleteOperation((DeleteSegmentOperation) operation);
              log.debug("{}: Add {}.", this.traceObjectId, operation);
          } else if (!this.metadata.isDeleted()) {
              // Verify operation validity (this also takes care of extra operations after Seal or Merge; no need for further checks).
              if (operation instanceof StorageOperation) {
                  addStorageOperation((StorageOperation) operation);
              } else if (operation instanceof UpdateAttributesOperation) {
                  addUpdateAttributesOperation((UpdateAttributesOperation) operation);
              } else {
                  // Nothing to do.
                  return;
              }
  
              log.debug("{}: Add {}; OpCount={}, MergeCount={}, Seal={}.", this.traceObjectId, operation,
                      this.operations.size(), this.mergeTransactionCount, this.hasSealPending);
          }
      }
docs: Adds the given SegmentOperation to the Aggregator.
  
  @param operation the Operation to add.
  @throws DataCorruptionException  If the validation of the given Operation indicates a possible data corruption in
  the code (offset gaps, out-of-order operations, etc.)
  @throws IllegalArgumentException If the validation of the given Operation indicates a possible non-corrupting bug
  in the code.