Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.ReentrantReadWriteLock


class FSNamesystemLock implements ReadWriteLock {
  @VisibleForTesting
  protected ReentrantReadWriteLock coarseLock;
 
  FSNamesystemLock(boolean fair) {
    this.coarseLock = new ReentrantReadWriteLock(fair);
  }
View Full Code Here


    this.resource = containerTokenIdentifier.getResource();
    this.diagnostics = new StringBuilder();
    this.credentials = creds;
    this.metrics = metrics;
    user = containerTokenIdentifier.getApplicationSubmitter();
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    stateMachine = stateMachineFactory.make(this);
  }
View Full Code Here

public abstract class Cache<T> {
  final ReadWriteLock _lock;
  final ConcurrentHashMap<String, ZNode> _cache;

  public Cache() {
    _lock = new ReentrantReadWriteLock();
    _cache = new ConcurrentHashMap<String, ZNode>();
  }
View Full Code Here

    this.user = user;
    this.appId = appId;
    this.credentials = credentials;
    this.aclsManager = aclsManager;
    this.context = context;
    ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
    readLock = lock.readLock();
    writeLock = lock.writeLock();
    stateMachine = stateMachineFactory.make(this);
  }
View Full Code Here

    this.committer = committer;
    this.newApiCommitter = newApiCommitter;

    this.taskAttemptListener = taskAttemptListener;
    this.eventHandler = eventHandler;
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    this.jobCredentials = jobCredentials;
    this.jobTokenSecretManager = jobTokenSecretManager;

    this.aclsManager = new JobACLsManager(conf);
View Full Code Here

    this.healthReport = "Healthy";
    this.lastHealthReportTime = System.currentTimeMillis();

    this.latestNodeHeartBeatResponse.setResponseId(0);

    ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
    this.readLock = lock.readLock();
    this.writeLock = lock.writeLock();

    this.stateMachine = stateMachineFactory.make(this);
   
    this.nodeUpdateQueue = new ConcurrentLinkedQueue<UpdatedContainerInfo>()
  }
View Full Code Here

            DataFileChunkSetIterator<Pair<ByteBuffer, ByteBuffer>> {

        private MessageDigest md5er = ByteUtils.getDigest("md5");

        public ROCollidedEntriesIterator(DataFileChunkSet dataFileChunkSet) {
            this(dataFileChunkSet, new ReentrantReadWriteLock());
        }
View Full Code Here

        this.currentVersionId = 0L;
        /*
         * A lock that blocks reads during swap(), open(), and close()
         * operations
         */
        this.fileModificationLock = new ReentrantReadWriteLock();
        this.isOpen = false;
        open(null);
    }
View Full Code Here

        if (readWriteLock != null)
          return readWriteLock;
        else if (READ_WRITE_LOCK_FIELD != null)
          return readWriteLock = (ReadWriteLock) FieldUtils.readField(READ_WRITE_LOCK_FIELD, handle, true);
        else
          return readWriteLock = new ReentrantReadWriteLock();
      } catch (IllegalAccessException e) {
        throw new FieldAccessException("Unable to read lock field.", e);
      }
    }
View Full Code Here

    this.notifiee = notifiee;
    this.sharedDomainParticipantId =
        waveDomain != null ? ParticipantIdUtil.makeUnsafeSharedDomainParticipantId(waveDomain)
            : null;
    this.storageContinuationExecutor = storageContinuationExecutor;
    ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    waveletStateFuture.addListener(
        new Runnable() {
          @Override
          public void run() {
View Full Code Here

TOP

Related Classes of java.util.concurrent.locks.ReentrantReadWriteLock

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.