Examples of Tap


Examples of cascading.tap.Tap

        properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT, "counter += param1; anothercounter += param2");
        properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT_LANG, "groovy");
        properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT_PARAMS, " param1:<1>,   param2:id ");

        Tap in = sourceTap();
        // use an existing id to allow the update to succeed
        Tap out = new EsTap("cascading-local/upsert-param-script", new Fields("id", "name", "url", "picture"));

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

Examples of cascading.tap.Tap

        properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT, "counter += param1; anothercounter += param2");
        properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT_LANG, "groovy");
        properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT_PARAMS_JSON, "{ \"param1\":1, \"param2\":2}");

        Tap in = sourceTap();
        // use an existing id to allow the update to succeed
        Tap out = new EsTap("cascading-local/upsert-script-json-script", new Fields("id", "name", "url", "picture"));

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

Examples of cascading.tap.Tap

        RestUtils.refresh("cascading-local");
    }

    @Test
    public void testReadFromES() throws Exception {
        Tap in = new EsTap("cascading-local/artists", query);
        Pipe pipe = new Pipe("copy");
        pipe = new Each(pipe, new FilterNotNull());
        pipe = new Each(pipe, AssertionLevel.STRICT, new AssertSizeLessThan(5));
        // can't select when using unknown
        //pipe = new Each(pipe, new Fields("name"), AssertionLevel.STRICT, new AssertNotNull());
        pipe = new GroupBy(pipe);
        pipe = new Every(pipe, new Count());

        // print out
        Tap out = new OutputStreamTap(new TextLine(), OUT);
        build(cfg(), in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

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

    @Test
    public void testReadFromESWithFields() throws Exception {
        Tap in = new EsTap("cascading-local/artists", query, new Fields("url", "name"));
        Pipe pipe = new Pipe("copy");
        pipe = new Each(pipe, AssertionLevel.STRICT, new AssertSizeEquals(2));
        pipe = new Each(pipe, AssertionLevel.STRICT, new AssertNotNull());
        pipe = new GroupBy(pipe);
        pipe = new Every(pipe, new Count());

        // print out
        Tap out = new OutputStreamTap(new TextLine(), OUT);
        build(cfg(), in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

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

    @Test
    public void testReadFromESAliasedField() throws Exception {
        Tap in = new EsTap("cascading-local/alias", query, new Fields("address"));
        Pipe pipe = new Pipe("copy");
        pipe = new Each(pipe, AssertionLevel.STRICT, new AssertNotNull());
        pipe = new GroupBy(pipe);
        pipe = new Every(pipe, new Count());

        // print out
        Tap out = new OutputStreamTap(new TextLine(), OUT);
        build(cfg(), in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

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

    @Test
    public void testReadFromESWithFieldAlias() throws Exception {
        Tap in = new EsTap("cascading-local/alias", query, new Fields("url"));
        Pipe pipe = new Pipe("copy");
        pipe = new Each(pipe, AssertionLevel.STRICT, new AssertNotNull());
        pipe = new GroupBy(pipe);
        pipe = new Every(pipe, new Count());

        // print out
        // print out
        Tap out = new OutputStreamTap(new TextLine(), OUT);
        Properties cfg = cfg();
        cfg.setProperty("es.mapping.names", "url:address");
        build(cfg, in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

    @Test
    public void testWriteToES() throws Exception {
        Properties props = new TestSettings().getProperties();
        props.put(ConfigurationOptions.ES_INPUT_JSON, "true");

        Tap in = sourceTap();
        Tap out = new EsTap("json-cascading-local/artists");

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

Examples of cascading.tap.Tap

    public void testIndexAutoCreateDisabled() throws Exception {
        Properties properties = new TestSettings().getProperties();
        properties.put(ConfigurationOptions.ES_INDEX_AUTO_CREATE, "false");
        properties.put(ConfigurationOptions.ES_INPUT_JSON, "true");

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

Examples of cascading.tap.Tap

    @Test
    public void testIndexPattern() throws Exception {
        Properties properties = new TestSettings().getProperties();
        properties.put(ConfigurationOptions.ES_INPUT_JSON, "yes");

        Tap in = sourceTap();
        Tap out = new EsTap("json-cascading-local/pattern-{number}", new Fields("line"));
        Pipe pipe = new Pipe("copy");
        build(properties, in, out, pipe);
    }
View Full Code Here

Examples of cascading.tap.Tap

    @Test
    public void testIndexPatternWithFormat() throws Exception {
        Properties properties = new TestSettings().getProperties();
        properties.put(ConfigurationOptions.ES_INPUT_JSON, "yes");

        Tap in = sourceTap();
        Tap out = new EsTap("json-cascading-local/pattern-format-{@timestamp:YYYY-MM-dd}", new Fields("line"));
        Pipe pipe = new Pipe("copy");
        build(properties, in, out, pipe);
    }
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.