Class DefaultConsumerWorkerFactory<InputT,MetricsT>
java.lang.Object
io.aleph0.yap.core.worker.DefaultConsumerWorkerFactory<InputT,MetricsT>
- Type Parameters:
InputT- the type of the inputMetricsT- the type of the metrics
- All Implemented Interfaces:
Measureable<MetricsT>,ConsumerWorkerFactory<InputT,MetricsT>
public class DefaultConsumerWorkerFactory<InputT,MetricsT>
extends Object
implements ConsumerWorkerFactory<InputT,MetricsT>
A
ConsumerWorkerFactory that creates and manages multiple MeasuredConsumerWorkers
and tracks their metrics.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConsumerWorkerFactory(MeasuredConsumerWorker<InputT, MetricsT> workerSupplier, BinaryOperator<MetricsT> metricsAggregator) -
Method Summary
Modifier and TypeMethodDescriptionNon-destructive check of the metrics.Destructive read of the metrics.
-
Constructor Details
-
DefaultConsumerWorkerFactory
public DefaultConsumerWorkerFactory(MeasuredConsumerWorker<InputT, MetricsT> workerSupplier, BinaryOperator<MetricsT> metricsAggregator)
-
-
Method Details
-
newConsumerWorker
- Specified by:
newConsumerWorkerin interfaceConsumerWorkerFactory<InputT,MetricsT>
-
checkMetrics
Description copied from interface:MeasureableNon-destructive check of the metrics. This should be used to check the state of metrics without clearing them, for example in aTaskController.- Specified by:
checkMetricsin interfaceMeasureable<InputT>- Returns:
- the metrics
-
flushMetrics
Description copied from interface:MeasureableDestructive read of the metrics. This should be used to check and reset the state of metrics, for example by the metrics checking thread.- Specified by:
flushMetricsin interfaceMeasureable<InputT>- Returns:
- the metrics
-