public class CsvFileSampleSource extends AbstractSampleSource
SampleConsumers.results.csv is the source file name then
results is the root file name.CsvFileSampleSource looks for all the files in the same
directory of the main source file that have the same root file nameresults.csv,
results-1.csv, results-2.csv, etc. then all
these files will be read and produced on their corresponding channels.results-1.csv then it will
be produced on the channel 1.results-2.csv then it will
be produced on the channel 2.results.csv then it will
be produced on the channel 0.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SOURCE_FILE_ATTRIBUTE
File name whose sample are being produced on the channel
|
| Constructor and Description |
|---|
CsvFileSampleSource(java.io.File inputFile,
char separator)
Build a sample source from the specified input file and character
separator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSampleConsumer(SampleConsumer consumer)
Add a sample consumer to this sample source.
|
void |
removeSampleConsumer(SampleConsumer consumer)
Remove a sample consumer from this sample source.
|
void |
run()
Run this sample source.
|
void |
setSampleConsumers(java.util.List<SampleConsumer> consumers)
Sets the specified sample consumers that will consume samples produced by
this sample source.
|
getSampleContext, setSampleContextpublic static final java.lang.String SOURCE_FILE_ATTRIBUTE
public CsvFileSampleSource(java.io.File inputFile,
char separator)
inputFile - The input sample file (CSV file) (must not be null)separator - The character separator to be used for delimiting samples
columnspublic void setSampleConsumers(java.util.List<SampleConsumer> consumers)
SampleSourcesetSampleConsumers in interface SampleSourcesetSampleConsumers in class AbstractSampleSourceconsumers - consumers to be setpublic void addSampleConsumer(SampleConsumer consumer)
SampleSourceaddSampleConsumer in interface SampleSourceaddSampleConsumer in class AbstractSampleSourceconsumer - consumer to be addedpublic void removeSampleConsumer(SampleConsumer consumer)
SampleSourceremoveSampleConsumer in interface SampleSourceremoveSampleConsumer in class AbstractSampleSourceconsumer - consumer to be removedpublic void run()
run in interface java.lang.Runnablerun in class AbstractSampleSourceCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.