-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When creating a new pipeline without any input (e.g. the pipeline input would be done directly with an abstract pipelinestep in this case) any doClose is executed twice. This of course can cause strange behavior when doing anything in these methods (see code snippet below).
Although it could go against the intend, it would be nice that one could define an empty input. This would be especially helpful when one has a step generating samples in some manner or a customized reader that can't be defined as a marshaller.
new Pipeline()
.step(new AbstractPipelineStep() {
@Override
public void start(TaskPool pool) throws IOException {
super.start(pool);
// some generated dummy
output.writeSample(new Sample(Header.EMPTY_HEADER, new double[0], new Date()));
super.close();
}
})
.step(new AbstractPipelineStep() {
Sample s;
@Override
public void writeSample(Sample sample) throws IOException {
s = sample; // save output for later
output.writeSample(s);
}
@Override
protected void doClose() throws IOException {
output.writeSample(s);
}
})
.outputCsv("") // just some path, two files (second one with only one sample)
.runAndWait();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels