Package com.sleepycat.je

Examples of com.sleepycat.je.VerifyConfig


     */
    public boolean verify(PrintStream out)
        throws DatabaseException {

        boolean ret = true;
        VerifyConfig verifyConfig = new VerifyConfig();
        verifyConfig.setPrintInfo(!quiet);
        if (progressInterval > 0) {
            verifyConfig.setShowProgressInterval(progressInterval);
            verifyConfig.setShowProgressStream(out);
        }

        EnvironmentImpl envImpl = DbInternal.getEnvironmentImpl(env);

        /* If no database is specified, verify all. */
 
View Full Code Here


      tester1.start();
      tester2.start();
      tester1.finishTest();
      tester2.finishTest();
      DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(exampleDb);
      assertTrue(dbImpl.verify(new VerifyConfig(), dbImpl.getEmptyStats()));
  } catch (Throwable T) {
      fail("testDuplicateDeadlock caught: " + T);
  }
    }
View Full Code Here

    public boolean verify(PrintStream out)
  throws DatabaseException {

  boolean ret = true;
  try {
            VerifyConfig verifyConfig = new VerifyConfig();
            verifyConfig.setPrintInfo(!quiet);
            if (progressInterval > 0) {
                verifyConfig.setShowProgressInterval(progressInterval);
                verifyConfig.setShowProgressStream(out);
            }

      openEnv();
            EnvironmentImpl envImpl = DbInternal.envGetEnvironmentImpl(env);
            Tracer.trace(Level.INFO, envImpl,
                         "DbVerify.verify of " + dbName + " starting");

            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setReadOnly(true);
            dbConfig.setAllowCreate(false);
            DbInternal.setUseExistingConfig(dbConfig, true);
            Database db = env.openDatabase(null, dbName, dbConfig);

            try {
                /* Use DatabaseImpl.verify so we can get a status return. */
                DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(db);
                DatabaseStats stats = dbImpl.getEmptyStats();
                ret = dbImpl.verify(verifyConfig, stats);
                if (verifyConfig.getPrintInfo()) {
                    out.println(stats);
                }
            } finally {
                if (db != null) {
                    db.close();
View Full Code Here

        throws DatabaseException {

        for (int i = 0; i < NUM_DBS; i++) {
            /* Run verify */
            DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(dbs[i]);
            assertTrue(dbImpl.verify(new VerifyConfig(),
                                      dbImpl.getEmptyStats()));

            Cursor verifyCursor =
    dbs[i].openCursor(null, CursorConfig.READ_UNCOMMITTED);
            DatabaseEntry key = new DatabaseEntry();
View Full Code Here

    /* Throw assertion if the database is not valid. */
    protected void validateDatabase()
        throws DatabaseException {

        DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(exampleDb);
        assertTrue(dbImpl.verify(new VerifyConfig(), dbImpl.getEmptyStats()));
    }
View Full Code Here

            cursor.close();
        }

        db.close();
       
        assertTrue(env.verify(new VerifyConfig(), System.out));
        env.close();
    }
View Full Code Here

    private void doTest(String jeVersion)
        throws DatabaseException, IOException {

        openEnv(jeVersion, true /*readOnly*/);

        VerifyConfig verifyConfig = new VerifyConfig();
        verifyConfig.setAggressive(true);
        assertTrue(env.verify(verifyConfig, System.err));

        DatabaseEntry key = new DatabaseEntry();
        DatabaseEntry data = new DatabaseEntry();
        OperationStatus status;
View Full Code Here

        /*
         * Note that verify will attempt to continue past errors, so
         * assertTrue on the status return.
         */
        assertTrue(env.verify(new VerifyConfig(), System.err));
  DatabaseStats stats = db.verify(new VerifyConfig());
  BtreeStats btStats = (BtreeStats) stats;

  assertTrue(btStats.getInternalNodeCount() <
       btStats.getBottomInternalNodeCount());
  assertTrue(btStats.getBottomInternalNodeCount() <
View Full Code Here

    public boolean verify(PrintStream out)
  throws DatabaseException {

  boolean ret = true;
  try {
            VerifyConfig verifyConfig = new VerifyConfig();
            verifyConfig.setPrintInfo(!quiet);
            if (progressInterval > 0) {
                verifyConfig.setShowProgressInterval(progressInterval);
                verifyConfig.setShowProgressStream(out);
            }

      openEnv();
            EnvironmentImpl envImpl = DbInternal.envGetEnvironmentImpl(env);
            Tracer.trace(Level.INFO, envImpl,
                         "DbVerify.verify of " + dbName + " starting");

            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setReadOnly(true);
            dbConfig.setAllowCreate(false);
            DbInternal.setUseExistingConfig(dbConfig, true);
            Database db = env.openDatabase(null, dbName, dbConfig);

            try {
                if (checkLsns) {
                    System.out.println("Checking obsolete offsets ...");
                    VerifyUtils.checkLsns(db);
                } else {
                    /* Use DatabaseImpl.verify so we can get a status
                    return. */
                    DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(db);
                    DatabaseStats stats = dbImpl.getEmptyStats();
                    ret = dbImpl.verify(verifyConfig, stats);
                    if (verifyConfig.getPrintInfo()) {
                        out.println(stats);
                    }
                }
            } finally {
                if (db != null) {
View Full Code Here

     */
    public boolean verify(PrintStream out)
        throws DatabaseException {

        boolean ret = true;
        VerifyConfig verifyConfig = new VerifyConfig();
        verifyConfig.setPrintInfo(!quiet);
        if (progressInterval > 0) {
            verifyConfig.setShowProgressInterval(progressInterval);
            verifyConfig.setShowProgressStream(out);
        }

        EnvironmentImpl envImpl = DbInternal.getEnvironmentImpl(env);

        /* If no database is specified, verify all. */
 
View Full Code Here

TOP

Related Classes of com.sleepycat.je.VerifyConfig

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.