private void processNewOperation ( StorageOperation operation ) { if ( operation instanceof MergeSegmentOperation ) { this . operations . add ( operation ) ; this . mergeTransactionCount . incrementAndGet ( ) ; } else if ( operation instanceof StreamSegmentSealOperation ) { this . operations . add ( operation ) ; this . hasSealPending . set ( true ) ; } else if ( operation instanceof StreamSegmentTruncateOperation ) { this . operations . add ( operation ) ; this . truncateCount . incrementAndGet ( ) ; } else if ( operation instanceof CachedStreamSegmentAppendOperation ) { // Aggregate the Append Operation. AggregatedAppendOperation aggregatedAppend = getOrCreateAggregatedAppend ( operation . getStreamSegmentOffset ( ) , operation . getSequenceNumber ( ) ) ; aggregateAppendOperation ( ( CachedStreamSegmentAppendOperation ) operation , aggregatedAppend ) ; } }
Processes an operation that would result in a change to the underlying Storage .