public class IndexedTail extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowCollapse |
protected AtomicLong |
collapsedIndex |
protected AtomicBoolean |
collapsedMode |
protected int |
collapseThreshold |
protected AtomicBoolean |
dead |
protected int |
expectedConsumers |
protected AtomicLong |
lastDeletedIndex |
protected ReentrantReadWriteLock |
lock |
protected ConcurrentHashMap<Long,AtomicLong> |
positions |
protected long[] |
shape |
protected Map<Long,INDArray> |
updates |
protected AtomicLong |
updatesCounter |
Constructor and Description |
---|
IndexedTail(int expectedConsumers) |
IndexedTail(int expectedConsumers,
boolean allowCollapse,
long[] shape) |
Modifier and Type | Method and Description |
---|---|
boolean |
drainTo(INDArray array) |
boolean |
drainTo(long threadId,
INDArray array) |
protected long |
firstNotAppliedIndexEverywhere() |
protected long |
getDelta() |
protected long |
getDelta(long threadId) |
protected long |
getGlobalPosition() |
protected long |
getLocalPosition() |
protected long |
getLocalPosition(long threadId) |
boolean |
hasAnything() |
boolean |
hasAnything(long threadId) |
protected boolean |
isDead() |
protected void |
maintenance()
This method does maintenance of updates within
|
protected long |
maxAppliedIndexEverywhere() |
protected void |
notifyDead() |
void |
purge() |
void |
put(INDArray update)
This mehtod adds update, with optional collapse
|
protected INDArray |
smartDecompress(INDArray encoded,
INDArray target) |
protected int |
updatesSize()
This method returns actual number of updates stored within tail
|
protected ConcurrentHashMap<Long,AtomicLong> positions
protected AtomicLong updatesCounter
protected AtomicLong lastDeletedIndex
protected final int expectedConsumers
protected AtomicBoolean dead
protected ReentrantReadWriteLock lock
protected final boolean allowCollapse
protected final long[] shape
protected final int collapseThreshold
protected AtomicBoolean collapsedMode
protected AtomicLong collapsedIndex
public IndexedTail(int expectedConsumers)
public IndexedTail(int expectedConsumers, boolean allowCollapse, long[] shape)
public void put(@NonNull INDArray update)
update
- protected long firstNotAppliedIndexEverywhere()
protected long maxAppliedIndexEverywhere()
public boolean hasAnything()
public boolean hasAnything(long threadId)
public boolean drainTo(@NonNull INDArray array)
protected long getGlobalPosition()
protected long getLocalPosition()
protected long getDelta()
protected long getDelta(long threadId)
protected long getLocalPosition(long threadId)
public boolean drainTo(long threadId, @NonNull INDArray array)
protected void maintenance()
protected int updatesSize()
protected boolean isDead()
protected void notifyDead()
public void purge()
Copyright © 2019. All rights reserved.