Package com.thinkaurelius.titan.diskstorage.util

Examples of com.thinkaurelius.titan.diskstorage.util.StaticByteBuffer


        //which is the defaul for Transaction
        this.tx = (autoTx) ? newTransaction(new StandardTransactionBuilder(this.getConfiguration(), this)) : null;
    }

    protected FaunusVertex readFaunusVertex(final ByteBuffer key, Iterable<Entry> entries) {
        final FaunusVertexLoader loader = new FaunusVertexLoader(new StaticByteBuffer(key));
        for (final Entry data : entries) {
            try {
                final FaunusVertexLoader.RelationFactory factory = loader.getFactory();
                super.edgeSerializer.readRelation(factory,data,tx);
                factory.build();
View Full Code Here


        }

        @Override
        public Entry next() {
            final Map.Entry<byte[], NavigableMap<Long, byte[]>> entry = iterator.next();
            return new StaticBufferEntry(new StaticByteBuffer(entry.getKey()), new StaticByteBuffer(entry.getValue().lastEntry().getValue()));
        }
View Full Code Here

        }

        @Override
        public Entry next() {
            final Map.Entry<ByteBuffer, IColumn> entry = iterator.next();
            return new StaticBufferEntry(new StaticByteBuffer(entry.getKey()), new StaticByteBuffer(entry.getValue().value()));
        }
View Full Code Here

            currentRow = keys.next();
            ByteBuffer currentKey = currentRow.key.key.duplicate();

            try {
                return new StaticByteBuffer(currentKey);
            } finally {
                lastSeenKey = currentKey;
            }
        }
View Full Code Here

            throw new RuntimeException(e);
        }
        ByteBuffer bb = ByteBuffer.allocate(b.length);
        bb.put(b);
        bb.flip();
        return new StaticByteBuffer(bb);
    }
View Full Code Here

    // TODO rename as "longToBuffer" after syntax errors are resolved
    public static StaticBuffer longToByteBuffer(long l) {
        ByteBuffer b = ByteBuffer.allocate(8).putLong(l);
        b.flip();
        return new StaticByteBuffer(b);
    }
View Full Code Here

            mostRecentRow = ksIter.next();
           
            Preconditions.checkNotNull(mostRecentRow);
           
            return new StaticByteBuffer(mostRecentRow.bufferForKey());
        }
View Full Code Here

        lower.putInt(localPartition[0]);
        upper.putInt(localPartition[1]);
        lower.rewind();
        upper.rewind();
        Preconditions.checkArgument(ByteBufferUtil.isSmallerThan(lower, upper), Arrays.toString(localPartition));
        return new StaticBuffer[]{new StaticByteBuffer(lower), new StaticByteBuffer(upper)};
    }
View Full Code Here

                    for (int s = 0; s < shiftSliceLength; s++) {
                        bb.put((byte) -1);
                    }
                    bb.put(KeyValueStoreUtil.getBuffer(j + 1).asByteBuffer());
                    bb.flip();
                    col = new StaticByteBuffer(bb);

                    // col = KeyValueStoreUtil.getBuffer(j + values[i].length +
                    // 100);
                } else {
                    col = KeyValueStoreUtil.getBuffer(j);
View Full Code Here

    public void loadLowerTriangularValues(int dimension, int offset) throws StorageException {

        Preconditions.checkArgument(0 < dimension);
        ByteBuffer val = ByteBuffer.allocate(1);
        val.put((byte) -1);
        StaticBuffer staticVal = new StaticByteBuffer(val);

        List<Entry> rowAdditions = new ArrayList<Entry>(dimension);

        for (int k = 0; k < dimension; k++) {

            rowAdditions.clear();

            ByteBuffer key = ByteBuffer.allocate(8);
            key.putInt(0);
            key.putInt(k + offset);
            key.flip();
            StaticBuffer staticKey = new StaticByteBuffer(key);

            for (int c = 0; c <= k; c++) {
                ByteBuffer col = ByteBuffer.allocate(4);
                col.putInt(c + offset);
                col.flip();
                StaticBuffer staticCol = new StaticByteBuffer(col);
                rowAdditions.add(new StaticBufferEntry(staticCol, staticVal));
            }

            store.mutate(staticKey, rowAdditions, Collections.<StaticBuffer>emptyList(), tx);
        }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.diskstorage.util.StaticByteBuffer

Copyright © 2018 www.massapicom. 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.