Class DistributedExecutionContext

java.lang.Object
org.episteme.core.distributed.DistributedExecutionContext
All Implemented Interfaces:
AutoCloseable, ExecutionContext

public class DistributedExecutionContext extends Object implements ExecutionContext
Execution context adapter that bridges DistributedContext with the ExecutionContext interface.

This allows distributed contexts (MPI, Spark, local) to be used within the unified backend execution model.

Since:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • DistributedExecutionContext

      public DistributedExecutionContext(DistributedContext delegate)
      Creates a new distributed execution context wrapping the given delegate.
      Parameters:
      delegate - the underlying distributed context
  • Method Details

    • execute

      public <T> T execute(Operation<T> operation)
      Description copied from interface: ExecutionContext
      Executes an operation synchronously and returns the result.
      Specified by:
      execute in interface ExecutionContext
      Type Parameters:
      T - the result type
      Parameters:
      operation - the operation to execute
      Returns:
      the operation result
    • executeAsync

      public <T> CompletableFuture<T> executeAsync(Operation<T> operation)
      Description copied from interface: ExecutionContext
      Executes an operation asynchronously.
      Specified by:
      executeAsync in interface ExecutionContext
      Type Parameters:
      T - the result type
      Parameters:
      operation - the operation to execute
      Returns:
      a future representing the pending result
    • getDistributedContext

      public DistributedContext getDistributedContext()
      Returns the underlying distributed context.
      Returns:
      the delegate context
    • getParallelism

      public int getParallelism()
      Returns the parallelism level of the underlying context.
      Returns:
      available processing nodes or cores
    • close

      public void close()
      Description copied from interface: ExecutionContext
      Releases resources associated with this context.

      This method is called automatically when used in try-with-resources.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ExecutionContext