Package com.netflix.suro.jackson

Examples of com.netflix.suro.jackson.DefaultObjectMapper.readValue()


        Map<Integer, Set<Map<String, Object>>> resultSet = new HashMap<Integer, Set<Map<String, Object>>>();
        for (int i = 0; i < messageCount; ++i) {
            MessageAndMetadata<byte[], byte[]> msgAndMeta = stream.iterator().next();
            System.out.println(new String(msgAndMeta.message()));

            Map<String, Object> msg = jsonMapper.readValue(new String(msgAndMeta.message()), new TypeReference<Map<String, Object>>() {});
            Set<Map<String, Object>> s = resultSet.get(msgAndMeta.partition());
            if (s == null) {
                s = new HashSet<Map<String, Object>>();
                resultSet.put(msgAndMeta.partition(), s);
            }
View Full Code Here


        // setup sinks, both old and new versions
        ObjectMapper jsonMapper = new DefaultObjectMapper();
        jsonMapper.registerSubtypes(new NamedType(KafkaSink.class, "kafkaV1"));
        jsonMapper.registerSubtypes(new NamedType(KafkaSinkV2.class, "kafkaV2"));
        KafkaSink   sinkV1 = jsonMapper.readValue(description1, new TypeReference<Sink>(){});
        KafkaSinkV2 sinkV2 = jsonMapper.readValue(description2, new TypeReference<Sink>(){});
        sinkV1.open();
        sinkV2.open();
        List<Sink> sinks = new ArrayList<Sink>();
        sinks.add(sinkV1);
View Full Code Here

        // setup sinks, both old and new versions
        ObjectMapper jsonMapper = new DefaultObjectMapper();
        jsonMapper.registerSubtypes(new NamedType(KafkaSink.class, "kafkaV1"));
        jsonMapper.registerSubtypes(new NamedType(KafkaSinkV2.class, "kafkaV2"));
        KafkaSink   sinkV1 = jsonMapper.readValue(description1, new TypeReference<Sink>(){});
        KafkaSinkV2 sinkV2 = jsonMapper.readValue(description2, new TypeReference<Sink>(){});
        sinkV1.open();
        sinkV2.open();
        List<Sink> sinks = new ArrayList<Sink>();
        sinks.add(sinkV1);
        sinks.add(sinkV2);
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.