Package com.sleepycat.je

Examples of com.sleepycat.je.CheckpointConfig


            IntegerBinding.intToEntry(i*10, data);
            assertEquals(OperationStatus.SUCCESS, db.put(null, key, data));
        }


        CheckpointConfig ckptConfig = new CheckpointConfig();
        ckptConfig.setForce(true);
        env.checkpoint(ckptConfig);


        /* Add enough keys to split the left hand branch again. */
        for (int i = 50; i < 100; i+=2) {
View Full Code Here


    private void addData(Database db)
        throws DatabaseException {

  DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(db);
        EnvironmentImpl envImpl = DbInternal.envGetEnvironmentImpl(env);
        CheckpointConfig ckptConfig = new CheckpointConfig();
        ckptConfig.setForce(true);

  /*
   * Create a one element dup tree by making a dupe and then reducing it
   * back to one element.
   */
 
View Full Code Here

            /*
       * From the last checkpoint start LSN, there should be the
       * checkpoint end log entry and a trace message. These take 196
       * bytes.
             */
            CheckpointConfig checkpointConfig = new CheckpointConfig();

            /* Should not cause a checkpoint, too little growth. */
            checkpointConfig.setKBytes(1);
            env.checkpoint(checkpointConfig);
            stats = env.getStats(statsConfig)// read again
            assertEquals(0, stats.getNCheckpoints());

            /* Fill up the log, there should be a checkpoint. */
            String filler = "123456789012345678901245678901234567890123456789";
            EnvironmentImpl envImpl = DbInternal.envGetEnvironmentImpl(env);
            for (int i = 0; i < 20; i++) {
                Tracer.trace(Level.SEVERE, envImpl, filler);
            }
            env.checkpoint(checkpointConfig);
            stats = env.getStats(statsConfig)// read again
            assertEquals(1, stats.getNCheckpoints());

            /* Try time based, should not checkpoint. */
            checkpointConfig.setKBytes(0);
            checkpointConfig.setMinutes(1);
            env.checkpoint(checkpointConfig);
            stats = env.getStats(statsConfig)// read again
            assertEquals(0, stats.getNCheckpoints());

            /*
 
View Full Code Here

            IntegerBinding.intToEntry(i, key);
            IntegerBinding.intToEntry(i, data);
            assertEquals(OperationStatus.SUCCESS, db.put(null, key, data));
        }

        CheckpointConfig ckptConfig = new CheckpointConfig();
        ckptConfig.setForce(true);
        env.checkpoint(ckptConfig);

        Tree tree = DbInternal.dbGetDatabaseImpl(db).getTree();
        com.sleepycat.je.tree.Key.DUMP_INT_BINDING = true;
        if (DEBUG) {
View Full Code Here

            oldSize = newSize;
            newSize = TestUtils.validateNodeMemUsage(envImpl, true);
            assertTrue(newSize < oldSize);

            /* Checkpoint */
            CheckpointConfig ckptConfig = new CheckpointConfig();
            ckptConfig.setForce(true);
            env.checkpoint(ckptConfig);
            oldSize = newSize;
            newSize = TestUtils.validateNodeMemUsage(envImpl, true);
            assertEquals(oldSize, newSize);

View Full Code Here

                status = db.delete(null, key);
                assertEquals(OperationStatus.SUCCESS, status);
            }
        }

        CheckpointConfig config = new CheckpointConfig();
        config.setForce(true);
        env.checkpoint(config);
    }
View Full Code Here

        cursor.close();
        env.compress();
        checkBinEntriesAndCursors(bin, 3, 0);

        /* Checkpoint to preserve internal nodes through recovery. */
        CheckpointConfig config = new CheckpointConfig();
        config.setForce(true);
        env.checkpoint(config);

        /* Abort without calling compress does not compress. */
        txn.abort();
        checkBinEntriesAndCursors(bin, 3, 0);
View Full Code Here

        env.compress();
        checkBinEntriesAndCursors(bin, 2, 0);
        checkBinEntriesAndCursors(dbin, 3, 0);

        /* Checkpoint to preserve internal nodes through recovery. */
        CheckpointConfig config = new CheckpointConfig();
        config.setForce(true);
        env.checkpoint(config);

        /* Abort without calling compress does not compress. */
        txn.abort();
        checkBinEntriesAndCursors(bin, 2, 0);
View Full Code Here

        /* Non-transactional no-dups, 2 keys. */
        openAndInit(false, false);
        OperationStatus status;

        /* Checkpoint to preserve internal nodes through recovery. */
        CheckpointConfig config = new CheckpointConfig();
        config.setForce(true);
        env.checkpoint(config);

        /* Cursor appears on BIN. */
        Cursor cursor = db.openCursor(null, null);
        status = cursor.getFirst(keyFound, dataFound, null);
View Full Code Here

        /* Non-transactional dups, 2 keys and 2 dups for 1st key. */
        openAndInit(false, true);
        OperationStatus status;

        /* Checkpoint to preserve internal nodes through recovery. */
        CheckpointConfig config = new CheckpointConfig();
        config.setForce(true);
        env.checkpoint(config);

        /* Cursor appears on DBIN. */
        Cursor cursor = db.openCursor(null, null);
        status = cursor.getFirst(keyFound, dataFound, null);
View Full Code Here

TOP

Related Classes of com.sleepycat.je.CheckpointConfig

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.