public class TrackedTopology extends Object
A tracked topology keeps metrics for every bolt and spout. This allows a test to know how many tuples have been fully processed. Metrics are tracked on a per cluster basis. So only one tracked topology should be run in a tracked cluster to avoid conflicts.
Constructor and Description |
---|
TrackedTopology(StormTopology origTopo,
ILocalCluster cluster)
Create a new topology to be tracked.
|
Modifier and Type | Method and Description |
---|---|
ILocalCluster |
getCluster() |
StormTopology |
getTopology() |
int |
globalAmt(String key)
Read a metric from the tracked cluster (NOT JUST THIS TOPOLOGY)
|
void |
trackedWait()
Wait for 1 tuple to be fully processed
|
void |
trackedWait(int amt)
Wait for amt tuples to be fully processed.
|
void |
trackedWait(int amt,
int timeoutMs)
Wait for amt tuples to be fully processed timeoutMs happens.
|
public TrackedTopology(StormTopology origTopo, ILocalCluster cluster)
Create a new topology to be tracked.
origTopo
- the original topology.cluster
- a cluster that should have been launched with tracking enabled.public StormTopology getTopology()
public ILocalCluster getCluster()
public void trackedWait()
Wait for 1 tuple to be fully processed
public void trackedWait(int amt)
Wait for amt tuples to be fully processed.
public void trackedWait(int amt, int timeoutMs)
Wait for amt tuples to be fully processed timeoutMs happens.
public int globalAmt(String key)
Read a metric from the tracked cluster (NOT JUST THIS TOPOLOGY)
key
- one of “spout-emitted”, “processed”, or “transferred”Copyright © 2019 The Apache Software Foundation. All rights reserved.