public void executeBatchAsync ( FutureCallback < ResultSet > callback , Statement ... statements ) throws ExceedMaxAsyncJobsException { if ( ! asyncSemaphore . tryAcquire ( ) ) { if ( callback == null ) { throw new ExceedMaxAsyncJobsException ( maxSyncJobs ) ; } else { callback . onFailure ( new ExceedMaxAsyncJobsException ( maxSyncJobs ) ) ; } } else { try { ResultSetFuture rsf = CqlUtils . executeBatchAsync ( getSession ( ) , statements ) ; if ( callback != null ) { Futures . addCallback ( rsf , wrapCallbackResultSet ( callback ) , asyncExecutor ) ; } } catch ( Exception e ) { asyncSemaphore . release ( ) ; LOGGER . error ( e . getMessage ( ) , e ) ; } } }
Async - execute a batch statement .