Package com.sleepycat.je.dbi

Examples of com.sleepycat.je.dbi.DatabaseImpl


        Locker autoTxn = null;
        boolean operationOk = false;
        try {
            /* This method is used during eviction -- don't recurse. */
            autoTxn = new AutoTxn(env, new TransactionConfig());
            DatabaseImpl db = dbTree.getDb
                (autoTxn, DbTree.UTILIZATION_DB_NAME, null,
                 false /* No eviction allowed. */);
            if (db == null) {
                if (env.isReadOnly()) {
                    return false;
View Full Code Here


            return true;
        }
       
        /* Find the owning database. */
        DatabaseId dbId = entry.getDbId();
        DatabaseImpl db = env.getDbMapTree().getDb(dbId);

        /* The whole database is gone, so this LN is obsolete. */
        if (db == null || db.getIsDeleted()) {
            return true;
        }

        /*
         * Search down to the bottom most level for the parent of this LN.
         */
        BIN bin = null;
        try {
            Tree tree = db.getTree();
            TreeLocation location = new TreeLocation();
            boolean parentFound = tree.getParentBINForChildLN
                (location,
                 entry.getKey(),
                 entry.getDupKey(),
View Full Code Here

     */
    public MapLN()
        throws DatabaseException {

        super();
        databaseImpl = new DatabaseImpl();
    }
View Full Code Here

        dbIdToName.put(dbId, name);
    }
      }

      if (ln instanceof MapLN) {
    DatabaseImpl db = ((MapLN) ln).getDatabase();
    Integer dbId = new Integer(db.getId().getId());
    Boolean dupSort = Boolean.valueOf(db.getSortedDuplicates());
    if (dbIdToDupSort.containsKey(dbId)) {
        throw new DatabaseException
      ("Already saw dupSort entry for dbId: " + dbId);
    } else {
        dbIdToDupSort.put(dbId, dupSort);
View Full Code Here

                 * abortLsn, so we don't need to undo it multiple times.
                 */
                if (!alreadyUndone.contains(nodeId)) {
                    alreadyUndone.add(nodeId);
                    DatabaseId dbId = undoEntry.getDbId();
                    DatabaseImpl db = (DatabaseImpl) undoDatabases.get(dbId);
                    undoLN.postFetchInit(db, undoLsn);
                    long abortLsn = undoEntry.getAbortLsn();
                    boolean abortKnownDeleted =
                        undoEntry.getAbortKnownDeleted();
                    try {
View Full Code Here

        if (deletedDatabases != null) {
            Iterator iter = deletedDatabases.iterator();
            while (iter.hasNext()) {
                DatabaseCleanupInfo info = (DatabaseCleanupInfo) iter.next();
                if (info.deleteAtCommit == isCommit) {
                    DatabaseImpl dbImpl = info.dbImpl;
                    if (!isCommit) {

                        /*
                         * recordObsoleteNodes() is usually called in the
                         * database operation itself on a to-be-deleted
                         * database, but we'll need to call it here on a "new"
                         * database if we're cleaning up after an abort.
                         */
                        dbImpl.recordObsoleteNodes();
                    }
                    dbImpl.deleteAndReleaseINs();
                }
            }
            deletedDatabases = null;
        }
    }
View Full Code Here

        while (scanned < nodesPerScan) {
            if (scanIter.hasNext()) {
                IN in = scanIter.next();
                nNodesScannedThisRun++;

                DatabaseImpl db = in.getDatabase();

                /* If the database was deleted, remove it from the inlist. */
                if (db == null || db.getIsDeleted()) {
                    scanIter.remove();
                    continue;
                }

                /*
                 * Don't evict the DatabaseImpl Id Mapping Tree (db 0), both
                 * for object identity reasons and because the id mapping tree
                 * should stay cached.
                 */
                if (db.getId().equals(DbTree.ID_DB_ID)) {
                    continue;
                }

                /*
                 * If this is a read only database and we have at least one
View Full Code Here

       * mapping tree.
       */
            while (reader.readNextEntry()) {
                DatabaseId dbId = reader.getDatabaseId();
                if (dbId.equals(DbTree.ID_DB_ID)) {
                    DatabaseImpl db = dbMapTree.getDb(dbId);
                    replayOneIN(reader, db, false);
                    info.numMapINs++;
                }
            }

View Full Code Here

                    isTarget = true;
                } else if (!mapDbOnly && !isMapDb) {
                    isTarget = true;
                }
                if (isTarget) {
                    DatabaseImpl db = dbMapTree.getDb(dbId);
                    if (db == null) {
                        // This db has been deleted, ignore the entry.
                    } else {
                        replayOneIN(reader, db, requireExactMatch);
                        numINsSeen++;
View Full Code Here

      long logLsn = reader.getLastLsn();
      long abortLsn = reader.getAbortLsn();
      boolean abortKnownDeleted =
          reader.getAbortKnownDeleted();
      DatabaseId dbId = reader.getDatabaseId();
      DatabaseImpl db = dbMapTree.getDb(dbId);
                       
      /* Database may be null if it's been deleted. */
      if (db != null) {
          ln.postFetchInit(db, logLsn);
          try {
View Full Code Here

TOP

Related Classes of com.sleepycat.je.dbi.DatabaseImpl

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.