Interface DistributedTask<I extends Serializable, O extends Serializable>
- Type Parameters:
I- Input type (must be Serializable for network transfer)O- Output type (must be Serializable for network transfer)
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CrisprTask, DistributedEconomyTask, DnaFoldingTask, FluidSimTask, GeneralCirculationModelTask, GeopoliticalEngineTask, MandelbrotTask, MolecularDynamicsTask, MonteCarloPiTask, NBodyTask, ProteinFoldingTask, WaveSimTask
Tasks implementing this interface can be dynamically dispatched by the Episteme distributed computing infrastructure. The server can send task implementations to workers on-demand, eliminating the need for hardcoded task handlers.
Example usage:
public class MandelbrotTask implements DistributedTask<MandelbrotInput, double[]> {
@Override
public String getTaskType() {
return "MANDELBROT";
}
@Override
public double[] execute(MandelbrotInput input) {
// Compute Mandelbrot slice
return result;
}
}
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionExecutes the computation for the given input chunk.default intReturns the estimated computational complexity.default StringReturns a human-readable description of this task.Returns the expected input type class.Returns the expected output type class.Returns the unique task type identifier.default booleanIndicates whether this task can utilize GPU acceleration.
-
Method Details
-
getTaskType
String getTaskType()Returns the unique task type identifier.This identifier is used by the task registry to locate and instantiate the appropriate task implementation. Examples: "MANDELBROT", "PROTEIN_FOLDING", "N_BODY", "CLIMATE_MODEL".
- Returns:
- the task type identifier (non-null, uppercase with underscores)
-
execute
Executes the computation for the given input chunk.This method contains the core scientific algorithm. It receives a chunk of input data and returns the computed result. The infrastructure handles serialization, network transfer, and result aggregation.
- Parameters:
input- the input data for this computation chunk- Returns:
- the computed result
- Throws:
ComputationException- if the computation fails
-
getInputType
-
getOutputType
-
getDescription
Returns a human-readable description of this task.Displayed in monitoring UIs (GridMonitor, DataLake browser).
- Returns:
- a brief description of what this task computes
-
getComplexity
default int getComplexity()Returns the estimated computational complexity.Used by the scheduler to balance load across workers. Higher values indicate more intensive computation.
- Returns:
- complexity score (1-100, default 50)
-
supportsGPU
default boolean supportsGPU()Indicates whether this task can utilize GPU acceleration.If true, the worker may route this task to a GPU-enabled backend if available.
- Returns:
- true if GPU execution is supported
-