use of com.facebook.presto.spi.function.AccumulatorState in project presto by prestodb.
the class AggregationCompiler method getStateClasses.
private static Set<Class<?>> getStateClasses(Class<?> clazz) {
ImmutableSet.Builder<Class<?>> builder = ImmutableSet.builder();
for (Method inputFunction : findPublicStaticMethodsWithAnnotation(clazz, InputFunction.class)) {
checkArgument(inputFunction.getParameterTypes().length > 0, "Input function has no parameters");
Class<?> stateClass = findAggregationStateParamType(inputFunction);
checkArgument(AccumulatorState.class.isAssignableFrom(stateClass), "stateClass is not a subclass of AccumulatorState");
builder.add(stateClass);
}
ImmutableSet<Class<?>> stateClasses = builder.build();
checkArgument(!stateClasses.isEmpty(), "No input functions found");
return stateClasses;
}
Aggregations