Package xbird.storage.index

Examples of xbird.storage.index.Value


    protected IndexQuery getIndexCond() {
        final IndexQuery idxCond;
        final byte[] query = _query;
        final int percentidx = ArrayUtils.indexOf(query, RevPathCoder.PERCENT_CODE, 0);
        if(percentidx < 0) {
            final Value key = new Value(query);
            idxCond = new BasicIndexQuery.IndexConditionEQ(key);
        } else {
            final byte[] keyStr = ArrayUtils.copyOfRange(query, 0, percentidx);
            final byte[] filter = ArrayUtils.copyOfRange(query, percentidx, query.length);
            final Value key = new Value(keyStr);
            idxCond = new ByteLikeIndexQuery(key, filter, RevPathCoder.PERCENT_CODE);
        }
        return idxCond;
    }
View Full Code Here


    private static final Value calculateRightEdgeValue(Value v) {
        byte[] b = new byte[v.getLength() + 1];
        System.arraycopy(v.getData(), v.getPosition(), b, 0, b.length - 1);
        b[b.length - 1] = Byte.MAX_VALUE;
        Value v2 = new Value(b);
        return v2;
    }
View Full Code Here

    private static final Value calculateRightEdgeValue(Value v) {
        byte[] b = new byte[v.getLength() + 1];
        System.arraycopy(v.getData(), v.getPosition(), b, 0, b.length - 1);
        b[b.length - 1] = Byte.MAX_VALUE;
        Value v2 = new Value(b);
        return v2;
    }
View Full Code Here

            this.btree = tree;
        }

        public void addRecord(long idx, long addr) throws IOException {
            try {
                btree.addValue(new Value(idx), addr);
            } catch (DbException e) {
                throw new IOException("failed to add a record addr#" + addr + " to the idx#" + idx);
            }
        }
View Full Code Here

            }
        }

        public long getRecordAddr(long idx) throws IOException {
            try {
                return btree.findValue(new Value(idx));
            } catch (DbException e) {
                throw new IOException("failed to get a record of idx#" + idx);
            }
        }
View Full Code Here

    protected IndexQuery getIndexCond() {
        final IndexQuery idxCond;
        final byte[] query = _query;
        final int percentidx = ArrayUtils.indexOf(query, RevPathCoder.PERCENT_CODE, 0);
        if(percentidx < 0) {
            final Value key = new Value(query);
            idxCond = new BasicIndexQuery.IndexConditionEQ(key);
        } else {
            final byte[] keyStr = ArrayUtils.copyOfRange(query, 0, percentidx);
            final byte[] filter = ArrayUtils.copyOfRange(query, percentidx, query.length);
            final Value key = new Value(keyStr);
            idxCond = new ByteLikeIndexQuery(key, filter, RevPathCoder.PERCENT_CODE);
        }
        return idxCond;
    }
View Full Code Here

TOP

Related Classes of xbird.storage.index.Value

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.