// Path: src/main/java/com/tango/BucketSyncer/KeyJobs/KeyJob.java
// public abstract class KeyJob implements Runnable {
//     protected final ObjectSummary summary;
//     protected final Object notifyLock;
//     protected final MirrorContext context;
// 
// 
//     public KeyJob(ObjectSummary summary,
//                   Object notifyLock,
//                   MirrorContext context) {
//         this.summary = summary;
//         this.notifyLock = notifyLock;
//         this.context = context;
//     }
// 
//     @Override
//     public String toString() {
//         return summary.toString();
//     }
// 
// 
// }
// 
// Path: src/main/java/com/tango/BucketSyncer/KeyListers/KeyLister.java
// @Slf4j
// public abstract class KeyLister implements Runnable {
//     protected MirrorContext context;
//     protected Integer maxQueueCapacity;
//     protected String bucket;
//     protected String prefix;
// 
//     protected final AtomicBoolean done = new AtomicBoolean(false);
// 
//     public boolean isDone() {
//         return done.get();
//     }
// 
//     public KeyLister(String bucket,
//                      String prefix,
//                      MirrorContext context,
//                      Integer maxQueueCapacity) {
//         this.bucket = bucket;
//         this.prefix = prefix;
//         this.context = context;
//         this.maxQueueCapacity = maxQueueCapacity;
//     }
// 
//     public abstract List<ObjectSummary> getNextBatch();
// 
// }
// 
// Path: src/main/java/com/tango/BucketSyncer/ObjectSummaries/ObjectSummary.java
// public interface ObjectSummary {
//     public String getKey();
// 
//     public long getSize();
// 
//     public Date getLastModified();
// 
//     public String getETag();
// }


import com.tango.BucketSyncer.KeyJobs.KeyJob;
import com.tango.BucketSyncer.KeyListers.KeyLister;
import com.tango.BucketSyncer.ObjectSummaries.ObjectSummary;
import lombok.extern.slf4j.Slf4j;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
            clazz = (Class<? extends KeyLister>) Class.forName(className);
        } catch (ClassNotFoundException e) {
            log.error("Classname for KEY_LISTER {} is not found: {}", className, e);
        }
        Constructor<?> constructor = null;
        try {
            constructor = clazz.getConstructor(Object.class,
                    String.class,
                    String.class,
                    MirrorContext.class,
                    Integer.class);
        } catch (NoSuchMethodException e) {
            log.error("Failed to find corresponding KEY_LISTER constructor: ", e);
        }
        try {
            return (KeyLister) constructor.newInstance(sourceClient, getBucket(options),
                    getPrefix(options),
                    context,
                    MirrorMaster.getMaxQueueCapacity(options));
        } catch (InstantiationException e) {
            log.error("Failed to instantiate KEY_LISTER: ", e);
        } catch (IllegalAccessException e) {
            log.error("Failed to access KEY_LISTER: ", e);
        } catch (InvocationTargetException e) {
            log.error("Failed to invocate KEY_LISTER: ", e);
        }
        return null;
    }


// Path: src/main/java/com/tango/BucketSyncer/KeyJobs/KeyJob.java
// public abstract class KeyJob implements Runnable {
//     protected final ObjectSummary summary;
//     protected final Object notifyLock;
//     protected final MirrorContext context;
// 
// 
//     public KeyJob(ObjectSummary summary,
//                   Object notifyLock,
//                   MirrorContext context) {
//         this.summary = summary;
//         this.notifyLock = notifyLock;
//         this.context = context;
//     }
// 
//     @Override
//     public String toString() {
//         return summary.toString();
//     }
// 
// 
// }
// 
// Path: src/main/java/com/tango/BucketSyncer/KeyListers/KeyLister.java
// @Slf4j
// public abstract class KeyLister implements Runnable {
//     protected MirrorContext context;
//     protected Integer maxQueueCapacity;
//     protected String bucket;
//     protected String prefix;
// 
//     protected final AtomicBoolean done = new AtomicBoolean(false);
// 
//     public boolean isDone() {
//         return done.get();
//     }
// 
//     public KeyLister(String bucket,
//                      String prefix,
//                      MirrorContext context,
//                      Integer maxQueueCapacity) {
//         this.bucket = bucket;
//         this.prefix = prefix;
//         this.context = context;
//         this.maxQueueCapacity = maxQueueCapacity;
//     }
// 
//     public abstract List<ObjectSummary> getNextBatch();
// 
// }
// 
// Path: src/main/java/com/tango/BucketSyncer/ObjectSummaries/ObjectSummary.java
// public interface ObjectSummary {
//     public String getKey();
// 
//     public long getSize();
// 
//     public Date getLastModified();
// 
//     public String getETag();
// }


// Path: src/main/java/com/tango/BucketSyncer/CopyMaster.java
import com.tango.BucketSyncer.KeyJobs.KeyJob;
import com.tango.BucketSyncer.KeyListers.KeyLister;
import com.tango.BucketSyncer.ObjectSummaries.ObjectSummary;
import lombok.extern.slf4j.Slf4j;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;

            clazz = (Class<? extends KeyLister>) Class.forName(className);
        } catch (ClassNotFoundException e) {
            log.error("Classname for KEY_LISTER {} is not found: {}", className, e);
        }
        Constructor<?> constructor = null;
        try {
            constructor = clazz.getConstructor(Object.class,
                    String.class,
                    String.class,
                    MirrorContext.class,
                    Integer.class);
        } catch (NoSuchMethodException e) {
            log.error("Failed to find corresponding KEY_LISTER constructor: ", e);
        }
        try {
            return (KeyLister) constructor.newInstance(sourceClient, getBucket(options),
                    getPrefix(options),
                    context,
                    MirrorMaster.getMaxQueueCapacity(options));
        } catch (InstantiationException e) {
            log.error("Failed to instantiate KEY_LISTER: ", e);
        } catch (IllegalAccessException e) {
            log.error("Failed to access KEY_LISTER: ", e);
        } catch (InvocationTargetException e) {
            log.error("Failed to invocate KEY_LISTER: ", e);
        }
        return null;
    }


    protected KeyJob getTask(ObjectSummary summary) {