code: private CompletableFuture<WriterFlushResult> reconcileSealOperation(SegmentProperties storageInfo, Duration timeout) {
          // All we need to do is verify that the Segment is actually sealed in Storage. An exception to this rule is when
          // the segment has a length of 0, which means it may not have been created yet.
          if (storageInfo.isSealed() || storageInfo.getLength() == 0) {
              // Seal the Attribute Index (this is an idempotent operation so it's OK if it's already sealed).
              return sealAttributes(timeout)
                      .thenApplyAsync(v -> {
                          // Update metadata and the internal state (this also pops the first Op from the operation list).
                          updateStatePostSeal();
                          return new WriterFlushResult();
                      }, this.executor);
          } else {
              // A Seal was encountered as an Operation that should have been processed (based on its offset),
              // but the Segment in Storage is not sealed.
              return Futures.failedFuture(new ReconciliationFailureException("Segment was supposed to be sealed in storage but it is not.", this.metadata, storageInfo));
          }
      }
docs: Attempts to reconcile a StreamSegmentSealOperation.
  
  @param storageInfo The current state of the Segment in Storage.
  @param timeout     Timeout for the operation.
  @return A CompletableFuture containing a FlushResult with the number of bytes reconciled, or failed with a ReconciliationFailureException,
  if the operation cannot be reconciled, based on the in-memory metadata or the current state of the Segment in Storage.