Examples of StreamBuilder


Examples of com.odiago.flumebase.testutil.StreamBuilder

    EmbeddedFlumeConfig flumeConf = getFlumeConfig();
    String nodeSource = "text(\"" + sourceFilename + "\")";
    flumeConf.start();
    flumeConf.spawnLogicalNode(SRC_NODE, nodeSource, "console");

    StreamBuilder streamBuilder = new StreamBuilder("inputstream");
    streamBuilder.setSource(SRC_NODE);
    streamBuilder.setSourceType(StreamSourceType.Node);
    streamBuilder.setLocal(false);
    streamBuilder.addField("x", Type.getPrimitive(Type.TypeName.STRING));

    getSymbolTable().addSymbol(streamBuilder.build());
    LocalEnvironment env = getEnvironment();
    env.connect();

    getConf().set(SelectStmt.CLIENT_SELECT_TARGET_KEY, "select-out");
View Full Code Here

Examples of com.odiago.flumebase.testutil.StreamBuilder

    EmbeddedFlumeConfig flumeConf = getFlumeConfig();
    String nodeSource = "tail(\"" + sourceFilename + "\")";
    flumeConf.start();
    flumeConf.spawnLogicalNode(SRC_NODE, nodeSource, "console");

    StreamBuilder streamBuilder = new StreamBuilder("inputstream");
    streamBuilder.setSource(SRC_NODE);
    streamBuilder.setSourceType(StreamSourceType.Node);
    streamBuilder.setLocal(false);
    streamBuilder.addField("x", Type.getPrimitive(Type.TypeName.STRING));
    streamBuilder.addField("y", Type.getPrimitive(Type.TypeName.INT));

    getSymbolTable().addSymbol(streamBuilder.build());
    LocalEnvironment env = getEnvironment();
    env.connect();

    // Test the first query.
    LOG.debug("Running first query");
View Full Code Here

Examples of com.odiago.flumebase.testutil.StreamBuilder

    // Create a stream we will fill with numbers via flume.
    File sourceFile = File.createTempFile("numberstream-", ".txt");
    sourceFile.deleteOnExit();
    String sourceFilename = sourceFile.getAbsolutePath();

    StreamBuilder streamBuilder = new StreamBuilder("inputstream");

    streamBuilder.addField(new TypedField("a", Type.getPrimitive(Type.TypeName.INT)));
    streamBuilder.setFormat(new FormatSpec("delimited"));
    streamBuilder.setLocal(true);
    streamBuilder.setSourceType(StreamSourceType.Source);
    streamBuilder.setSource("tail(\"" + sourceFilename + "\")");
    StreamSymbol inputStream = streamBuilder.build();

    getSymbolTable().addSymbol(inputStream);

    LocalEnvironment env = getEnvironment();
    env.connect();
View Full Code Here

Examples of org.apache.abdera.factory.StreamBuilder

    public static void main(String... args) throws Exception {

        Abdera abdera = Abdera.getInstance();

        StreamBuilder out = abdera.getWriterFactory().newStreamWriter("fom");
        out.startDocument().startFeed().writeBase("http://example.org").writeLanguage("en-US")
            .writeId("http://example.org").writeTitle("<Testing 123>").writeSubtitle("Foo").writeAuthor("James",
                                                                                                        null,
                                                                                                        null)
            .writeUpdated(new Date()).writeLink("http://example.org/foo").writeLink("http://example.org/bar", "self")
            .writeCategory("foo").writeCategory("bar").writeLogo("logo").writeIcon("icon")
            .writeGenerator("1.0", "http://example.org", "foo");

        for (int n = 0; n < 100; n++) {
            out.startEntry().writeId("http://example.org/" + n).writeTitle("Entry #" + n).writeUpdated(new Date())
                .writePublished(new Date()).writeEdited(new Date()).writeSummary("This is text summary")
                .writeAuthor("James", null, null).writeContributor("Joe", null, null).startContent("application/xml")
                .startElement("a", "b", "c").startElement("x", "y", "z").writeElementText("This is a test")
                .startElement("a").writeElementText("foo").endElement().startElement("b", "bar")
                .writeAttribute("foo", new Date()).writeAttribute("bar", 123L).writeElementText(123.123).endElement()
                .endElement().endElement().endContent().endEntry();
        }

        Document<Feed> doc = out.endFeed().endDocument().getBase();

        doc.writeTo(System.out);
    }
View Full Code Here

Examples of org.apache.abdera.factory.StreamBuilder

  public static void main(String... args) throws Exception {
   
    Abdera abdera = Abdera.getInstance();
   
    StreamBuilder out = abdera.getWriterFactory().newStreamWriter("fom");
    out.startDocument()
         .startFeed()
           .writeBase("http://example.org")
           .writeLanguage("en-US")
           .writeId("http://example.org")
           .writeTitle("<Testing 123>")
           .writeSubtitle("Foo")
           .writeAuthor("James", null, null)
           .writeUpdated(new Date())
           .writeLink("http://example.org/foo")
           .writeLink("http://example.org/bar","self")
           .writeCategory("foo")
           .writeCategory("bar")
           .writeLogo("logo")
           .writeIcon("icon")
           .writeGenerator("1.0", "http://example.org", "foo");
     
    for (int n = 0; n < 100; n++) {
      out.startEntry()     
        .writeId("http://example.org/" + n)
        .writeTitle("Entry #" + n)
        .writeUpdated(new Date())
        .writePublished(new Date())
        .writeEdited(new Date())
        .writeSummary("This is text summary")
        .writeAuthor("James", null, null)
        .writeContributor("Joe", null, null)
        .startContent("application/xml")
          .startElement("a","b","c")
            .startElement("x","y","z")
              .writeElementText("This is a test")
              .startElement("a")
                .writeElementText("foo")
              .endElement()
              .startElement("b","bar")
                .writeAttribute("foo", new Date())
                .writeAttribute("bar", 123L)
                .writeElementText(123.123)
              .endElement()
            .endElement()
          .endElement()
        .endContent()
        .endEntry();
    }
     
    Document<Feed> doc =
      out.endFeed()
        .endDocument().getBase();
   
    doc.writeTo(System.out);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.