// Path: hazeltask-core/src/main/java/com/hazeltask/executor/DistributedExecutorService.java
// public interface DistributedExecutorService<GROUP extends Serializable> extends ExecutorService, ServiceListenable<DistributedExecutorService<GROUP>> {
//     public void startup();
//     
//     @Override
//     public <T> ListenableFuture<T> submit(Callable<T> task);
//     
//     @Override
//     public ListenableFuture<?> submit(Runnable task);
//     
//     @Override
//     public <T> ListenableFuture<T> submit(Runnable task, T result);
// }


import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.hazeltask.executor.DistributedExecutorService;
package com.hazeltask.hazelcast;


public class HazeltaskCompletionService<V> implements CompletionService<V> {
    private final DistributedExecutorService<?> executor;
    private final BlockingQueue<Future<V>> completionQueue;

    /**
     * Creates an ExecutorCompletionService using the supplied
     * executor for base task execution and a
     * {@link LinkedBlockingQueue} as a completion queue.
     *
     * @param executor the executor to use
     * @throws NullPointerException if executor is <tt>null</tt>
     */
// Path: hazeltask-core/src/main/java/com/hazeltask/executor/DistributedExecutorService.java
// public interface DistributedExecutorService<GROUP extends Serializable> extends ExecutorService, ServiceListenable<DistributedExecutorService<GROUP>> {
//     public void startup();
//     
//     @Override
//     public <T> ListenableFuture<T> submit(Callable<T> task);
//     
//     @Override
//     public ListenableFuture<?> submit(Runnable task);
//     
//     @Override
//     public <T> ListenableFuture<T> submit(Runnable task, T result);
// }


// Path: hazeltask-core/src/main/java/com/hazeltask/hazelcast/HazeltaskCompletionService.java
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.hazeltask.executor.DistributedExecutorService;

package com.hazeltask.hazelcast;


public class HazeltaskCompletionService<V> implements CompletionService<V> {
    private final DistributedExecutorService<?> executor;
    private final BlockingQueue<Future<V>> completionQueue;

    /**
     * Creates an ExecutorCompletionService using the supplied
     * executor for base task execution and a
     * {@link LinkedBlockingQueue} as a completion queue.
     *
     * @param executor the executor to use
     * @throws NullPointerException if executor is <tt>null</tt>
     */
    public HazeltaskCompletionService(DistributedExecutorService<?> executor) {