Package java.util.concurrent.locks

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


    protected LockSupport()
    {
        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();

        readLock = lock.readLock();
        writeLock = lock.writeLock();
    }

    /**
     * Locks the shared read lock. Any number of threads may lock the read lock at the same time.
View Full Code Here


    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

    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);
  }

  @Override
View Full Code Here

    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;
View Full Code Here

    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

    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
View Full Code Here

    public LRUMap(int initialEntries, int maxEntries)
    {
        super(initialEntries, 0.8f, true);
        _maxEntries = maxEntries;
        final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
        _readLock = rwl.readLock();
        _writeLock = rwl.writeLock();
    }

    @Override
    protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
View Full Code Here

  private final SearchFactoryImplementor searchFactoryImplementor;

  public StatisticsImpl(SearchFactoryImplementor searchFactoryImplementor) {
    ReadWriteLock lock = new ReentrantReadWriteLock();
    readLock = lock.readLock();
    writeLock = lock.writeLock();

    this.searchFactoryImplementor = searchFactoryImplementor;
  }
View Full Code Here

    this.visitor = new LuceneWorkVisitor( workspace );
    this.maxQueueLength = CommonPropertiesParse.extractMaxQueueSize( indexName, props );
    this.queueingExecutor = Executors.newFixedThreadPool( 1, "Index updates queue processor for index " + indexName, maxQueueLength );
    this.workersExecutor = BackendFactory.buildWorkersExecutor( props, indexName );
    ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    readLock = readWriteLock.readLock();
    writeLock = readWriteLock.writeLock();
  }

  private LuceneBackendResources(LuceneBackendResources previous) {
    this.indexName = previous.indexName;
View Full Code Here

  private final SearchFactoryImplementor searchFactoryImplementor;

  public StatisticsImpl(SearchFactoryImplementor searchFactoryImplementor) {
    ReadWriteLock lock = new ReentrantReadWriteLock();
    readLock = lock.readLock();
    writeLock = lock.writeLock();

    this.searchFactoryImplementor = searchFactoryImplementor;
  }
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.