public void run() {
      while (deletedCount.get() < putCount) {
        try {
          final String blobIdStr = deleteBlobIds.poll(50, TimeUnit.MILLISECONDS);
          if (blobIdStr != null) {
            final long startTimeInMs = SystemTime.getInstance().milliseconds();
            deletedCount.incrementAndGet();
            logger.trace("Deleting blob {}", blobIdStr);
            Callback<Void> callback = new Callback<Void>() {

              @Override
              public void onCompletion(Void result, Exception exception) {
                metricsCollector.updateTimePassedSoFar(SystemTime.getInstance().milliseconds() - startTimeInMs);
                logger.trace("Deletion completed for {}", blobIdStr);
                countDownLatch.countDown();
                if (exception != null) {
                  logger.error("Deletion of {} failed with ", blobIdStr, exception);
                }
              }
            };
            deleteHelper.deleteBlobAndValidate(blobIdStr, deleteHelper.getErrorCodeForNoError(), callback,
                metricsCollector);
          }
        } catch (InterruptedException e) {
          logger.error("Delete operation interrupted", e);
        }
      }
      try {
        countDownLatch.await();
        metricsCollector.reportMetrics();
      } catch (InterruptedException e) {
        logger.error("Waiting for delete operations to complete interrupted", e);
      }
    }
Thread used for deleting blobs from ambry
ambry-tools/src/main/java/com/github/ambry/tools/admin/ConcurrencyTestTool.java