public class MagicQueue extends Object implements BlockingQueue<org.nd4j.linalg.dataset.DataSet>
Modifier and Type | Class and Description |
---|---|
static class |
MagicQueue.Builder |
static class |
MagicQueue.Mode |
Modifier and Type | Field and Description |
---|---|
protected List<LinkedBlockingQueue<org.nd4j.linalg.dataset.DataSet>> |
backingQueues |
protected int |
capacity |
protected AtomicLong |
cntGet |
protected AtomicLong |
cntPut |
protected List<org.deeplearning4j.parallelism.MagicQueue.QueueHandler> |
handlers |
protected AtomicInteger |
interleavedCounter |
protected AtomicInteger |
interleavedPutter |
protected MagicQueue.Mode |
mode |
protected AtomicInteger |
nextBucket |
protected int |
numberOfBuckets |
Modifier | Constructor and Description |
---|---|
protected |
MagicQueue(int numberOfFlows,
int capacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(org.nd4j.linalg.dataset.DataSet dataSet) |
boolean |
addAll(Collection<? extends org.nd4j.linalg.dataset.DataSet> c) |
void |
clear() |
boolean |
contains(Object o)
This method isn't supported
|
boolean |
containsAll(Collection<?> c)
This method isn't supported
|
int |
drainTo(Collection<? super org.nd4j.linalg.dataset.DataSet> c) |
int |
drainTo(Collection<? super org.nd4j.linalg.dataset.DataSet> c,
int maxElements) |
org.nd4j.linalg.dataset.DataSet |
element() |
boolean |
isEmpty() |
Iterator<org.nd4j.linalg.dataset.DataSet> |
iterator()
This method isn't supported
|
boolean |
offer(org.nd4j.linalg.dataset.DataSet dataSet) |
boolean |
offer(org.nd4j.linalg.dataset.DataSet dataSet,
long timeout,
TimeUnit unit) |
org.nd4j.linalg.dataset.DataSet |
peek() |
org.nd4j.linalg.dataset.DataSet |
poll()
This method is supposed to be called from managed thread, attached to specific device.
|
org.nd4j.linalg.dataset.DataSet |
poll(long time,
TimeUnit timeUnit)
This method is supposed to be called from managed thread, attached to specific device.
|
void |
put(org.nd4j.linalg.dataset.DataSet dataSet) |
int |
remainingCapacity() |
org.nd4j.linalg.dataset.DataSet |
remove() |
boolean |
remove(Object o)
This method isn't supported
|
boolean |
removeAll(Collection<?> c)
This method isn't supported
|
boolean |
retainAll(Collection<?> c)
This method isn't supported
|
int |
size()
This method returns average queue size for all devices
|
protected int |
size(int deviceId) |
org.nd4j.linalg.dataset.DataSet |
take() |
Object[] |
toArray()
This method isn't supported
|
<T> T[] |
toArray(T[] a)
This method isn't supported
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
protected final List<LinkedBlockingQueue<org.nd4j.linalg.dataset.DataSet>> backingQueues
protected final AtomicInteger nextBucket
protected final int numberOfBuckets
protected final List<org.deeplearning4j.parallelism.MagicQueue.QueueHandler> handlers
protected int capacity
protected MagicQueue.Mode mode
protected AtomicInteger interleavedCounter
protected AtomicInteger interleavedPutter
protected AtomicLong cntPut
protected AtomicLong cntGet
public int size()
size
in interface Collection<org.nd4j.linalg.dataset.DataSet>
protected int size(int deviceId)
public boolean isEmpty()
isEmpty
in interface Collection<org.nd4j.linalg.dataset.DataSet>
public boolean contains(Object o)
contains
in interface Collection<org.nd4j.linalg.dataset.DataSet>
contains
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
o
- public int drainTo(Collection<? super org.nd4j.linalg.dataset.DataSet> c)
drainTo
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
public int drainTo(Collection<? super org.nd4j.linalg.dataset.DataSet> c, int maxElements)
drainTo
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
public Iterator<org.nd4j.linalg.dataset.DataSet> iterator()
iterator
in interface Iterable<org.nd4j.linalg.dataset.DataSet>
iterator
in interface Collection<org.nd4j.linalg.dataset.DataSet>
public Object[] toArray()
toArray
in interface Collection<org.nd4j.linalg.dataset.DataSet>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<org.nd4j.linalg.dataset.DataSet>
T
- a
- public boolean add(org.nd4j.linalg.dataset.DataSet dataSet)
add
in interface Collection<org.nd4j.linalg.dataset.DataSet>
add
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
add
in interface Queue<org.nd4j.linalg.dataset.DataSet>
public boolean remove(Object o)
remove
in interface Collection<org.nd4j.linalg.dataset.DataSet>
remove
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
o
- public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<org.nd4j.linalg.dataset.DataSet>
c
- public boolean addAll(Collection<? extends org.nd4j.linalg.dataset.DataSet> c)
addAll
in interface Collection<org.nd4j.linalg.dataset.DataSet>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<org.nd4j.linalg.dataset.DataSet>
c
- public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<org.nd4j.linalg.dataset.DataSet>
c
- public void clear()
clear
in interface Collection<org.nd4j.linalg.dataset.DataSet>
public boolean offer(org.nd4j.linalg.dataset.DataSet dataSet)
offer
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
offer
in interface Queue<org.nd4j.linalg.dataset.DataSet>
public void put(org.nd4j.linalg.dataset.DataSet dataSet) throws InterruptedException
put
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
InterruptedException
public boolean offer(org.nd4j.linalg.dataset.DataSet dataSet, long timeout, TimeUnit unit) throws InterruptedException
offer
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
InterruptedException
public org.nd4j.linalg.dataset.DataSet take() throws InterruptedException
take
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
InterruptedException
public org.nd4j.linalg.dataset.DataSet remove()
public org.nd4j.linalg.dataset.DataSet poll(long time, TimeUnit timeUnit) throws InterruptedException
poll
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
time
- time to wait for something appear in queuetimeUnit
- TimeUnit for time paramInterruptedException
public int remainingCapacity()
remainingCapacity
in interface BlockingQueue<org.nd4j.linalg.dataset.DataSet>
public org.nd4j.linalg.dataset.DataSet poll()
public org.nd4j.linalg.dataset.DataSet element()
Copyright © 2017. All Rights Reserved.