public class MagicQueue extends Object implements Queue<org.nd4j.linalg.dataset.DataSet>
Modifier and Type | Class and Description |
---|---|
static class |
MagicQueue.Builder |
Modifier and Type | Field and Description |
---|---|
protected List<LinkedBlockingQueue<org.nd4j.linalg.dataset.DataSet>> |
backingQueues |
protected List<org.deeplearning4j.parallelism.MagicQueue.QueueHandler> |
handlers |
protected AtomicInteger |
nextBucket |
protected int |
numberOfBuckets |
Modifier | Constructor and Description |
---|---|
protected |
MagicQueue(int numberOfFlows) |
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
|
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) |
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.
|
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) |
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
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>
o
- 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 Queue<org.nd4j.linalg.dataset.DataSet>
public boolean remove(Object o)
remove
in interface Collection<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)
public org.nd4j.linalg.dataset.DataSet remove()
public org.nd4j.linalg.dataset.DataSet poll(long time, TimeUnit timeUnit) throws InterruptedException
time
- time to wait for something appear in queuetimeUnit
- TimeUnit for time paramInterruptedException
public org.nd4j.linalg.dataset.DataSet poll()
public org.nd4j.linalg.dataset.DataSet element()
Copyright © 2016. All Rights Reserved.