Examples of toBytes()


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

        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

Examples of voldemort.versioning.VectorClock.toBytes()

            dataStream.writeInt(object.length);
            dataStream.write(object);

            VectorClock clock = (VectorClock) value.getVersion();
            dataStream.writeInt(clock.sizeInBytes());
            dataStream.write(clock.toBytes());
        }

        return stream.toByteArray();
    }
View Full Code Here

Examples of voldemort.versioning.VectorClock.toBytes()

        }
        outputStream.writeInt(key.length());
        outputStream.write(key.get());
        VectorClock clock = version;
        outputStream.writeShort(clock.sizeInBytes());
        outputStream.write(clock.toBytes());
    }

    public boolean isCompleteDeleteResponse(ByteBuffer buffer) {
        return isCompleteResponse(buffer, VoldemortOpCode.DELETE_OP_CODE);
    }
View Full Code Here

Examples of voldemort.versioning.VectorClock.toBytes()

                        for(Versioned<byte[]> versioned: queryKeyResult.getValues()) {

                            // write version
                            VectorClock version = (VectorClock) versioned.getVersion();
                            out.write("VECTOR_CLOCK_BYTE: "
                                      + ByteUtils.toHexString(version.toBytes()) + "\n");
                            out.write("VECTOR_CLOCK_TEXT: " + version.toString() + '['
                                      + new Date(version.getTimestamp()).toString() + "]\n");

                            // write value
                            byte[] valueBytes = versioned.getValue();
View Full Code Here

Examples of voldemort.versioning.VectorClock.toBytes()

                    for(Versioned<byte[]> versioned: queryKeyResult.getValues()) {

                        // write version
                        VectorClock version = (VectorClock) versioned.getVersion();
                        out.write("VECTOR_CLOCK_BYTE: " + ByteUtils.toHexString(version.toBytes())
                                  + "\n");
                        out.write("VECTOR_CLOCK_TEXT: " + version.toString() + '['
                                  + new Date(version.getTimestamp()).toString() + "]\n");

                        // write value
View Full Code Here

Examples of voldemort.versioning.VectorClock.toBytes()

                    throw new ObsoleteVersionException("Attempt to put version "
                                                       + value.getVersion()
                                                       + " which is superceeded by " + version
                                                       + ".");
                else if(occurred == Occurred.AFTER)
                    delete(conn, key.get(), version.toBytes());
            }

            // Okay, cool, now put the value
            insert = conn.prepareStatement(insertSql);
            insert.setBytes(1, key.get());
View Full Code Here

Examples of voldemort.versioning.VectorClock.toBytes()

            // Okay, cool, now put the value
            insert = conn.prepareStatement(insertSql);
            insert.setBytes(1, key.get());
            VectorClock clock = (VectorClock) value.getVersion();
            insert.setBytes(2, clock.toBytes());
            insert.setBytes(3, value.getValue());
            insert.executeUpdate();
            doCommit = true;
        } catch(SQLException e) {
            if(e.getErrorCode() == MYSQL_ERR_DUP_KEY || e.getErrorCode() == MYSQL_ERR_DUP_ENTRY) {
View Full Code Here

Examples of wyrl.core.Type.toBytes()

    for (int i = 0; i != typeRegister.size(); ++i) {
      Type t = typeRegister.get(i);
      JavaIdentifierOutputStream jout = new JavaIdentifierOutputStream();
      BinaryOutputStream bout = new BinaryOutputStream(jout);
      bout.write(t.toBytes());
      bout.flush();
      bout.close();
      // FIXME: strip out nominal types (and any other unneeded types).
      myOut(1, "// " + t);
      myOut(1, "private static Type type" + i + " = Runtime.Type(\""
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.