Search in sources :

Example 1 with Connector

use of org.apache.pulsar.io.core.annotations.Connector in project incubator-pulsar by apache.

the class ConnectorDocGenerator method generatorConnectorYamls.

private void generatorConnectorYamls(String outputDir) throws IOException {
    Set<Class<?>> connectorClasses = reflections.getTypesAnnotatedWith(Connector.class);
    log.info("Retrieve all `Connector` annotated classes : {}", connectorClasses);
    for (Class<?> connectorClass : connectorClasses) {
        Connector connectorDef = connectorClass.getDeclaredAnnotation(Connector.class);
        try (FileOutputStream fos = new FileOutputStream(Paths.get(outputDir, "pulsar-io-" + connectorDef.name() + "-" + connectorDef.type().name().toLowerCase()).toString() + ".yml")) {
            PrintWriter pw = new PrintWriter(new OutputStreamWriter(fos, StandardCharsets.UTF_8));
            generateConnectorYaml(connectorClass, connectorDef, pw);
            pw.flush();
        }
    }
}
Also used : Connector(org.apache.pulsar.io.core.annotations.Connector) FileOutputStream(java.io.FileOutputStream) OutputStreamWriter(java.io.OutputStreamWriter) PrintWriter(java.io.PrintWriter)

Example 2 with Connector

use of org.apache.pulsar.io.core.annotations.Connector in project pulsar by yahoo.

the class ConnectorDocGenerator method generatorConnectorYamls.

private void generatorConnectorYamls(String outputDir) throws IOException {
    Set<Class<?>> connectorClasses = reflections.getTypesAnnotatedWith(Connector.class);
    log.info("Retrieve all `Connector` annotated classes : {}", connectorClasses);
    for (Class<?> connectorClass : connectorClasses) {
        Connector connectorDef = connectorClass.getDeclaredAnnotation(Connector.class);
        try (FileOutputStream fos = new FileOutputStream(Paths.get(outputDir, "pulsar-io-" + connectorDef.name() + "-" + connectorDef.type().name().toLowerCase()).toString() + ".yml")) {
            PrintWriter pw = new PrintWriter(new OutputStreamWriter(fos, StandardCharsets.UTF_8));
            generateConnectorYaml(connectorClass, connectorDef, pw);
            pw.flush();
        }
    }
}
Also used : Connector(org.apache.pulsar.io.core.annotations.Connector) FileOutputStream(java.io.FileOutputStream) OutputStreamWriter(java.io.OutputStreamWriter) PrintWriter(java.io.PrintWriter)

Example 3 with Connector

use of org.apache.pulsar.io.core.annotations.Connector in project pulsar by apache.

the class ConnectorDocGenerator method generatorConnectorYamls.

private void generatorConnectorYamls(String outputDir) throws IOException {
    Set<Class<?>> connectorClasses = reflections.getTypesAnnotatedWith(Connector.class);
    log.info("Retrieve all `Connector` annotated classes : {}", connectorClasses);
    for (Class<?> connectorClass : connectorClasses) {
        Connector connectorDef = connectorClass.getDeclaredAnnotation(Connector.class);
        try (FileOutputStream fos = new FileOutputStream(Paths.get(outputDir, "pulsar-io-" + connectorDef.name() + "-" + connectorDef.type().name().toLowerCase()).toString() + ".yml")) {
            PrintWriter pw = new PrintWriter(new OutputStreamWriter(fos, StandardCharsets.UTF_8));
            generateConnectorYaml(connectorClass, connectorDef, pw);
            pw.flush();
        }
    }
}
Also used : Connector(org.apache.pulsar.io.core.annotations.Connector) FileOutputStream(java.io.FileOutputStream) OutputStreamWriter(java.io.OutputStreamWriter) PrintWriter(java.io.PrintWriter)

Aggregations

FileOutputStream (java.io.FileOutputStream)3 OutputStreamWriter (java.io.OutputStreamWriter)3 PrintWriter (java.io.PrintWriter)3 Connector (org.apache.pulsar.io.core.annotations.Connector)3