use of com.amazon.dataprepper.model.PluginType in project data-prepper by opensearch-project.
the class PluginRepository method findPlugins.
private static void findPlugins() {
final Reflections reflections = new Reflections(DEFAULT_PLUGINS_CLASSPATH);
final Set<Class<?>> annotatedClasses = reflections.getTypesAnnotatedWith(DataPrepperPlugin.class);
for (final Class<?> annotatedClass : annotatedClasses) {
final DataPrepperPlugin dataPrepperPluginAnnotation = annotatedClass.getAnnotation(DataPrepperPlugin.class);
final String pluginName = dataPrepperPluginAnnotation.name();
final PluginType pluginType = extractPluginType(dataPrepperPluginAnnotation);
switch(pluginType) {
case SOURCE:
SOURCES.put(pluginName, (Class<Source>) annotatedClass);
break;
case BUFFER:
BUFFERS.put(pluginName, (Class<Buffer>) annotatedClass);
break;
case PREPPER:
PROCESSORS.put(pluginName, (Class<Processor>) annotatedClass);
break;
case SINK:
SINKS.put(pluginName, (Class<Sink>) annotatedClass);
break;
}
}
}
Aggregations