/**
* To be used by the JobCoordinator to generator ProcessorId
* It can be configured by using a configuration - app.processor-id-generator.class
*/
public interface ProcessorIdGenerator {
/**
* Generates a String representation to identify the processor instance
* This value can be representative of its current executing environment. It can also be custom-managed by the user.
* **Note**: processorId has to be unique among the processors within a job
* @return String , identifier for the processor
*/
String generateProcessorId();
}
// Default (after 0.13+)
public class UUIDGenerator implements ProcessorIdGenerator {
String generateProcessorId() {
return UUID.randomUUID();
}
} |