code: private CompletableFuture<WriterFlushResult> reconcileOperation(StorageOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
          CompletableFuture<WriterFlushResult> result;
  
          if (isAppendOperation(op)) {
              result = reconcileAppendOperation((AggregatedAppendOperation) op, storageInfo, timer);
          } else if (op instanceof MergeSegmentOperation) {
              result = reconcileMergeOperation((MergeSegmentOperation) op, storageInfo, timer);
          } else if (op instanceof StreamSegmentSealOperation) {
              result = reconcileSealOperation(storageInfo, timer.getRemaining());
          } else if (isTruncateOperation(op)) {
              // Nothing to reconcile here.
              updateStatePostTruncate();
              result = CompletableFuture.completedFuture(new WriterFlushResult());
          } else {
              result = Futures.failedFuture(new ReconciliationFailureException(String.format("Operation '%s' is not supported for reconciliation.", op), this.metadata, storageInfo));
          }
          return result;
      }
docs: Attempts to reconcile the given StorageOperation.
  
  @param op          The Operation to reconcile.
  @param storageInfo The current state of the Segment in Storage.
  @param timer       Timer 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.