A SplitOutputFiles struct holds a collection of output files.
This struct manages a collection of output files used when writing to multiple
files at once. This includes constructing filenames, opening and closing files,
and writing data and header lines.
Both random assignment (splitLinesRandomly) and random assignment by key
(splitLinesByKey) use a SplitOutputFiles struct to manage output files.
The main properties of the output file set are specified in the constuctor. The
exception is the header line. This is not known until the first input file is
read, so it is specified in a separate 'setHeader' call.
Individual output files are written to based on their zero-based index in the
output collection. The caller selects the output file number to write to and
calls 'writeDataLine' to write a line. The header is written if needed.
A SplitOutputFiles struct holds a collection of output files.
This struct manages a collection of output files used when writing to multiple files at once. This includes constructing filenames, opening and closing files, and writing data and header lines.
Both random assignment (splitLinesRandomly) and random assignment by key (splitLinesByKey) use a SplitOutputFiles struct to manage output files.
The main properties of the output file set are specified in the constuctor. The exception is the header line. This is not known until the first input file is read, so it is specified in a separate 'setHeader' call.
Individual output files are written to based on their zero-based index in the output collection. The caller selects the output file number to write to and calls 'writeDataLine' to write a line. The header is written if needed.