Package com.sleepycat.je.latch

Examples of com.sleepycat.je.latch.Latch


    @Override
    void demote(long nodeId, Locker locker)
        throws DatabaseException {

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


    @Override
    boolean isLocked(Long nodeId)
        throws DatabaseException {

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

    @Override
    boolean isOwner(Long nodeId, Locker locker, LockType type)
        throws DatabaseException {

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

    @Override
    boolean isWaiter(Long nodeId, Locker locker)
        throws DatabaseException {

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

    @Override
    int nWaiters(Long nodeId)
        throws DatabaseException {

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

    @Override
    int nOwners(Long nodeId)
        throws DatabaseException {

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

    @Override
    Locker getWriteOwnerLocker(Long nodeId)
        throws DatabaseException {

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

                              boolean flushFromWaiters,
                              MemoryBudget mb)
        throws DatabaseException {

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

                                          LockType lockType,
                                          MemoryBudget mb)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return stealLockInternal(nodeId, locker, lockType,
                                     mb, 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

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.