> +
> +   private void removeObjectsWithPrefix(String container, String prefix) {
> +      String nextMarker = null;
> +      do {
> +         org.jclouds.openstack.swift.options.ListContainerOptions 
> listContainerOptions =
> +            withPrefix(prefix);
> +         if (nextMarker != null) {
> +            listContainerOptions = 
> listContainerOptions.afterMarker(nextMarker);
> +         }
> +
> +         PageSet<ObjectInfo> chunks = sync.listObjects(container, 
> listContainerOptions);
> +         for (ObjectInfo chunk : chunks) {
> +            sync.removeObject(container, chunk.getName());
> +         }
> +         nextMarker = chunks.getNextMarker();
> +      } while (nextMarker != null);

I did it in a paged way because that was the most obvious way to me (I'm not 
all that familiar with the jclouds code yet). I wouldn't expect there to be a 
huge number of chunks so I'd expect all of the chunks to come back in a single 
page most of the time.

I'm happy to take guidance on whether this should be done in parallel, paged or 
in one shot (if that's an option). If it should be done in parallel what 
classes should I look at to get started? Either examples of other places that 
do things in parallel, or pointers at the classes or methods I'd use to do it 
in parallel would be helpful.

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

Reply via email to