code: public synchronized void drain() throws InterruptedException {
          // Wait for number of PerPartitionTables we are using and the Failure Processor
          for (int i=m_firstPartitionTable; i<=m_lastPartitionTable; i++) {
              try {
                  m_partitionTable[i].flushAllTableQueues().get();
              } catch (ExecutionException e) {
                  loaderLog.error("Failed to drain all buffers, some tuples may not be inserted yet.", e);
              }
          }
  
          // Draining the client doesn't guarantee that all failed rows are re-inserted, need to
          // loop until the outstanding row count reaches 0.
          while (m_outstandingRowCount.get() != 0) {
              m_clientImpl.drain();
              Thread.yield();
          }
      }
docs: Called to synchronously force the VoltBulkLoader to submit all the partially full batches
  in all partitions of the table to the Client for insert. This call will wait until all
  previously submitted rows (including retried failed batch rows) have been processed and
  received responses from the Client.
  @throws java.lang.InterruptedException