Search in sources :

Example 1 with CompactorCompletionListenerFactory

use of org.apache.gobblin.compaction.listeners.CompactorCompletionListenerFactory in project incubator-gobblin by apache.

the class MRCompactor method getCompactionCompleteListener.

private CompactorCompletionListener getCompactionCompleteListener() {
    ClassAliasResolver<CompactorCompletionListenerFactory> classAliasResolver = new ClassAliasResolver<>(CompactorCompletionListenerFactory.class);
    String listenerName = this.state.getProp(MRCompactor.COMPACTION_COMPLETE_LISTERNER, MRCompactor.DEFAULT_COMPACTION_COMPLETE_LISTERNER);
    try {
        CompactorCompletionListenerFactory factory = GobblinConstructorUtils.invokeFirstConstructor(classAliasResolver.resolveClass(listenerName), ImmutableList.of());
        return factory.createCompactorCompactionListener(this.state);
    } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException | ClassNotFoundException e) {
        throw new IllegalArgumentException(e);
    }
}
Also used : ClassAliasResolver(org.apache.gobblin.util.ClassAliasResolver) CompactorCompletionListenerFactory(org.apache.gobblin.compaction.listeners.CompactorCompletionListenerFactory) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 CompactorCompletionListenerFactory (org.apache.gobblin.compaction.listeners.CompactorCompletionListenerFactory)1 ClassAliasResolver (org.apache.gobblin.util.ClassAliasResolver)1