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 ; }
Attempts to reconcile the given StorageOperation .