while launching the job we check if the source is streaming source or
regular(batch).
if (source instanceof WorkUnitStreamSource) {
workUnitStream = ((WorkUnitStreamSource)
source).getWorkunitStream(jobState);
} else {
workUnitStream = new
BasicWorkUnitStream.Builder(source.getWorkunits(jobState)).build();
}
but in when i look at the implementation of one of the WorkUnitStreamSource
class, it returns the BasicWorkUnitStream anyway. so whats really the
difference between the source implementing the WorkUnitStreamSource and
sources not implementing it?
public List<WorkUnit> getWorkunits(SourceState state) {
throw new UnsupportedOperationException("Please use getWorkunitStream");
}
public WorkUnitStream getWorkunitStream(SourceState state) {
try {
............................< other code >...................
return new BasicWorkUnitStream.Builder (workUnitIterator).build();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Thanks
Jay