负载测试摄取管道的工具和技术
Add test spouts corresponding to every production spout that exists in the topology. Likewise for every sink bolt (i.e. which writes to a datastore and doesn’t emit any further tuples)
为每个存在于拓扑中的生产spout添加相应的测试spout。对于每个sink bolt(即写入数据存储并且不再发出任何tuple的bolt),也是如此
For simpler topologies (say less than 3 components) duplicate all components to achieve name-spacing (right side of Fig. 3)
对于较简单的拓扑结构(例如少于3个组件),复制所有组件以实现命名空间(图3右侧)
For complex topologies — keep the internal transformation bolts shared so as to better utilise the resources. To ensure sinks are name-spaced add a header-aware router bolt which separates out the stream and directs it to the relevant sink bolts. (refer left side of Fig. 3)
对于复杂的拓扑结构,保持内部转换的bolt共享,以更好地利用资源。为了确保sink有命名空间,添加一个具有头部感知的路由bolt,将流分离并将其定向到相关的sink bolt(参考图3左侧)
Ensure that test spouts are integrated with kill-switch present in config-service in the following manner. This will help ensure that the test spout becomes inactive as soon as the kill-switch is hit and stops producing any further events while the production spouts continue to function as usual.
确保测试spout与config-service中的kill-switch集成,以以下方式进行。这将有助于确保测试spout在kill-switch被触发时立即变为非活动状态,并停止产生任何进一步的事件,而生产spout将继续正常运行。
class MySpout extends BaseRichSpout { ...
class MySpout extends BaseRichSpout { ...
protected transient Supplier<Boolean> isActiveFlowSupplier;
protected transient Supplier<Boolean> isActiveFlowSupplier;
protected final Lock activeFlowLock;
protected final long schedulerInitialDelayMillis;
protected final long schedulerDelayMillis;
protected final Lock activeFlowLock;
protected final long schedulerInitialDelayMillis;
protected final long schedulerDelayMillis;
private transient ScheduledExecutorService scheduledExecutorService;
私有的瞬态ScheduledExecutorService scheduledExecutorService;
private transient ScheduledFuture<?> scheduledFuture;
private transient volatile boolean isActiveFlow;
private transient ScheduledFuture<?> scheduledFuture;
private transient volatile boolean isActiveFlow;
public void open(Map stormConf, TopologyConte...