private synchronized void uploadCurrentBlock ( ) throws IOException { if ( ! hasActiveBlock ( ) ) { throw new IllegalStateException ( "No active block" ) ; } LOG . debug ( "Writing block # {}" , blockCount ) ; if ( multiPartUpload == null ) { LOG . debug ( "Initiating Multipart upload" ) ; multiPartUpload = new MultiPartUpload ( ) ; } try { multiPartUpload . uploadBlockAsync ( getActiveBlock ( ) ) ; } finally { // set the block to null, so the next write will create a new block. clearActiveBlock ( ) ; } }
Start an asynchronous upload of the current block .