public interface SampleConsumer extends SampleProcessor
A sample consumer is meant to consume samples in order to process them.
A sample consumer can consume samples on different channels and each channel is assigned a single metadata structure.
A sample consumer is passive, meaning that its consume()
service
must be called by a third party object.
Sample metadata must be provided to the consumer before
startConsuming()
is called.
The following sequence must be observed when consuming samples :
setConsumedMetadata()
for each channel that will consume
samplesstartConsuming()
before any call to
consume()
consume()
for each sample to be consumed by the
consumer, specify the channel on which to consumestopConsuming()
after every sample has been consumedModifier and Type | Method and Description |
---|---|
void |
consume(Sample s,
int channel)
Consumes the specified sample ton the specified channel.
|
void |
setConsumedMetadata(SampleMetadata sampleMetadata,
int channel)
Set the metadata of samples that will be consumed on the specified
channel.
|
void |
startConsuming()
Start the sample consuming.
|
void |
stopConsuming()
Stops the consuming process.
|
getChannelAttribute, getSampleContext, setChannelAttribute, setSampleContext
void setConsumedMetadata(SampleMetadata sampleMetadata, int channel)
sampleMetadata
- The sample metadata that are beeing consumed for the
associated channelchannel
- The channel whose sample metadata are beeing definedvoid startConsuming()
void consume(Sample s, int channel)
s
- The sample to be consumedchannel
- The channel on which the sample is consumedvoid stopConsuming()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.