public class EtlUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
estimateRemainingHarvestTime(long harvestStartTimestamp,
ETLState etlStatus,
int harvestedDocuments,
int maxDocuments)
Estimates the remaining harvesting duration in milliseconds.
|
static String |
formatHarvestTime(long milliseconds)
Creates a duration string out of a specified number of seconds
|
static String |
getCombinedHashes(Collection<AbstractETL<?,?>> etls)
Generates a combined hash over the concatenated hashes of a specified
Collection of enabled AbstractETLs.
|
static ETLHealth |
getCombinedHealth(Collection<AbstractETL<?,?>> etls)
Retrieves the combined health status of a specified
Collection of AbstractETLs.
|
static void |
processETLs(Collection<AbstractETL<?,?>> etls,
Consumer<AbstractETL<?,?>> consumer)
|
static <T> List<T> |
processETLsAsList(Collection<AbstractETL<?,?>> etls,
Function<AbstractETL<?,?>,T> function)
Processes a Collection of AbstractETLs sequentially and stores the return
values of a specified Function in a List.
|
static int |
sumUpETLValues(Collection<AbstractETL<?,?>> etls,
Function<AbstractETL<?,?>,Integer> intFunction)
Iterates a Collection of AbstractETLs sequentially
and sums up the return values of a specified Function.
|
public static String getCombinedHashes(Collection<AbstractETL<?,?>> etls)
etls - the AbstractETLs of which the hashes are combinedpublic static ETLHealth getCombinedHealth(Collection<AbstractETL<?,?>> etls)
etls - the AbstractETLs of which the health statusses are combinedpublic static long estimateRemainingHarvestTime(long harvestStartTimestamp,
ETLState etlStatus,
int harvestedDocuments,
int maxDocuments)
harvestStartTimestamp - the unix timestamp that denotes when the harvest startedetlStatus - the current status of the AbstractETLsharvestedDocuments - the number of documents that were harvestedmaxDocuments - the total number of harvestable documents, or -1
if unknownpublic static String formatHarvestTime(long milliseconds)
milliseconds - the time span in millisecondspublic static <T> List<T> processETLsAsList(Collection<AbstractETL<?,?>> etls, Function<AbstractETL<?,?>,T> function)
T - the type of the Function return valueetls - the AbstractETLs that are to be processedfunction - a Function that is called for each ETL, using the ETL as a parameterpublic static void processETLs(Collection<AbstractETL<?,?>> etls, Consumer<AbstractETL<?,?>> consumer)
etls - the AbstractETLs that are to be processedconsumer - a Consumer that is called for each ETL, using the ETL as a parameterpublic static int sumUpETLValues(Collection<AbstractETL<?,?>> etls, Function<AbstractETL<?,?>,Integer> intFunction)
etls - the AbstractETLs that are to be processedintFunction - a Function that is called for each ETL, using the ETL as a parameter
and returning an integer valueCopyright © 2017–2019. All rights reserved.