Examples of EsTap


Examples of org.elasticsearch.hadoop.cascading.EsTap

    @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

Examples of org.elasticsearch.hadoop.cascading.EsTap

        Properties properties = new TestSettings().getProperties();
        properties.setProperty(ConfigurationOptions.ES_INDEX_AUTO_CREATE, "false");

        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/non-existing", 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 org.elasticsearch.hadoop.cascading.EsTap

    @Test
    public void testFieldMapping() throws Exception {
        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/fieldmapping", 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 org.elasticsearch.hadoop.cascading.EsTap

    public void testIndexPattern() throws Exception {
        Properties properties = new TestSettings().getProperties();

        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/pattern-{id}", new Fields("id", "name", "url", "picture"));
        Pipe pipe = new Pipe("copy");
        build(properties, in, out, pipe);
    }
View Full Code Here

Examples of org.elasticsearch.hadoop.cascading.EsTap

    public void testIndexPatternWithFormatAndAlias() throws Exception {
        Properties properties = new TestSettings().getProperties();

        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/pattern-format-{ts:YYYY-MM-dd}", new Fields("id", "name", "url", "picture", "ts"));
        Pipe pipe = new Pipe("copy");

        build(properties, in, out, pipe);
    }
View Full Code Here

Examples of org.elasticsearch.hadoop.cascading.EsTap

    @Test
    public void testUpdate() throws Exception {
        // local file-system source
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/createwithid", new Fields("id", "name", "url", "picture"));
        Properties props = new TestSettings().getProperties();
        props.put(ConfigurationOptions.ES_MAPPING_ID, "id");

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

Examples of org.elasticsearch.hadoop.cascading.EsTap

        properties.put(ConfigurationOptions.ES_UPDATE_SCRIPT_LANG, "groovy");


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

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

Examples of org.elasticsearch.hadoop.cascading.EsTap

        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/createwithid", new Fields("id", "name", "url", "picture"));

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

Examples of org.elasticsearch.hadoop.cascading.EsTap

        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/createwithid", new Fields("id", "name", "url", "picture"));

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

Examples of org.elasticsearch.hadoop.cascading.EsTap

        Properties properties = new TestSettings().getProperties();
        properties.put(ConfigurationOptions.ES_WRITE_OPERATION, "upsert");
        properties.put(ConfigurationOptions.ES_MAPPING_ID, "id");

        Tap in = sourceTap();
        Tap out = new EsTap("cascading-local/upsert", new Fields("id", "name", "url", "picture"));

        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.