Package me.prettyprint.hector.api

Examples of me.prettyprint.hector.api.Serializer.toByteBuffer()


    Serializer serializer = GoraSerializerTypeInferer.getSerializer(value);
    if (serializer == null) {
      LOG.info("Serializer not found for: " + value.toString());
    }
    else {
      byteBuffer = serializer.toByteBuffer(value);
    }

    if (byteBuffer == null) {
      LOG.info("value class=" + value.getClass().getName() + " value=" + value + " -> null");
    }
View Full Code Here


        ExtensibleTypeInferringSerializer.addSerializer(BigDecimal.class, BigDecimalSerializer.get());
        BigDecimal value = new BigDecimal(1);

        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(BigDecimal.class);

        ByteBuffer buffer = serializer.toByteBuffer(value);

        BigDecimal deserializedBigDecimal = (BigDecimal) serializer.fromByteBuffer(buffer);

        assertEquals(value, deserializedBigDecimal);
    }
View Full Code Here

        ExtensibleTypeInferringSerializer.addSerializer(DateTime.class, DateTimeSerializer.get());
        DateTime value = new DateTime(2000, 1, 1, 12, 0);

        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(DateTime.class);

        ByteBuffer buffer = serializer.toByteBuffer(value);

        DateTime deserializedDateTime = (DateTime) serializer.fromByteBuffer(buffer);

        assertEquals(value, deserializedDateTime);
    }
View Full Code Here

        Reading reading = new Reading(uuid, date, new BigDecimal(195).movePointLeft(1),
                24, "ESE", BigInteger.valueOf(17L), false);

        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(Reading.class);

        ByteBuffer buffer = serializer.toByteBuffer(reading);

        Reading deserializedReading = new Reading(uuid, date, (Reading) serializer.fromByteBuffer(buffer));

        assertEquals(reading, deserializedReading);
    }
View Full Code Here

    Serializer serializer = GoraSerializerTypeInferer.getSerializer(value);
    if (serializer == null) {
      LOG.info("Serializer not found for: " + value.toString());
    }
    else {
      byteBuffer = serializer.toByteBuffer(value);
    }

    if (byteBuffer == null) {
      LOG.info("value class=" + value.getClass().getName() + " value=" + value + " -> null");
    }
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.