public Log commit ( long index ) { assertIsOpen ( ) ; if ( index > 0 ) { assertValidIndex ( index ) ; segments . commitIndex ( index ) ; if ( storage . flushOnCommit ( ) ) { segments . currentSegment ( ) . flush ( ) ; } } return this ; }
Commits entries up to the given index to the log .