Package voldemort.serialization.json

Examples of voldemort.serialization.json.JsonTypeSerializer.toBytes()


            @Override
            public void doOperation(int index) throws Exception {
                try {
                    totalResults.incrementAndGet();
                    int curr = current.getAndIncrement();
                    List<Versioned<byte[]>> results = store.get(new ByteArray(keySerializer.toBytes(requestIds.take())),
                                                                null);
                    if(curr % progressIncrement == 0)
                        System.out.println(curr);

                    if(results.size() == 0)
View Full Code Here


        RoutingStrategy strategy = new ConsistentRoutingStrategy(cluster, repFactor);
        JsonTypeSerializer serializer = new JsonTypeSerializer(JsonTypeDefinition.INT32);
        Map<Integer, Integer> counts = new HashMap<Integer, Integer>();

        for(int i = 0; i < maxVal; i++) {
            for(Node node: strategy.routeRequest(serializer.toBytes(i))) {
                int newCount = 1;
                if(counts.get(node.getId()) != null) {
                    newCount = counts.get(node.getId()) + 1;
                }
                counts.put(node.getId(), newCount);
View Full Code Here

        JsonTypeSerializer ser = new JsonTypeSerializer(def);
        long start = System.currentTimeMillis();
        int iters = 100;
        List<byte[]> bytes = new ArrayList<byte[]>(iters);
        for(int i = 0; i < iters; i++)
            bytes.add(ser.toBytes(value));
        long elapsed = System.currentTimeMillis() - start;
        System.out.println("Took " + (elapsed / iters) + " ms");
    }

}
View Full Code Here

            public void write(Object key, Object value)
                    throws IOException {

                out.append(
                        new BytesWritable(keySerializer.toBytes(key)),
                        new BytesWritable(valueSerializer.toBytes(value))
                );
                context.progress();
            }

            public void close(TaskAttemptContext context) throws IOException {
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.