Examples of Tap


Examples of cascading.tap.Tap

    private static final String INPUT = TestUtils.sampleArtistsDat(CascadingHadoopSuite.configuration);

    @Test
    public void testWriteToES() throws Exception {
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/artists", new Fields("name", "url", "picture"));
        Pipe pipe = new Pipe("copy");

        FlowDef flowDef = FlowDef.flowDef().addSource(pipe, in).addTailSink(pipe, out);
        StatsUtils.proxy(new HadoopFlowConnector(HdpBootstrap.asProperties(CascadingHadoopSuite.configuration)).connect(flowDef)).complete();
    }
View Full Code Here

Examples of cascading.tap.Tap

        assertThat(RestUtils.getMapping("cascading-hadoop/artists").skipHeaders().toString(), is("artists=[name=STRING, picture=STRING, url=STRING]"));
    }

    @Test
    public void testWriteToESWithAlias() throws Exception {
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/alias", "", new Fields("name", "url", "picture"));
        Pipe pipe = new Pipe("copy");

        // rename "id" -> "garbage"
        pipe = new Each(pipe, new Identity(new Fields("garbage", "name", "url", "picture", "ts")));
View Full Code Here

Examples of cascading.tap.Tap

    @Test
    public void testIndexPattern() throws Exception {
        Properties props = HdpBootstrap.asProperties(CascadingHadoopSuite.configuration);

        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/pattern-{id}", new Fields("id", "name", "url", "picture"));
        Pipe pipe = new Pipe("copy");
        StatsUtils.proxy(new HadoopFlowConnector(props).connect(in, out, pipe)).complete();
    }
View Full Code Here

Examples of cascading.tap.Tap

    @Test
    public void testIndexPatternWithFormat() throws Exception {
        Properties props = HdpBootstrap.asProperties(CascadingHadoopSuite.configuration);

        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/pattern-format-{ts:YYYY-MM-dd}", new Fields("id", "name", "url", "picture", "ts"));
        Pipe pipe = new Pipe("copy");
        StatsUtils.proxy(new HadoopFlowConnector(props).connect(in, out, pipe)).complete();
    }
View Full Code Here

Examples of cascading.tap.Tap

    private static final String INPUT = TestUtils.sampleArtistsJson(CascadingHadoopSuite.configuration);

    @Test
    public void testWriteToES() throws Exception {
        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("json-cascading-hadoop/artists");

        Pipe pipe = new Pipe("copy");
        build(cfg(), in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

    public void testIndexAutoCreateDisabled() throws Exception {
        Properties cfg = cfg();
        cfg.setProperty(ConfigurationOptions.ES_INDEX_AUTO_CREATE, "false");

        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("json-cascading-hadoop/non-existing", new Fields("line"));
        Pipe pipe = new Pipe("copy");
        build(cfg, in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

        build(cfg, in, out, pipe);
    }

    @Test
    public void testIndexPattern() throws Exception {
        Tap in = sourceTap();
        Tap out = new EsTap("json-cascading-hadoop/pattern-{number}", new Fields("line"));
        Pipe pipe = new Pipe("copy");
        build(cfg(), in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

        build(cfg(), in, out, pipe);
    }

    @Test
    public void testIndexPatternWithFormat() throws Exception {
        Tap in = sourceTap();
        Tap out = new EsTap("json-cascading-hadoop/pattern-format-{@timestamp:YYYY-MM-dd}", new Fields("line"));
        Pipe pipe = new Pipe("copy");
        build(cfg(), in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

    private static final String INPUT = TestUtils.sampleArtistsDat();

    @Test
    public void testWriteToES() throws Exception {
        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/artists", new Fields("name", "url", "picture"));

        Pipe pipe = new Pipe("copy");
        build(new TestSettings().getProperties(), in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

    }

    @Test
    public void testWriteToESWithAlias() throws Exception {
        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/alias", new Fields("name", "url", "picture"));
        Pipe pipe = new Pipe("copy");

        // rename "id" -> "garbage"
        pipe = new Each(pipe, new Identity(new Fields("garbage", "name", "url", "picture", "ts")));
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.