Package com.sleepycat.je.dbi

Examples of com.sleepycat.je.dbi.DatabaseId


                 * node. All log entries for a given node have the same
                 * 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();
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

            ln.readFromLog(entryBuffer, logVersion);
            nodeId = ln.getNodeId();
        }

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

        /* Key. */
        if (unpacked) {
            key = LogUtils.readByteArray(entryBuffer, true/*unpacked*/);
 
View Full Code Here

                                                                version);
                if (operationType == DbOperationType.CREATE) {
                    replicatedCreateConfig = new ReplicatedDatabaseConfig();
                    replicatedCreateConfig.readFromLog(entryBuffer, version);
                } else if (operationType == DbOperationType.TRUNCATE) {
                    truncateOldDbId = new DatabaseId();
                    truncateOldDbId.readFromLog(entryBuffer, version);
                }
            }

            /*
 
View Full Code Here

        throws DatabaseException {

        int logVersion = header.getVersion();
        boolean version6OrLater = (logVersion >= 6);
        if (version6OrLater) {
            dbId = new DatabaseId();
            dbId.readFromLog(entryBuffer, logVersion);
            obsoleteLsn =
                LogUtils.readLong(entryBuffer, false/*unpacked*/);
        }
        if (readFullItem) {
            /* Read IN and get node ID. */
            in = (IN) newInstanceOfType();
            in.readFromLog(entryBuffer, logVersion);
            nodeId = in.getNodeId();
        } else {
            /* Calculate position following IN. */
            int position = entryBuffer.position() + header.getItemSize();
            if (logVersion == 1) {
                /* Subtract size of obsoleteLsn */
                position -= LogUtils.UNSIGNED_INT_BYTES;
            } else if (logVersion >= 2) {
                /* Subtract size of obsoleteLsn */
                if (version6OrLater) {
                    position -= LogUtils.getPackedLongLogSize(obsoleteLsn);
                } else {
                    position -= LogUtils.LONG_BYTES;
                }
            }
            /* Subtract size of dbId */
            if (!version6OrLater) {
                position -= LogUtils.INT_BYTES;
            } else {
                position -= LogUtils.getPackedIntLogSize(dbId.getId());
            }
            /* Read node ID and position after IN. */
            nodeId = LogUtils.readLong(entryBuffer, !version6OrLater);
            entryBuffer.position(position);
            in = null;
        }
        if (!version6OrLater) {
            dbId = new DatabaseId();
            dbId.readFromLog(entryBuffer, logVersion);
        }
        if (logVersion < 1) {
            obsoleteLsn = DbLsn.NULL_LSN;
        } else if (logVersion == 1) {
View Full Code Here

            info.numMapINs = 0;
            DbTree dbMapTree = envImpl.getDbTree();

            /* Process every IN, BIN and INDeleteInfo in the mapping tree. */
            while (reader.readNextEntry()) {
                DatabaseId dbId = reader.getDatabaseId();
                if (dbId.equals(DbTree.ID_DB_ID)) {
                    DatabaseImpl db = dbMapTree.getDb(dbId);
                    try {
                        replayOneIN(reader, db, false, recorder);
                        info.numMapINs++;
                    } finally {
View Full Code Here

             * Read all non-provisional INs, and process if they don't belong
             * to the mapping tree.
             */
            DbTree dbMapTree = envImpl.getDbTree();
            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

        try {

            /* Read all non-provisional INs that are in the repeat set. */
            DbTree dbMapTree = envImpl.getDbTree();
            while (reader.readNextEntry()) {
                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.
View Full Code Here

        LN ln = reader.getLN();
        TreeLocation location = new TreeLocation();
        long logLsn = reader.getLastLsn();
        long abortLsn = reader.getAbortLsn();
        boolean abortKnownDeleted = reader.getAbortKnownDeleted();
        DatabaseId dbId = reader.getDatabaseId();
        DatabaseImpl db = dbMapTree.getDb(dbId);

        try {
            /* Database may be null if it's been deleted. */
            if (db == null) {
View Full Code Here

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

                LN ln = reader.getLN();
                DatabaseId dbId = reader.getDatabaseId();
                DatabaseImpl db = dbMapTree.getDb(dbId);
                try {
                    long logLsn = reader.getLastLsn();
                    long treeLsn = DbLsn.NULL_LSN;

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.