private synchronized void addBookKeeperEntry ( byte [ ] buf , int off , int len ) throws IOException { try { ledger . addEntry ( buf , off , len ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Last add pushed to ledger " + ledger . getId ( ) + " is " + ledger . getLastAddPushed ( ) ) ; LOG . debug ( "Last add confirmed to ledger " + ledger . getId ( ) + " is " + ledger . getLastAddConfirmed ( ) ) ; } } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new IOException ( "Interrupted writing to BookKeeper" , e ) ; } catch ( BKException e ) { throw new IOException ( "Failed to write to BookKeeper" , e ) ; } }
Write the buffer to a new entry in a BookKeeper ledger or throw an IOException if we are unable to successfully write to a quorum of bookies