Package com.sleepycat.je

Examples of com.sleepycat.je.Environment.checkpoint()


            } while(cleaned > 0);
            if(cleaned > 0)
                System.out.println("Cleaned " + cleaned + " files.");
            CheckpointConfig cp = new CheckpointConfig();
            cp.setForce(true);
            environment.checkpoint(null);
            environment.compress();
            environment.sync();
            System.out.println("Cleaning, Checkpointing and compression completed.");
        }
View Full Code Here


                    System.out.println("Files cleaned: " + nFiles);
                    if (nFiles == 0) {
                        break;
                    }
                }
                env.checkpoint(forceConfig);
                break;
            case COMPRESS:
                env.compress();
                break;
            case CHECKPOINT:
View Full Code Here

                break;
            case COMPRESS:
                env.compress();
                break;
            case CHECKPOINT:
                env.checkpoint(forceConfig);
                break;
            case EVICT:
                preload(env, dbName);
                break;
            case REMOVEDB:
View Full Code Here

                    System.out.println("Files cleaned: " + nFiles);
                    if (nFiles == 0) {
                        break;
                    }
                }
                env.checkpoint(forceConfig);
                break;
            case COMPRESS:
                env.compress();
                break;
            case EVICT:
View Full Code Here

                break;
            case EVICT:
                preload(env, dbName);
                break;
            case CHECKPOINT:
                env.checkpoint(forceConfig);
                break;
            case REMOVEDB:
                env.removeDatabase(null, dbName);
                break;
            case DBSTATS:
View Full Code Here

             */
            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";
View Full Code Here

            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);
View Full Code Here

            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());

            /*
       * Sleep, enough time has passed for a checkpoint, but nothing was
View Full Code Here

            /*
       * Sleep, enough time has passed for a checkpoint, but nothing was
       * written to the log.
             */
            Thread.sleep(1000);
            env.checkpoint(checkpointConfig);
            stats = env.getStats(statsConfig)// read again
            assertEquals(0, stats.getNCheckpoints());

            /* Log something, now try a checkpoint. */
            Tracer.trace(Level.SEVERE,  envImpl, filler);
View Full Code Here

            stats = env.getStats(statsConfig)// read again
            assertEquals(0, stats.getNCheckpoints());

            /* Log something, now try a checkpoint. */
            Tracer.trace(Level.SEVERE,  envImpl, filler);
            env.checkpoint(checkpointConfig);
            stats = env.getStats(statsConfig)// read again
            // TODO: make this test more timing independent. Sometimes
            // the assertion will fail.
            // assertEquals(1, stats.getNCheckpoints());
                       
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.