@Internal public class AccumulatorHelper extends Object
Accumulator
.Constructor and Description |
---|
AccumulatorHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
compareAccumulatorTypes(Object name,
Class<? extends Accumulator> first,
Class<? extends Accumulator> second)
Compare both classes and throw
UnsupportedOperationException if they differ. |
static Map<String,Accumulator<?,?>> |
copy(Map<String,Accumulator<?,?>> accumulators) |
static Map<String,OptionalFailure<Object>> |
deserializeAccumulators(Map<String,SerializedValue<OptionalFailure<Object>>> serializedAccumulators,
ClassLoader loader)
Takes the serialized accumulator results and tries to deserialize them using the provided
class loader.
|
static Map<String,Object> |
deserializeAndUnwrapAccumulators(Map<String,SerializedValue<OptionalFailure<Object>>> serializedAccumulators,
ClassLoader loader)
Takes the serialized accumulator results and tries to deserialize them using the provided
class loader, and then try to unwrap the value unchecked.
|
static String |
getResultsFormatted(Map<String,Object> map) |
static void |
mergeInto(Map<String,OptionalFailure<Accumulator<?,?>>> target,
Map<String,Accumulator<?,?>> toMerge)
Merge two collections of accumulators.
|
static Map<String,OptionalFailure<Object>> |
toResultMap(Map<String,Accumulator<?,?>> accumulators)
Transform the Map with accumulators into a Map containing only the results.
|
public static void mergeInto(Map<String,OptionalFailure<Accumulator<?,?>>> target, Map<String,Accumulator<?,?>> toMerge)
target
- The collection of accumulators that will be updatedtoMerge
- The collection of accumulators that will be merged into the otherpublic static void compareAccumulatorTypes(Object name, Class<? extends Accumulator> first, Class<? extends Accumulator> second) throws UnsupportedOperationException
UnsupportedOperationException
if they differ.UnsupportedOperationException
public static Map<String,OptionalFailure<Object>> toResultMap(Map<String,Accumulator<?,?>> accumulators)
public static Map<String,Accumulator<?,?>> copy(Map<String,Accumulator<?,?>> accumulators)
public static Map<String,OptionalFailure<Object>> deserializeAccumulators(Map<String,SerializedValue<OptionalFailure<Object>>> serializedAccumulators, ClassLoader loader) throws IOException, ClassNotFoundException
serializedAccumulators
- The serialized accumulator results.loader
- The class loader to use.IOException
ClassNotFoundException
public static Map<String,Object> deserializeAndUnwrapAccumulators(Map<String,SerializedValue<OptionalFailure<Object>>> serializedAccumulators, ClassLoader loader) throws IOException, ClassNotFoundException
serializedAccumulators
- The serialized accumulator results.loader
- The class loader to use.IOException
ClassNotFoundException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.