Package org.elasticsearch.hadoop.util

Examples of org.elasticsearch.hadoop.util.TestSettings


        client.close();
    }

    @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();
View Full Code Here


public class RestUtils {

    public static class ExtendedRestClient extends RestClient {

        public ExtendedRestClient() {
            super(new TestSettings());
        }
View Full Code Here

    private RestRepository client;
    private Settings settings;

    @Before
    public void start() throws IOException {
        settings = new TestSettings("rest/savebulk");
        //testSettings.setPort(9200)
        settings.setProperty(ConfigurationOptions.ES_SERIALIZATION_WRITER_VALUE_CLASS, JdkValueWriter.class.getName());
        settings.setProperty(ConfigurationOptions.ES_SERIALIZATION_WRITER_VALUE_CLASS, JdkValueWriter.class.getName());
        client = new RestRepository(settings);
        client.waitForYellow();
View Full Code Here

        Resource res = createResource("foo/bar/_search=?somequery&bla=bla");
        assertEquals("foo/bar", res.indexAndType());
    }

    private Resource createResource(String target) {
        Settings s = new TestSettings();
        s.setProperty(ConfigurationOptions.ES_RESOURCE, target);
        return new Resource(s, true);
    }
View Full Code Here

        settings.setProperty(ConfigurationOptions.ES_WRITE_OPERATION, operation);
        return BulkCommands.create(settings);
    }

    private Settings settings() {
        Settings set = new TestSettings();
        InitializationUtils.setValueWriterIfNotSet(set, JdkValueWriter.class, null);
        InitializationUtils.setFieldExtractorIfNotSet(set, MapFieldExtractor.class, null);
        set.setResourceWrite("foo/bar");
        if (isUpdateOp()) {
            set.setProperty(ConfigurationOptions.ES_MAPPING_ID, "<2>");
        }
        return set;
    }
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.util.TestSettings

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.