Package org.chaidb.db.api

Examples of org.chaidb.db.api.DuplicatedKeyIterator


            throw new ChaiDBException(ErrorCode.BTREE_DEBUG, "the value is invalid , maybe null or not node id type.");
        }
        this.getBTreeSpec().setModified(true);
        NodeId nodeid = (NodeId) value;
        NodeId tmpId = null;
        DuplicatedKeyIterator dki = lookup(key, kContext);
        try {
            while (dki.hasNext()) {
                tmpId = (NodeId) dki.next();
                if (tmpId.equals(nodeid)) {
                    dki.remove();
                    return true;
                }
            } //end while
        } finally {
            dki.close();
        }
        return false;
    }
View Full Code Here


    public int delete(Key key, int docId, KernelContext kContext) throws ChaiDBException {

        kContext.checkLock(getBTreeName());
        this.getBTreeSpec().setModified(true);
        int ret = 0;
        DuplicatedKeyIterator dki = lookup(key, kContext);
        try {
            while (dki.hasNext()) {
                NodeId nodeid = (NodeId) dki.next();
                if (nodeid.getDocId() == docId) {
                    dki.remove();
                    ret++;
                }
            } //end while
        } finally {
            dki.close();
        }
        return ret;
    }
View Full Code Here

    public ArrayList rangeLookup(Key minKey, Key maxKey, boolean includeMinKey, boolean includeMaxKey, KernelContext kContext) throws ChaiDBException {
        kContext.checkLock(getBTreeName());
        ArrayList keys = rangeLookupKeys(minKey, maxKey, includeMinKey, includeMaxKey, kContext);
        try {
            ArrayList newList = new ArrayList(keys.size());
            DuplicatedKeyIterator it = null;
            Key key;
            for (int i = 0; i < keys.size(); i++) {
                key = (Key) keys.get(i);
                it = lookup(key, kContext);
                newList.add(it);
View Full Code Here

TOP

Related Classes of org.chaidb.db.api.DuplicatedKeyIterator

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.