Examples of sizeInBytes()


Examples of voldemort.versioning.VectorClock.sizeInBytes()

            int valueSize = inputStream.readInt();
            byte[] bytes = new byte[valueSize];
            ByteUtils.read(inputStream, bytes);
            VectorClock clock = new VectorClock(bytes);
            results.add(new Versioned<byte[]>(ByteUtils.copy(bytes,
                                                             clock.sizeInBytes(),
                                                             bytes.length), clock));
        }
        return results;
    }
View Full Code Here

Examples of voldemort.versioning.VectorClock.sizeInBytes()

        ByteArray key = readKey(inputStream);
        int valueSize = inputStream.readInt();
        byte[] bytes = new byte[valueSize];
        ByteUtils.read(inputStream, bytes);
        VectorClock clock = new VectorClock(bytes);
        byte[] value = ByteUtils.copy(bytes, clock.sizeInBytes(), bytes.length);

        byte[] transforms = null;
        if(protocolVersion > 2) {
            if(inputStream.readBoolean()) {
                transforms = readTransforms(inputStream);
View Full Code Here

Examples of voldemort.versioning.VectorClock.sizeInBytes()

            logger.debug("PUT started at: " + startTimeMs + " handlerRef: "
                         + System.identityHashCode(inputStream) + " key: "
                         + ByteUtils.toHexString(key.get()) + " "
                         + (System.nanoTime() - startTimeNs) + " ns, keySize: " + key.length()
                         + " valueHash: " + value.hashCode() + " valueSize: " + value.length
                         + " clockSize: " + clock.sizeInBytes() + " time: "
                         + System.currentTimeMillis());
        }
    }

    private void handleDelete(DataInputStream inputStream,
View Full Code Here

Examples of voldemort.versioning.VectorClock.sizeInBytes()

        if(logger.isDebugEnabled()) {
            logger.debug("DELETE started at: " + startTimeMs + " key: "
                         + ByteUtils.toHexString(key.get()) + " handlerRef: "
                         + System.identityHashCode(inputStream) + " time: "
                         + (System.nanoTime() - startTimeNs) + " ns, keySize: " + key.length()
                         + " clockSize: " + version.sizeInBytes());
        }
    }

    private void writeException(DataOutputStream stream, VoldemortException e) throws IOException {
        short code = getErrorMapper().getCode(e);
View Full Code Here

Examples of voldemort.versioning.VectorClock.sizeInBytes()

            int count = 0;
            while(iter.hasNext()) {
                Pair<ByteArray, Versioned<byte[]>> pair = iter.next();
                VectorClock clock = (VectorClock) pair.getSecond().getVersion();
                stats.countEntry(pair.getFirst().length(), pair.getSecond().getValue().length
                                                           + clock.sizeInBytes());
                if(count % 10000 == 0)
                    logger.debug("Processing key " + count);
                count++;
            }
        } finally {
View Full Code Here

Examples of voldemort.versioning.VectorClock.sizeInBytes()

                            + (System.currentTimeMillis() - startTime) / 1000 + " secs");

            // read the value as a versioned Object
            VectorClock clock = new VectorClock(valueEntry.getData());
            byte[] bytes = ByteUtils.copy(valueEntry.getData(),
                                          clock.sizeInBytes(),
                                          valueEntry.getData().length);
            Versioned<byte[]> value = new Versioned<byte[]>(bytes, clock);
            byte[] key = keyEntry.getData();

            if(prevKey != null && (ByteUtils.compare(prevKey, key) != 0)) {
View Full Code Here

Examples of voldemort.versioning.VectorClock.sizeInBytes()

            throw new VoldemortException("Unexpected version number in value: " + bytes[0]);
        int pos = 1;
        List<Versioned<byte[]>> vals = new ArrayList<Versioned<byte[]>>(2);
        while(pos < bytes.length) {
            VectorClock clock = new VectorClock(bytes, pos);
            pos += clock.sizeInBytes();
            int valueSize = ByteUtils.readInt(bytes, pos);
            pos += ByteUtils.SIZE_OF_INT;
            byte[] val = new byte[valueSize];
            System.arraycopy(bytes, pos, val, 0, valueSize);
            pos += valueSize;
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.