Package com.sleepycat.je.tree

Examples of com.sleepycat.je.tree.MapLN


        /*
         * For temporary DBs that are encountered as MapLNs, add them to the
         * set of databases to be removed.
         */
        MapLN mapLN = null;
        if (ln instanceof MapLN) {
            mapLN = (MapLN) ln;
            if (mapLN.getDatabase().isTemporary()) {
                tempDbIds.add(mapLN.getDatabase().getId());
            }
        }

        /*
         * For deleted MapLNs (truncated or removed DBs), redo utilization
         * counting by counting the entire database as obsolete.
         */
        if (mapLN != null && mapLN.isDeleted()) {
            mapLN.getDatabase().countObsoleteDb(tracker, logLsn);
        }
        return treeLsn;
    }
View Full Code Here


                public boolean withCursor(CursorImpl cursor,
                                          DatabaseEntry key,
                                          DatabaseEntry data)
                    throws DatabaseException {

                    MapLN mapLN = (MapLN) cursor.getCurrentLN(LockType.NONE);
                    if (mapLN != null) {
                        DatabaseImpl db = mapLN.getDatabase();
                        if (logManager.removeDbFileSummaries(db, fileNums)) {

                            /*
                             * Because we're using dirty-read, silently do
                             * nothing if the DB does not exist
View Full Code Here

     */
    private synchronized void saveMapLNsToFlush(IN in) {
        if (in instanceof BIN &&
            in.getDatabase().getId().equals(DbTree.ID_DB_ID)) {
            for (int i = 0; i < in.getNEntries(); i += 1) {
                final MapLN ln = (MapLN) in.getTarget(i);
                if (ln != null && ln.getDatabase().isCheckpointNeeded()) {
                    mapLNsToFlush.add(ln.getDatabase().getId());
                }
            }
        }
    }
View Full Code Here

            writeAndRead(buffer, dbTree, dbTreeFromLog);

            /*
             * MapLN
             */
            MapLN mapLn = new MapLN(database);
            MapLN mapLnFromLog = new MapLN();
            writeAndRead(buffer, mapLn, mapLnFromLog);

            /*
             * UserTxn
             */
 
View Full Code Here

    lnEntry = dbIdTrackingEntry;
    lnEntry.readEntry(entryBuffer, currentEntrySize,
          currentEntryTypeVersion,
          true /* full load */);
    entryLoaded = true;
                MapLN mapLN = (MapLN) lnEntry.getMainItem();
                int dbId = mapLN.getDatabase().getId().getId();
                if (dbId > maxDbId) {
                    maxDbId = dbId;
                }
            }
            if (txnIdTrackingEntry != null) {
View Full Code Here

            /* Insert it into id -> name db, in auto commit mode. */
            autoTxn = new AutoTxn(envImpl, new TransactionConfig());
            idCursor = new CursorImpl(idDatabase, autoTxn);
            idCursor.setAllowEviction(allowEviction);
            idCursor.putLN(newId.getBytes(), new MapLN(newDb), false);
            operationOk = true;
  } catch (UnsupportedEncodingException UEE) {
      throw new DatabaseException(UEE);
        } finally {
            if (idCursor != null) {
View Full Code Here

            CursorImpl cursor = new CursorImpl(idDatabase, locker);
            boolean operationOk = false;
            try {
                DatabaseEntry keyDbt =
        new DatabaseEntry(db.getId().getBytes());
    MapLN mapLN = null;

    /*
     * Retry indefinitely in the face of lock timeouts since the
     * lock on the MapLN is only supposed to be held for short
     * periods.
     */
    while (true) {
        try {
      boolean searchOk = (cursor.searchAndPosition
              (keyDbt, new DatabaseEntry(),
               SearchMode.SET, LockType.WRITE) &
              CursorImpl.FOUND) != 0;
      if (!searchOk) {
                            throw new DatabaseException(
                                "can't find database " + db.getId());
                        }
      mapLN = (MapLN)
          cursor.getCurrentLNAlreadyLatched(LockType.WRITE);
                        assert mapLN != null; /* Should be locked. */
        } catch (DeadlockException DE) {
      cursor.close();
      locker.operationEnd(false);
      locker = new AutoTxn(envImpl, new TransactionConfig());
      cursor = new CursorImpl(idDatabase, locker);
      continue;
        } finally {
      cursor.releaseBINs();
        }
        break;
    }

    RewriteMapLN writeMapLN = new RewriteMapLN(cursor);
    mapLN.getDatabase().getTree().withRootLatched(writeMapLN);

                operationOk = true;
            } finally {
                if (cursor != null) {
                    cursor.close();
View Full Code Here

                boolean operationOk = false;
                try {
                    autoTxn = new AutoTxn(envImpl, new TransactionConfig());
                    idCursor = new CursorImpl(idDatabase, autoTxn);
                    idCursor.putLN(newId.getBytes(),
                                   new MapLN(newDb), false);
                    operationOk = true;
                } finally {
                    if (idCursor != null) {
                        idCursor.close();
                    }
View Full Code Here

            AutoTxn autoTxn = null;
            try {
                autoTxn = new AutoTxn(envImpl, new TransactionConfig());
                idCursor = new CursorImpl(idDatabase, autoTxn);
                idCursor.putLN(newId.getBytes(),
             new MapLN(newDb), false);
                operationOk = true;
            } finally {
                if (idCursor != null) {
                    idCursor.close();
                }
View Full Code Here

      (idCursor.searchAndPosition
       (keyDbt, new DatabaseEntry(), SearchMode.SET,
        LockType.READ) &
       CursorImpl.FOUND) != 0;
        if (found) {
      MapLN mapLN = (MapLN)
          idCursor.getCurrentLNAlreadyLatched(LockType.READ);
                        assert mapLN != null; /* Should be locked. */
                        foundDbImpl =  mapLN.getDatabase();
                    }
                    break;
    } catch (DeadlockException DE) {
        idCursor.close();
        locker.operationEnd(false);
View Full Code Here

TOP

Related Classes of com.sleepycat.je.tree.MapLN

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.