Package com.sleepycat.je

Examples of com.sleepycat.je.Database.openCursor()


                System.arraycopy(bytes, 0, cursorBytes, 0, bytes.length);

                cursorData.setPartial(true);

                cursor = blocks.openCursor(txn, null);

                if (cursor.getSearchKey(cursorKey, cursorData, null) != OperationStatus.NOTFOUND) {
                    cursor.delete();
                    advance: while (cursor.getNext(cursorKey, cursorData, null) != OperationStatus.NOTFOUND) {
                        byte[] temp = cursorKey.getData();
View Full Code Here


                }
                txn.commit();
            }
        } else {
            /* retrieve the data */
            Cursor cursor = exampleDb.openCursor(null, null);

            while (cursor.getNext(keyEntry, dataEntry, LockMode.DEFAULT) ==
                   OperationStatus.SUCCESS) {
                System.out.println("key=" +
                                   IntegerBinding.entryToInt(keyEntry) +
View Full Code Here

        Database versionDb = null;
        Cursor cursor = null;
        try
        {
            versionDb = _environment.openDatabase(null, Upgrader.VERSION_DB_NAME, dbConfig);
            cursor = versionDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            while (cursor.getNext(key, value, null) == OperationStatus.SUCCESS)
            {
                int version = IntegerBinding.entryToInt(key);
View Full Code Here

        Database versionDb = null;
        Cursor cursor = null;
        try
        {
            versionDb = environment.openDatabase(null, Upgrader.VERSION_DB_NAME, dbConfig);
            cursor = versionDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            while (cursor.getNext(key, value, null) == OperationStatus.SUCCESS)
            {
                int version = IntegerBinding.entryToInt(key);
View Full Code Here

        try {
            if (verbose) {
                System.out.println("Verifying VLSN index");
            }

            cursor = db.openCursor(null, CursorConfig.READ_COMMITTED);

            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry data = new DatabaseEntry();

            /*
 
View Full Code Here

    private static void preload(Environment env, String dbName)
        throws Exception {

        System.out.println("Preload starting");
        Database db = env.openDatabase(null, dbName, null);
        Cursor cursor = db.openCursor(null, null);
        try {
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry data = new DatabaseEntry();
            int count = 0;
            while (cursor.getNext(key, data, LockMode.DEFAULT) ==
View Full Code Here

        }
        dupSort = db.getConfig().getSortedDuplicates();

        printHeader(outputFile, dupSort, formatUsingPrintable);

        Cursor cursor = db.openCursor(null, null);
        while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) ==
               OperationStatus.SUCCESS) {
            dumpOne(outputFile, foundKey.getData(), formatUsingPrintable);
            dumpOne(outputFile, foundData.getData(), formatUsingPrintable);
        }
View Full Code Here

        }

        Cursor cursor = null;
        int nWritten = 0;
        try {
            cursor = db.openCursor(txn, cursorConfig);
            OperationStatus status = cursor.getFirst(key, data, null);
            while (status == OperationStatus.SUCCESS) {
                boolean oneWritten = false;
                if (evolveNeeded(key, data, binding)) {
                    cursor.putCurrent(data);
View Full Code Here

                    cursor.close();
                    cursor = null;
                    txn.commit();
                    txn = null;
                    txn = env.beginTransaction(null, null);
                    cursor = db.openCursor(txn, cursorConfig);
                    DatabaseEntry saveKey = KeyRange.copy(key);
                    status = cursor.getSearchKeyRange(key, data, null);
                    if (status == OperationStatus.SUCCESS &&
                        KeyRange.equalBytes(key, saveKey)) {
                        status = cursor.getNext(key, data, null);
View Full Code Here

                System.arraycopy(bytes, 0, cursorBytes, 0, bytes.length);

                cursorData.setPartial(true);

                cursor = blocks.openCursor(txn, null);

                if (cursor.getSearchKey(cursorKey, cursorData, null) != OperationStatus.NOTFOUND) {
                    cursor.delete();
                    advance: while (cursor.getNext(cursorKey, cursorData, null) != OperationStatus.NOTFOUND) {
                        byte[] temp = cursorKey.getData();
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.