public class CsvFileSampleSource extends AbstractSampleSource
The root name of the files is determined by the source file name and is made
of its name without the file extension :
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 name
Example : if the directory contains
results-2.csv, etc. then all
these files will be read and produced on their corresponding channels.
The channel on which an input file will be produce is determined by its suffix
results-1.csvthen it will be produced on the channel 1.
results-2.csvthen it will be produced on the channel 2.
results.csvthen it will be produced on the channel 0.
|Modifier and Type||Field and Description|
File name whose sample are being produced on the channel
|Constructor and Description|
Build a sample source from the specified input file and character separator.
|Modifier and Type||Method and Description|
Add a sample consumer to this sample source.
Remove a sample consumer from this sample source.
Run this sample source.
This sample source will start reading all inputs CSV files and produce their samples to this sample source registered sample consumers.
Sets the specified sample consumers that will consume samples produced by this sample source.
public CsvFileSampleSource(File inputFile, char separator)
inputFile- The input sample file (CSV file) (must not be
separator- The character separator to be used for delimiting samples columns
public void setSampleConsumers(List<SampleConsumer> consumers)
public void addSampleConsumer(SampleConsumer consumer)
public void removeSampleConsumer(SampleConsumer consumer)
Copyright © 1998-2020 Apache Software Foundation. All Rights Reserved.