Package com.sleepycat.je.latch

Examples of com.sleepycat.je.latch.Latch


        lockEnvironment(readOnly, false);

        /* Cache of files. */
        fileCache = new FileCache(configManager);
        fileCacheLatch = new Latch(DEBUG_NAME + "_fileCache", envImpl);

        if (!dbEnvHome.exists()) {
            throw new LogException("Environment home " + dbEnvHome +
                                     " doesn't exist");
        }
View Full Code Here


      configManager.getBoolean(EnvironmentParams.LOG_CHECKSUM_READ);
       
        chunkedNIOSize =
      configManager.getLong(EnvironmentParams.LOG_CHUNKED_NIO);

        logWriteLatch = new Latch(DEBUG_NAME, envImpl);
        readBufferSize =
      configManager.getInt(EnvironmentParams.LOG_FAULT_READ_SIZE);
        checkpointMonitor = new CheckpointMonitor(envImpl);
    }
View Full Code Here

        boolean success = false;
        try {
            this.envHome = envHome;
            envState = DbEnvState.INIT;
            mapTreeRootLatch = new Latch("MapTreeRoot");
            exceptionListenerUsers = new HashSet<ExceptionListenerUser>();

            /* Do the stats definition. */
            stats = new StatGroup(ENV_GROUP_NAME, ENV_GROUP_DESC);
            relatchesRequired =
View Full Code Here

            configMgr.getBoolean(EnvironmentParams.LOCK_OLD_LOCK_EXCEPTIONS);
        lockTables = new Map[nLockTables];
        lockTableLatches = new Latch[nLockTables];
        for (int i = 0; i < nLockTables; i++) {
            lockTables[i] = new HashMap<Long,Lock>();
            lockTableLatches[i] = new Latch("Lock Table " + i);
        }
        this.envImpl = envImpl;
        memoryBudget = envImpl.getMemoryBudget();

        stats = new StatGroup(GROUP_NAME, GROUP_DESC);
View Full Code Here

    @Override
    Lock lookupLock(Long nodeId)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return lookupLockInternal(nodeId, lockTableIndex);
        } finally {
            latch.release();
        }
    }
View Full Code Here

                                  LockType type,
                                  boolean nonBlockingRequest)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return attemptLockInternal(nodeId, locker, type,
                                       nonBlockingRequest, lockTableIndex);
        } finally {
            latch.release();
        }
    }
View Full Code Here

                                         long now,
                                         DatabaseImpl database)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return makeTimeoutMsgInternal
                (isLockNotTxnTimeout, locker, nodeId, type, grantType, useLock,
                 timeout, start, now, database);
        } finally {
            latch.release();
        }
    }
View Full Code Here

    Set<Locker> releaseAndFindNotifyTargets(long nodeId, Locker locker)
        throws DatabaseException {

        long nid = nodeId;
        int lockTableIndex = getLockTableIndex(nid);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return releaseAndFindNotifyTargetsInternal
                (nodeId, locker, lockTableIndex);
        } finally {
            latch.release();
        }
    }
View Full Code Here

                  Locker destLocker,
                  boolean demoteToRead)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            transferInternal(nodeId, owningLocker, destLocker,
                             demoteToRead, lockTableIndex);
        } finally {
            latch.release();
        }
    }
View Full Code Here

                          Locker owningLocker,
                          Locker[] destLockers)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            transferMultipleInternal(nodeId, owningLocker,
                                     destLockers, lockTableIndex);
        } finally {
            latch.release();
        }
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.je.latch.Latch

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.