code: private void waitForAllPartsUpload() throws IOException {
      int beforeSize = mTags.size();
      try {
        for (ListenableFuture<PartETag> future : mTagFutures) {
          mTags.add(future.get());
        }
      } catch (ExecutionException e) {
        // No recover ways so that we need to cancel all the upload tasks
        // and abort the multipart upload
        Futures.allAsList(mTagFutures).cancel(true);
        abortMultiPartUpload();
        throw new IOException("Part upload failed in multipart upload with "
            + "id '" + mUploadId + "' to " + mKey, e);
      } catch (InterruptedException e) {
        LOG.warn("Interrupted object upload.", e);
        Futures.allAsList(mTagFutures).cancel(true);
        abortMultiPartUpload();
        Thread.currentThread().interrupt();
      }
      mTagFutures = new ArrayList<>();
      if (mTags.size() != beforeSize) {
        LOG.debug("Uploaded {} partitions of id '{}' to {}.", mTags.size(), mUploadId, mKey);
      }
    }
docs: Waits for the submitted upload tasks to finish.