code: void acceptOperation(StreamSegmentAppendOperation operation) throws MetadataUpdateException {
          ensureSegmentId(operation);
          if (operation.getStreamSegmentOffset() != this.length) {
              throw new MetadataUpdateException(this.containerId,
                      String.format("SegmentAppendOperation offset mismatch. Expected %d, actual %d.",
                              this.length, operation.getStreamSegmentOffset()));
          }
  
          this.length += operation.getData().length;
          acceptAttributes(operation.getAttributeUpdates());
          this.isChanged = true;
      }
docs: Accepts a StreamSegmentAppendOperation in the metadata.
  
  @param operation The operation to accept.
  @throws MetadataUpdateException  If the operation SegmentOffset is different from the current Segment Length.
  @throws IllegalArgumentException If the operation is for a different Segment.