public class FilterConsumer extends AbstractSampleConsumer
The class FilterConsumer provides a way to discard samples in a consumer chain. This class uses a predicate for the filtering decision.
| Constructor and Description |
|---|
FilterConsumer() |
| Modifier and Type | Method and Description |
|---|---|
void |
consume(Sample sample,
int channel)
Consumes the specified sample ton the specified channel.
|
SamplePredicate |
getSamplePredicate()
Gets the sample predicate used to filter the samples.
|
boolean |
isReverseFilter()
Checks if the filtering is reversed.
|
void |
setReverseFilter(boolean reverseFilter)
Reverses the filtering decision.
|
void |
setSamplePredicate(SamplePredicate samplePredicate)
Sets the sample predicate used to filter the samples.
|
void |
startConsuming()
Start the sample consuming.
|
void |
stopConsuming()
Stops the consuming process.
|
addSampleConsumer, getConsumedChannelCount, getConsumedMetadata, getConsumer, getDataFromContext, getName, getWorkingDirectory, produce, removeSampleConsumer, setChannelAttribute, setConsumedMetadata, setDataToContext, setName, setProducedMetadata, setSampleConsumer, setSampleConsumers, setSampleContext, startProducing, stopProducinggetChannelAttribute, getSampleContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChannelAttribute, getSampleContextpublic final boolean isReverseFilter()
public final void setReverseFilter(boolean reverseFilter)
reverseFilter - the filter mode to setpublic final SamplePredicate getSamplePredicate()
public final void setSamplePredicate(SamplePredicate samplePredicate)
samplePredicate - the new sample predicate.public void startConsuming()
SampleConsumerpublic void consume(Sample sample, int channel)
SampleConsumersample - The sample to be consumedchannel - The channel on which the sample is consumedpublic void stopConsuming()
SampleConsumerCopyright © 1998-2022 Apache Software Foundation. All Rights Reserved.