Package com.sleepycat.je.dbi

Examples of com.sleepycat.je.dbi.DatabaseId


        logEntry = (LNLogEntry) envImpl.getLogManager().
            getLogEntryHandleFileNotFound(undoLsn);
        ln = logEntry.getLN();
        nodeId = ln.getNodeId();
        DatabaseId dbId = logEntry.getDbId();
        db = undoDatabases.get(dbId);
        ln.postFetchInit(db, undoLsn);
       
        /* DbImpls are obtained from the txn's cache. */
        dbMapTree = null;
View Full Code Here


     */
    public UndoReader(LNFileReader reader, DbTree dbMapTree) {
        logEntry = reader.getLogEntry();
        ln = reader.getLN();
        nodeId = ln.getNodeId();
        DatabaseId dbId = logEntry.getDbId();
        this.dbMapTree = dbMapTree;
        db = dbMapTree.getDb(dbId);
        ln.postFetchInit(db, reader.getLastLsn());
    }
View Full Code Here

    /**
     * Create an empty NameLN, to be filled in from the log.
     */
    public NameLN() {
        super();
        id = new DatabaseId();
    }
View Full Code Here

                              long logAbortLsn,
                              boolean logAbortKnownDeleted,
                              Txn logTxn,
                              ReplicationContext repContext) {

        DatabaseId dbId = dbImpl.getId();
        boolean isDelDup = (delDupKey != null);
        if (isDelDup) {

            /*
             * Deleted Duplicate LNs are logged with two keys -- the one
View Full Code Here

             * Disallow eviction of the mapping and naming DB roots, because
             * the use count is not incremented for these DBs.  In addition,
             * their eviction and re-fetching is a special case that is not
             * worth supporting.  [#13415]
             */
            DatabaseId dbId = databaseImpl.getId();
            if (dbId.equals(DbTree.ID_DB_ID) ||
                dbId.equals(DbTree.NAME_DB_ID)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

        /* If this is a targetted entry, read the entire log entry. */
        if (targetLogEntry != null) {
            targetLogEntry.readEntry(entryBuffer, currentEntrySize,
                                     currentEntryTypeVersion, true);
      DatabaseId dbId = getDatabaseId();
      boolean isMapDb = dbId.equals(DbTree.ID_DB_ID);
            useEntry = (!mapDbOnly || isMapDb);
            entryLoaded = true;
        }
       
        /* Do a partial load during tracking if necessary. */
 
View Full Code Here

                ln = (LN) logClass.newInstance();
                ln.readFromLog(entryBuffer, entryTypeVersion);
                nodeId = ln.getNodeId();

                /* DatabaseImpl Id */
                dbId = new DatabaseId();
                dbId.readFromLog(entryBuffer, entryTypeVersion);

                /* Key */
                key = LogUtils.readByteArray(entryBuffer);

View Full Code Here

                        nLNsObsoleteThisRun++;
                    } else if (isIN) {
                        nINsObsoleteThisRun++;
                    }
                    /* Must update the pending DB set for obsolete entries. */
                    DatabaseId dbId = reader.getDatabaseId();
                    if (dbId != null) {
                        checkPendingDbSet.add(dbId);
                    }
                    continue;
                }

                /* Evict before processing each entry. */
                if (Cleaner.DO_CRITICAL_EVICTION) {
                    env.getEvictor().doCriticalEviction();
                }

                /* The entry is not known to be obsolete -- process it now. */
                if (isLN) {

                    LN targetLN = reader.getLN();
                    DatabaseId dbId = reader.getDatabaseId();
                    byte[] key = reader.getKey();
                    byte[] dupKey = reader.getDupTreeKey();

                    lookAheadCache.add
                        (new Long(DbLsn.getFileOffset(lsn)),
                         new LNInfo(targetLN, dbId, key, dupKey));

                    if (lookAheadCache.isFull()) {
                        processLN(fileNum, location, lookAheadCache, dbCache);
                    }

                    /*
                     * Process pending LNs before proceeding in order to
                     * prevent the pending list from growing too large.
                     */
                    nProcessedLNs += 1;
                    if (nProcessedLNs % PROCESS_PENDING_EVERY_N_LNS == 0) {
                        cleaner.processPending();
                    }

                } else if (isIN) {

                    IN targetIN = reader.getIN();
                    DatabaseId dbId = reader.getDatabaseId();
                    DatabaseImpl db = dbMapTree.getDb
                        (dbId, cleaner.lockTimeout, dbCache);
                    targetIN.setDatabase(db);
                   
                    processIN(targetIN, db, lsn);
                   
                } else if (isRoot) {
                   
                    env.rewriteMapTreeRoot(lsn);
                } else {
                    assert false;
                }
            }

            /* Process remaining queued LNs. */
            while (!lookAheadCache.isEmpty()) {
                if (Cleaner.DO_CRITICAL_EVICTION) {
                    env.getEvictor().doCriticalEviction();
                }
                processLN(fileNum, location, lookAheadCache, dbCache);
            }

            /* Update the pending DB set. */
            for (Iterator i = checkPendingDbSet.iterator(); i.hasNext();) {
                DatabaseId dbId = (DatabaseId) i.next();
                DatabaseImpl db = dbMapTree.getDb
                    (dbId, cleaner.lockTimeout, dbCache);
                cleaner.addPendingDB(db);
            }

View Full Code Here

            /*
       * Process every IN, INDeleteInfo, and INDupDeleteInfo in the
       * 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

             * Read all non-provisional INs, and process if they don't belong
             * to the mapping tree.
             */
            DbTree dbMapTree = env.getDbMapTree();
            while (reader.readNextEntry()) {
                DatabaseId dbId = reader.getDatabaseId();
                boolean isMapDb = dbId.equals(DbTree.ID_DB_ID);
                boolean isTarget = false;

                if (mapDbOnly && isMapDb) {
                    isTarget = true;
                } else if (!mapDbOnly && !isMapDb) {
View Full Code Here

TOP

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

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.