Package org.elasticsearch.hadoop.rest

Examples of org.elasticsearch.hadoop.rest.RestClient


    @Test
    public void testEmptyBulkWrite() throws Exception {
        TestSettings testSettings = new TestSettings("rest/emptybulk");
        testSettings.setProperty(ConfigurationOptions.ES_SERIALIZATION_WRITER_VALUE_CLASS, JdkValueWriter.class.getName());
        RestRepository restRepo = new RestRepository(testSettings);
        RestClient client = restRepo.getRestClient();
        client.bulk(new Resource(testSettings, false), new TrackingBytesArray(new BytesArray("{}")));
        restRepo.waitForYellow();
        restRepo.close();
        client.close();
    }
View Full Code Here


            return IOUtils.asString(execute(Request.Method.POST, index + "/_refresh", null).body());
        }
    }

    public static void putMapping(String index, byte[] content) throws Exception {
        RestClient rc = new ExtendedRestClient();
        BytesArray bs = new BytesArray(content);
        rc.putMapping(index, index + "/_mapping", bs.bytes());
        rc.close();
    }
View Full Code Here

    @BeforeClass
    public static void localStartup() throws Exception {
        AbstractPigTests.startup();

        // initialize Pig in local mode
        RestClient client = new RestClient(new TestSettings());
        try {
            client.deleteIndex("pig");
        } catch (Exception ex) {
            // ignore
        }
    }
View Full Code Here

    @BeforeClass
    public static void startup() throws Exception {
        AbstractPigTests.startup();
        // initialize Pig in local mode
        RestClient client = new RestClient(new TestSettings());
        try {
            client.deleteIndex("json-pig");
        } catch (Exception ex) {
            // ignore
        }
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.hadoop.rest.RestClient

Copyright © 2018 www.massapicom. 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.