@InterfaceAudience.Private class RegionNormalizerWorkQueue<E> extends Object
RegionNormalizerWorker. It is
 an ordered collection class that has the following properties:
 Set.Queue, via take().BlockingQueue.| Modifier and Type | Field and Description | 
|---|---|
| private LinkedHashSet<E> | delegateUnderlying storage structure that gives us the Set behavior and FIFO retrieval policy. | 
| private Condition | notEmptyWait queue for waiting takes | 
| private ReentrantLock | putLockLock held by put, offer, etc | 
| private ReentrantLock | takeLockLock held by take, poll, etc | 
| Constructor and Description | 
|---|
| RegionNormalizerWorkQueue() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | clear()Atomically removes all of the elements from this queue. | 
| private void | fullyLock()Locks to prevent both puts and takes. | 
| private void | fullyUnlock()Unlocks to allow both puts and takes. | 
| void | put(E e)Inserts the specified element at the tail of the queue, if it's not already present. | 
| void | putAll(Collection<? extends E> c)Inserts the specified elements at the tail of the queue. | 
| void | putAllFirst(Collection<? extends E> c)Inserts the specified elements at the head of the queue. | 
| void | putFirst(E e)Inserts the specified element at the head of the queue. | 
| private void | signalNotEmpty()Signals a waiting take. | 
| int | size()Returns the number of elements in this queue. | 
| E | take()Retrieves and removes the head of this queue, waiting if necessary
 until an element becomes available. | 
| String | toString() | 
private LinkedHashSet<E> delegate
private final ReentrantLock takeLock
private final ReentrantLock putLock
RegionNormalizerWorkQueue()
private void signalNotEmpty()
private void fullyLock()
private void fullyUnlock()
public void put(E e)
e - the element to addpublic void putFirst(E e)
e - the element to addpublic void putAll(Collection<? extends E> c)
c - the elements to addpublic void putAllFirst(Collection<? extends E> c)
c - the elements to addpublic E take() throws InterruptedException
InterruptedException - if interrupted while waitingpublic void clear()
public int size()
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.