org.jclouds.concurrent
Class FutureIterables

java.lang.Object
  extended by org.jclouds.concurrent.FutureIterables

@Beta
public class FutureIterables
extends Object

functions related to or replacing those in Iterables dealing with Futures

Author:
Adrian Cole

Constructor Summary
FutureIterables()
           
 
Method Summary
static
<T> Map<T,Exception>
awaitCompletion(Map<T,? extends Future<?>> responses, ExecutorService exec, Long maxTime, Logger logger, String logPrefix)
           
protected static boolean timeOut(long start, Long maxTime)
           
static
<F,T> Iterable<T>
transformParallel(Iterable<F> fromIterable, com.google.common.base.Function<? super F,Future<T>> function)
           
static
<F,T> Iterable<T>
transformParallel(Iterable<F> fromIterable, com.google.common.base.Function<? super F,Future<T>> function, ExecutorService exec, Long maxTime)
           
static
<F,T> Iterable<T>
transformParallel(Iterable<F> fromIterable, com.google.common.base.Function<? super F,Future<T>> function, ExecutorService exec, Long maxTime, Logger logger, String logPrefix)
           
static
<F,T> Iterable<T>
transformParallel(Iterable<F> fromIterable, com.google.common.base.Function<? super F,Future<T>> function, ExecutorService exec, Long maxTime, Logger logger, String logPrefix, BackoffLimitedRetryHandler retryHandler, int maxRetries)
           
static
<T> Iterable<T>
unwrap(Iterable<Future<T>> values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FutureIterables

public FutureIterables()
Method Detail

transformParallel

public static <F,T> Iterable<T> transformParallel(Iterable<F> fromIterable,
                                                  com.google.common.base.Function<? super F,Future<T>> function)

transformParallel

public static <F,T> Iterable<T> transformParallel(Iterable<F> fromIterable,
                                                  com.google.common.base.Function<? super F,Future<T>> function,
                                                  ExecutorService exec,
                                                  @Nullable
                                                  Long maxTime)

transformParallel

public static <F,T> Iterable<T> transformParallel(Iterable<F> fromIterable,
                                                  com.google.common.base.Function<? super F,Future<T>> function,
                                                  ExecutorService exec,
                                                  @Nullable
                                                  Long maxTime,
                                                  Logger logger,
                                                  String logPrefix)

transformParallel

public static <F,T> Iterable<T> transformParallel(Iterable<F> fromIterable,
                                                  com.google.common.base.Function<? super F,Future<T>> function,
                                                  ExecutorService exec,
                                                  @Nullable
                                                  Long maxTime,
                                                  Logger logger,
                                                  String logPrefix,
                                                  BackoffLimitedRetryHandler retryHandler,
                                                  int maxRetries)

awaitCompletion

public static <T> Map<T,Exception> awaitCompletion(Map<T,? extends Future<?>> responses,
                                                   ExecutorService exec,
                                                   @Nullable
                                                   Long maxTime,
                                                   Logger logger,
                                                   String logPrefix)

unwrap

public static <T> Iterable<T> unwrap(Iterable<Future<T>> values)

timeOut

protected static boolean timeOut(long start,
                                 Long maxTime)


Copyright © 2009-2012 jclouds. All Rights Reserved.