Skip to content

Developing teknek components or including in your project

edwardcapriolo edited this page Dec 15, 2013 · 1 revision

To developing feeds and operators include these dependencies in your project.

Pom.xml

           <dependency>
                    <groupId>io.teknek</groupId>
                    <artifactId>teknek-core</artifactId>
                    <version>0.0.1-SNAPSHOT</version>
            </dependency>

            <dependency>
                    <groupId>io.teknek</groupId>
                    <artifactId>teknek-core</artifactId>
                    <version>0.0.1-SNAPSHOT</version>
                    <type>test-jar</type>
                    <scope>test</scope>
            </dependency>

Starting teknek inside embedded test

public class SimpleTopologyTest extends EmbeddedZooKeeperServer {

  static TeknekDaemon td = null;

  @BeforeClass
  public static void setup(){
    Properties props = new Properties();
    props.put(TeknekDaemon.ZK_SERVER_LIST, zookeeperTestServer.getConnectString());
    td = new TeknekDaemon(props);
    td.init();
  }

  @Test
  public void hangAround(){
    Plan p = new Plan().withFeedDesc(
        new FeedDesc().withFeedClass(FixedFeed.class.getName()).withProperties(
                MapBuilder.makeMap(FixedFeed.NUMBER_OF_PARTITIONS, 2, FixedFeed.NUMBER_OF_ROWS,
                        10))).withRootOperator(
        new OperatorDesc(new BeLoudOperator()));
    p.setName("yell");
    p.setMaxWorkers(1);
    td.applyPlan(p);
    try {
      Thread.sleep(3000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }

  @AfterClass
  public static void shutdown(){
    td.stop();
  }
}