2

Can Processors be both cooperative and non-cooperative in single vertex? Because cooperativity is a property of Processor, and the ProcessorSupplier is not required to return Processors of the same type. Or is it?

The use case of this is weird and avoidable, but just wondering...

Oliv
  • 10,221
  • 3
  • 55
  • 76

1 Answers1

1

Given this code in ExecutionService:

Map<Boolean, List<Tasklet>> byCooperation = 
     tasklets.stream().collect(partitioningBy(Tasklet::isCooperative));

and given the implementation of ProcessorTasklet::isCooperative:

return processor.isCooperative();

each individual instance of processor will be handled according to its cooperativeness. The execution service actually doesn't care which tasklets belong to the same vertex and treats each one according to its declaration of cooperativeness.

In short: yes, you can have a mix of cooperative/noncooperative processors for the same vertex.

Marko Topolnik
  • 195,646
  • 29
  • 319
  • 436