Package com.sleepycat.je.dbi

Examples of com.sleepycat.je.dbi.DatabaseImpl


                } else if (!mapDbOnly && !isMapDb) {
                    isTarget = true;
                }

                if (isTarget) {
                    DatabaseImpl db = dbMapTree.getDb(dbId);
                    try {
                        if (db == null) {
                            // This db has been deleted, ignore the entry.
                            counter.incNumDeleted();
                        } else {
View Full Code Here


            DbTree dbMapTree = envImpl.getDbTree();
            while (reader.readNextEntry()) {
                counter.incNumRead();
                DatabaseId dbId = reader.getDatabaseId();
                if (targetDbs.contains(dbId)) {
                    DatabaseImpl db = dbMapTree.getDb(dbId);
                    try {
                        if (db == null) {
                            /* This db has been deleted, ignore the entry. */
                            counter.incNumDeleted();
                        } else {
View Full Code Here

        /* Invoke the evictor to reduce memory consumption. */
        envImpl.invokeEvictor();

        DatabaseId dbId = reader.getDatabaseId();
        DatabaseImpl db = dbMapTree.getDb(dbId);
        /* Database may be null if it's been deleted. */
        if (db == null) {
            return;
        }
        LNLogEntry lnEntry = reader.getLNLogEntry();
View Full Code Here

                 * reduce memory consumption.
                 */
                envImpl.invokeEvictor();

                DatabaseId dbId = reader.getDatabaseId();
                DatabaseImpl db = dbMapTree.getDb(dbId);

                /*
                 * Database may be null if it's been deleted. Only redo for
                 * extant databases.
                 */
 
View Full Code Here

        Iterator<DatabaseId> iter = inListBuildDbIds.iterator();
        while (iter.hasNext()) {
            DatabaseId dbId = iter.next();
            /* We already did the map tree, don't do it again. */
            if (!dbId.equals(DbTree.ID_DB_ID)) {
                DatabaseImpl db = envImpl.getDbTree().getDb(dbId);
                try {
                    if (db != null) {
                        /* Temp DBs will be removed, skip build. */
                        if (!db.isTemporary()) {
                            db.getTree().rebuildINList();
                        }
                    }
                } finally {
                    envImpl.getDbTree().releaseDb(db);
                }
View Full Code Here

        try {
            Iterator<DatabaseId> removeDbs = tempDbIds.iterator();
            while (removeDbs.hasNext()) {
                counter.incNumRead();
                DatabaseId dbId = removeDbs.next();
                DatabaseImpl db = dbMapTree.getDb(dbId);
                dbMapTree.releaseDb(db); // Decrement use count.
                if (db != null) {
                    assert db.isTemporary();
                    if (!db.isDeleted()) {
                        try {
                            counter.incNumProcessed();
                            envImpl.getDbTree().dbRemove(locker,
                                                         db.getName(),
                                                         db.getId());
                        } catch (DatabaseNotFoundException e) {
                            throw EnvironmentFailureException.
                                unexpectedException(e);
                        }
                    } else {
View Full Code Here

            return;
        }

        final DbTree dbTree = envImpl.getDbTree();
        for (DatabaseId dbId : logVersion8UpgradeDbs) {
            final DatabaseImpl db = dbTree.getDb(dbId);
            try {
                if (db.getSortedDuplicates()) {
                    throw EnvironmentFailureException.unexpectedState
                        ("Before upgrading to JE 5.0, the following utility " +
                         "must be run using JE 4.1: " +
                         (envImpl.isReplicated() ?
                          "DbRepPreUpgrade_4_1 " : "DbPreUpgrade_4_1 ") +
View Full Code Here

     *
     * @return the summary, or null if the DB should not be tracked because
     * the file has been deleted, or null if the databaseKey param is null.
     */
    DbFileSummary getDbFileSummary(Object databaseKey, long fileNum) {
        DatabaseImpl db = (DatabaseImpl) databaseKey;
        if (db != null) {
            return db.getDbFileSummary
                (Long.valueOf(fileNum), true /*willModify*/);
        } else {
            return null;
        }
    }
View Full Code Here

        /* Add DbFileSummary information. */
        Iterator<Object> dbMapKeys = dbMap.keySet().iterator();
        while (dbMapKeys.hasNext()) {
            Object key = dbMapKeys.next();
            DatabaseImpl db = databaseKeyToDatabaseImpl(key);
            /* If db is null, it was deleted. */
            DbFileSummaryMap fileMap = dbMap.get(key);

            if (db != null) {
                Iterator<Map.Entry<Long, DbFileSummary>> fileEntries =
                    fileMap.entrySet().iterator();

                while (fileEntries.hasNext()) {
                    Map.Entry<Long, DbFileSummary> fileEntry =
                        fileEntries.next();

                    Long fileNum = fileEntry.getKey();
                    DbFileSummary dbFileSummary =
                        db.getDbFileSummary(fileNum, true /*willModify*/);
                    if (dbFileSummary != null) {
                        DbFileSummary localSummary = fileEntry.getValue();
                        dbFileSummary.add(localSummary);
                    }
                }
View Full Code Here

        super.postRecoveryConversion();

        if (needRepConvert) {
            /* Set NameDb to replicated. */
            DatabaseImpl nameDb = null;
            try {
                nameDb = dbMapTree.getDb(DbTree.NAME_DB_ID);
                if (!nameDb.isReplicated()) {
                    nameDb.setIsReplicatedBit();
                    nameDb.setDirtyUtilization();
                }
            } finally {
                if (nameDb != null) {
                    dbMapTree.releaseDb(nameDb);
                }
            }

            /* Set user defined databases to replicated. */
            Map<DatabaseId, String> idNameMap = dbMapTree.getDbNamesAndIds();
            for (DatabaseId id : idNameMap.keySet()) {
                DatabaseImpl db = null;
                try {
                    db = dbMapTree.getDb(id);
                    if (db != null &&
                        !DbTree.isReservedDbName(idNameMap.get(id))) {

                        db.setIsReplicatedBit();
                        db.setDirtyUtilization();
                    }
                } finally {
                    if (db != null) {
                        dbMapTree.releaseDb(db);
                    }
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.