Package org.elasticsearch.hadoop.serialization.json

Examples of org.elasticsearch.hadoop.serialization.json.BackportedObjectReader


        ObjectMapper mapper = new ObjectMapper();
        InputStream in = getClass().getResourceAsStream("bulk-error.json");
        JsonParser parser = mapper.getJsonFactory().createJsonParser(in);
        ParsingUtils.seek("items", new JacksonJsonParser(parser));

        BackportedObjectReader r = BackportedObjectReader.create(mapper, Map.class);

        for (Iterator<Map> iterator = r.readValues(parser); iterator.hasNext();) {
            Map map = mapper.readValue(parser, Map.class);
            String error = (String) ((Map) map.values().iterator().next()).get("error");
            assertNotNull(error);
            assertTrue(error.contains("document already exists"));
        }
View Full Code Here

TOP

Related Classes of org.elasticsearch.hadoop.serialization.json.BackportedObjectReader

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.