> +      ExecutorService executor = Executors.newFixedThreadPool(numThreads);
> +
> +      for(File f : files) {
> +         BlobUploader b =
> +         new BlobUploader(
> +               (String) options.valueOf("username"),
> +               (String) options.valueOf("password"),
> +               (String) options.valueOf("provider"),
> +               (String) options.valueOf("region"),
> +               f);
> +         executor.execute(b);
> +      }
> +      executor.shutdown();
> +
> +      try {
> +         executor.awaitTermination(1, TimeUnit.DAYS);

Matter of preference. The jobs I used to run with similar code would usually 
indicate some kind of issue if this limit was reached: for example, a 
consistent error when uploading a file with a very specific file name. With 
this code failures get to be retried indefinitely, so sometimes they will sift 
down to the last N threads running.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/69/files#r22901785

Reply via email to