Search in sources :

Example 6 with KafkaServerStartable

use of kafka.server.KafkaServerStartable in project beam by apache.

the class EmbeddedKafkaCluster method startup.

public void startup() {
    for (int i = 0; i < ports.size(); i++) {
        Integer port = ports.get(i);
        File logDir = TestUtils.constructTempDir("kafka-local");
        Properties properties = new Properties();
        properties.putAll(baseProperties);
        properties.setProperty("zookeeper.connect", zkConnection);
        properties.setProperty("broker.id", String.valueOf(i + 1));
        properties.setProperty("advertised.host.name", "127.0.0.1");
        properties.setProperty("host.name", "127.0.0.1");
        properties.setProperty("advertised.port", Integer.toString(port));
        properties.setProperty("port", Integer.toString(port));
        properties.setProperty("log.dirs", logDir.getAbsolutePath());
        properties.setProperty("offsets.topic.num.partitions", "1");
        properties.setProperty("offsets.topic.replication.factor", "1");
        properties.setProperty("log.flush.interval.messages", String.valueOf(1));
        KafkaServerStartable broker = startBroker(properties);
        brokers.add(broker);
        logDirs.add(logDir);
    }
}
Also used : KafkaServerStartable(kafka.server.KafkaServerStartable) Properties(java.util.Properties) File(java.io.File)

Example 7 with KafkaServerStartable

use of kafka.server.KafkaServerStartable in project beam by apache.

the class EmbeddedKafkaCluster method startBroker.

private static KafkaServerStartable startBroker(Properties props) {
    KafkaServerStartable server = new KafkaServerStartable(new KafkaConfig(props));
    server.startup();
    return server;
}
Also used : KafkaServerStartable(kafka.server.KafkaServerStartable) KafkaConfig(kafka.server.KafkaConfig)

Aggregations

KafkaServerStartable (kafka.server.KafkaServerStartable)7 File (java.io.File)5 OfflineClusterIntegrationTest (com.linkedin.pinot.integration.tests.OfflineClusterIntegrationTest)2 ArrayList (java.util.ArrayList)2 KafkaConfig (kafka.server.KafkaConfig)2 JSONArray (org.json.JSONArray)2 JSONObject (org.json.JSONObject)2 QuickstartRunner (com.linkedin.pinot.tools.admin.command.QuickstartRunner)1 MeetupRsvpStream (com.linkedin.pinot.tools.streams.MeetupRsvpStream)1 Properties (java.util.Properties)1 ZkClient (org.I0Itec.zkclient.ZkClient)1 JSONException (org.json.JSONException)1 AfterClass (org.testng.annotations.AfterClass)1