L
- The generic type of the key used to lookup subtasks in the
internal map.HS
- The generic type of the subtask statistics.public abstract class AbstractMasterStats<L,HS extends AbstractSubtaskStats> extends Object
AbstractMasterTask
and a factory for the statistics for the subtasks.
Note: Since there are concurrent threads which need to write on the counters
on this class the practice is to be synchronized
on this
reference before you update those counters. Without this, the counters might
not update correctly as thing like a += 2
may not produce the
correct result.
Note: The use of AtomicLong
s provides atomic visibility changes
relied on by some unit tests.
Modifier and Type | Field and Description |
---|---|
AtomicLong |
chunksIn
The #of chunks drained from the
BlockingBuffer by the
AbstractMasterTask . |
AtomicLong |
chunksOut
The #of chunks written onto index partitions using RMI.
|
AtomicLong |
chunksTransferred
The #of chunks transferred from the master to the sinks.
|
long |
elapsedRedirectNanos
Elapsed nanoseconds handling a redirect.
|
long |
elapsedSinkChunkWaitingNanos
Elapsed time across sinks waiting for another chunk to be ready so that
it can be written onto the index partition.
|
long |
elapsedSinkChunkWritingNanos
Elapsed nanoseconds across sinks writing chunks on an index partition
(RMI requests).
|
long |
elapsedSinkOfferNanos
Elapsed nanoseconds the master spends offering a chunk for transfer to a
sink.
|
AtomicLong |
elementsIn
The #of elements drained from the
BlockingBuffer by the
AbstractMasterTask . |
AtomicLong |
elementsOnSinkQueues
The #of elements on the output sink queues.
|
AtomicLong |
elementsOut
The #of elements in the output chunks written onto the index partitions
(not including any eliminated duplicates).
|
AtomicLong |
elementsTransferred
The #of elements transferred from the master to the sinks.
|
AtomicInteger |
masterCreateCount
The #of master tasks which have been created for the index whose
asynchronous write statistics are reported on by this object.
|
protected ConcurrentWeakValueCache<Integer,AbstractMasterTask> |
masters
Weak value hash map of the active masters.
|
AtomicLong |
redirectCount
The #of redirects (
StaleLocatorException s) that were handled. |
AtomicLong |
subtaskEndCount
The #of subtasks which have finished (either the buffer has been closed
and all buffered data has been flushed -or- the task was interrupted or
otherwise threw an exception).
|
AtomicLong |
subtaskIdleTimeoutCount
The #of subtasks which were closed due to an idle timeout.
|
AtomicLong |
subtaskStartCount
The #of subtasks which have started.
|
Constructor and Description |
---|
AbstractMasterStats() |
Modifier and Type | Method and Description |
---|---|
int |
getActiveSinkCount()
The #of active sinks.
|
CounterSet |
getCounterSet()
Return a
CounterSet which may be used to report the statistics on
the index write operation. |
int |
getMasterActiveCount()
The approximate #of active master tasks.
|
int |
getMaximumPartitionCount()
The maximum #of distinct partitions for which the master has caused
subtasks to be created at any given time.
|
Map<L,HS> |
getSubtaskStats()
Return a snapshot of the statistics for each index partition.
|
HS |
getSubtaskStats(L locator)
Return the statistics object for the specified index partition and never
null (a new instance is created if none exists). |
protected abstract HS |
newSubtaskStats(L locator)
Factory for the subtask statistics.
|
String |
toString() |
public final AtomicLong subtaskStartCount
public final AtomicLong subtaskEndCount
public final AtomicLong subtaskIdleTimeoutCount
public final AtomicLong redirectCount
StaleLocatorException
s) that were handled.public long elapsedRedirectNanos
public final AtomicLong chunksIn
BlockingBuffer
by the
AbstractMasterTask
.public final AtomicLong elementsIn
BlockingBuffer
by the
AbstractMasterTask
.public final AtomicLong elementsOut
public final AtomicLong elementsOnSinkQueues
elementsTransferred
/
chunksTransferred
X the averageMasterQueueSize). Neither does it
include the #of elements in a prepared or outstanding write on an index
partition.public final AtomicLong chunksTransferred
public final AtomicLong elementsTransferred
public final AtomicLong chunksOut
public long elapsedSinkOfferNanos
public long elapsedSinkChunkWaitingNanos
public long elapsedSinkChunkWritingNanos
protected final ConcurrentWeakValueCache<Integer,AbstractMasterTask> masters
public final AtomicInteger masterCreateCount
public int getMaximumPartitionCount()
public int getActiveSinkCount()
public int getMasterActiveCount()
public HS getSubtaskStats(L locator)
null
(a new instance is created if none exists).locator
- The index partition.protected abstract HS newSubtaskStats(L locator)
locator
- The subtask key.public Map<L,HS> getSubtaskStats()
public CounterSet getCounterSet()
CounterSet
which may be used to report the statistics on
the index write operation. The CounterSet
is NOT placed into any
namespace.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.