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, stopProducing
getChannelAttribute, getSampleContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChannelAttribute, getSampleContext
public 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()
SampleConsumer
public void consume(Sample sample, int channel)
SampleConsumer
sample
- The sample to be consumedchannel
- The channel on which the sample is consumedpublic void stopConsuming()
SampleConsumer
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.