Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.ReadWriteLock.readLock()


  LockMessageDispatcher(ConcurrentMessageHandler concurrentMessageHandler){
    super(concurrentMessageHandler);

    ReadWriteLock waitingReadWriteLock = new ReentrantReadWriteLock();
    waitingReadLock = waitingReadWriteLock.readLock();
    waitingWriteLock = waitingReadWriteLock.writeLock();
  }

  /**
   * A RejectedExecutionException could be thrown in case there too many requests.
View Full Code Here


   * @param key The key to lock
   * @param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait.
   */
  public void readLock(EntityKey key, int timeout) {
    ReadWriteLock lock = getLock( key );
    Lock readLock = lock.readLock();
    acquireLock( key, timeout, readLock );
  }

  private ReadWriteLock getLock(EntityKey key) {
    ReadWriteLock newLock = new ReentrantReadWriteLock();
View Full Code Here

  public LockMessageDispatcher(ConcurrentMessageHandler concurrentMessageHandler){
    super(concurrentMessageHandler);

    ReadWriteLock waitingReadWriteLock = new ReentrantReadWriteLock();
    waitingReadLock = waitingReadWriteLock.readLock();
    waitingWriteLock = waitingReadWriteLock.writeLock();
  }

  /**
   * A RejectedExecutionException could be thrown in case there too many requests.
View Full Code Here

    this.exitNotifier = exitNotifier;
    sfg = new DirectedMultigraph<>(Eventable.class);
    stateById = Maps.newConcurrentMap();
    LOG.debug("Initialized the stateflowgraph");
    ReadWriteLock lock = new ReentrantReadWriteLock();
    readLock = lock.readLock();
    writeLock = lock.writeLock();
  }

  /**
   * Adds a state (as a vertix) to the State-Flow Graph if not already present. More formally,
View Full Code Here

    * Constructs a new empty set of filenames
    */
   public FileListCacheValue() {
      ReadWriteLock namesLock = new ReentrantReadWriteLock();
      writeLock = namesLock.writeLock();
      readLock = namesLock.readLock();
   }

   /**
    * Initializes a new instance storing the passed values.
    * @param listAll the strings to store.
View Full Code Here

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

    this.vertexLocationHint = vertexLocationHint;
    if (LOG.isDebugEnabled()) {
      logLocationHints(this.vertexLocationHint);
View Full Code Here

      boolean leafVertex, TaskLocationHint locationHint, Resource resource,
      ContainerContext containerContext) {
    this.conf = conf;
    this.clock = clock;
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    readLock = readWriteLock.readLock();
    writeLock = readWriteLock.writeLock();
    this.attempts = Collections.emptyMap();
    // TODO Avoid reading this from configuration for each task.
    maxAttempts = this.conf.getInt(TezConfiguration.TEZ_AM_MAX_TASK_ATTEMPTS,
                              TezConfiguration.TEZ_AM_MAX_TASK_ATTEMPTS_DEFAULT);
View Full Code Here

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

    this.credentials = dagCredentials;
    if (this.credentials == null) {
      try {
View Full Code Here

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

    this.credentials = fsTokenCredentials;

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

      boolean leafVertex, TaskLocationHint locationHint, Resource resource,
      ContainerContext containerContext) {
    this.conf = conf;
    this.clock = clock;
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    readLock = readWriteLock.readLock();
    writeLock = readWriteLock.writeLock();
    this.attempts = Collections.emptyMap();
    // TODO Avoid reading this from configuration for each task.
    maxAttempts = this.conf.getInt(TezConfiguration.TEZ_AM_MAX_TASK_ATTEMPTS,
                              TezConfiguration.TEZ_AM_MAX_TASK_ATTEMPTS_DEFAULT);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.