Interface LabelledResultsCollector
public interface LabelledResultsCollector
Stores
LabelledResultsVector as they are calculated, and writes to the file-system.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(LabelledResultsVector results) Adds a results-element to be written.voidflushAndClose(Optional<NamedFeatureStore<FeatureInputResults>> featuresAggregate, boolean includeGroups, Function<InputOutputContext, FeatureCSVWriterFactory> csvWriterCreator, FeatureOutputMetadata outputMetadata, InputOutputContext context) Writes any queued (but not yet written elements to the file-system), and closes open file-handles.
-
Method Details
-
add
Adds a results-element to be written.This should be called once for each set of results to be written.
- Parameters:
results- the results.
-
flushAndClose
void flushAndClose(Optional<NamedFeatureStore<FeatureInputResults>> featuresAggregate, boolean includeGroups, Function<InputOutputContext, FeatureCSVWriterFactory> csvWriterCreator, FeatureOutputMetadata outputMetadata, InputOutputContext context) throws OutputWriteFailedExceptionWrites any queued (but not yet written elements to the file-system), and closes open file-handles.This should be called once only after all calls to
add(LabelledResultsVector)are completed.- Parameters:
featuresAggregate- aggregate-features.includeGroups- iff true a group-column is included in the CSV file and the group exports occur, otherwise not.csvWriterCreator- creates a CSV writer for a particular IO-context.outputMetadata- metadata for writing features to the file-system with CSV and other formats.context- input-output context.- Throws:
OutputWriteFailedException- if writing fails.
-