Search in sources :

Example 1 with ConnectorPluginInfo

use of org.apache.kafka.connect.runtime.rest.entities.ConnectorPluginInfo in project kafka by apache.

the class PluginDiscovery method connectorPlugins.

private static List<ConnectorPluginInfo> connectorPlugins(Reflections reflections) {
    final Set<Class<? extends Connector>> connectorClasses = reflections.getSubTypesOf(Connector.class);
    connectorClasses.removeAll(CONNECTOR_EXCLUDES);
    final List<ConnectorPluginInfo> connectorPlugins = new ArrayList<>(connectorClasses.size());
    for (Class<? extends Connector> connectorClass : connectorClasses) {
        if (isConcrete(connectorClass)) {
            connectorPlugins.add(new ConnectorPluginInfo(connectorClass.getCanonicalName()));
        }
    }
    Collections.sort(connectorPlugins, new Comparator<ConnectorPluginInfo>() {

        @Override
        public int compare(ConnectorPluginInfo a, ConnectorPluginInfo b) {
            return a.clazz().compareTo(b.clazz());
        }
    });
    return connectorPlugins;
}
Also used : Connector(org.apache.kafka.connect.connector.Connector) MockSourceConnector(org.apache.kafka.connect.tools.MockSourceConnector) SchemaSourceConnector(org.apache.kafka.connect.tools.SchemaSourceConnector) VerifiableSinkConnector(org.apache.kafka.connect.tools.VerifiableSinkConnector) VerifiableSourceConnector(org.apache.kafka.connect.tools.VerifiableSourceConnector) MockSinkConnector(org.apache.kafka.connect.tools.MockSinkConnector) MockConnector(org.apache.kafka.connect.tools.MockConnector) ArrayList(java.util.ArrayList) ConnectorPluginInfo(org.apache.kafka.connect.runtime.rest.entities.ConnectorPluginInfo)

Aggregations

ArrayList (java.util.ArrayList)1 Connector (org.apache.kafka.connect.connector.Connector)1 ConnectorPluginInfo (org.apache.kafka.connect.runtime.rest.entities.ConnectorPluginInfo)1 MockConnector (org.apache.kafka.connect.tools.MockConnector)1 MockSinkConnector (org.apache.kafka.connect.tools.MockSinkConnector)1 MockSourceConnector (org.apache.kafka.connect.tools.MockSourceConnector)1 SchemaSourceConnector (org.apache.kafka.connect.tools.SchemaSourceConnector)1 VerifiableSinkConnector (org.apache.kafka.connect.tools.VerifiableSinkConnector)1 VerifiableSourceConnector (org.apache.kafka.connect.tools.VerifiableSourceConnector)1