Package com.thinkaurelius.titan.diskstorage.util

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


                List<Entry> entries = new ArrayList<Entry>(result.size());
                Map<byte[], byte[]> fmap = result.getFamilyMap(columnFamilyBytes);

                if (null != fmap) {
                    for (Map.Entry<byte[], byte[]> ent : fmap.entrySet()) {
                        entries.add(StaticBufferEntry.of(new StaticArrayBuffer(ent.getKey()), new StaticArrayBuffer(ent.getValue())));
                    }
                }

                results.add(entries);
            }
View Full Code Here


                public boolean apply(@Nullable Result result) {
                    if (result == null)
                        return false;

                    try {
                        StaticBuffer id = new StaticArrayBuffer(result.getRow());
                        id.getLong(0);
                    } catch (NumberFormatException e) {
                        return false;
                    }

                    return true;
View Full Code Here

                @Override
                public Entry next() {
                    ensureOpen();
                    Map.Entry<byte[], byte[]> column = kv.next();
                    return StaticBufferEntry.of(new StaticArrayBuffer(column.getKey()), new StaticArrayBuffer(column.getValue()));
                }

                @Override
                public void close() {
                    isClosed = true;
View Full Code Here

        @Override
        public StaticBuffer next() {
            ensureOpen();

            currentRow = rows.next();
            return new StaticArrayBuffer(currentRow.getRow());
        }
View Full Code Here

            throw new PermanentStorageException(e);
        }
    }

    private static StaticBuffer getBuffer(DatabaseEntry entry) {
        return new StaticArrayBuffer(entry.getData(),entry.getOffset(),entry.getOffset()+entry.getSize());
    }
View Full Code Here

    private static StaticBuffer getPrefixed(int prefix) {
        assert prefix < (1 << PREFIX_BIT_LEN) && prefix >= 0;
        byte[] arr = new byte[1];
        arr[0] = (byte) (prefix << (Byte.SIZE - PREFIX_BIT_LEN));
        return new StaticArrayBuffer(arr);
    }
View Full Code Here

@todo: implement exchange pool
*/
public class PersistitKeyValueStore implements OrderedKeyValueStore {

    private static StaticBuffer getBuffer(byte[] bytes) {
        return new StaticArrayBuffer(bytes, 0, bytes.length);
    }
View Full Code Here

        exchange.store();
    }

    static StaticBuffer getValue(Exchange exchange) {
        byte[] dst = exchange.getValue().getByteArray();
        return new StaticArrayBuffer(dst, 0, dst.length);
    }
View Full Code Here

                    if (b == 0) carry = true;
                    plusOne[j][i] = b;
                }
            }

            StaticBuffer lb = new StaticArrayBuffer(plusOne[0]);
            StaticBuffer rb = new StaticArrayBuffer(plusOne[1]);
            Preconditions.checkArgument(lb.length() == tokenLength, lb.length());
            Preconditions.checkArgument(rb.length() == tokenLength, rb.length());

            return new StaticBuffer[]{lb, rb};
        } else {
            throw new UnsupportedOperationException();
        }
View Full Code Here

        byte[] value = output.getBuffer();
        int limit = output.position();
        Preconditions.checkArgument(from>=0 && from<=to);
        Preconditions.checkArgument(to<=limit);
        for (int i=from;i<to;i++) value[i] = (byte)~value[i];
        return new StaticArrayBuffer(value,0,limit);
    }
View Full Code Here

TOP

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

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.