Class RemoteDistributedContext
java.lang.Object
org.episteme.core.distributed.RemoteDistributedContext
- All Implemented Interfaces:
DistributedContext
Remote implementation of DistributedContext (stub).
This class serves as a template/interface for future remote distributed computing implementations. Actual implementations could use:
- Java RMI for traditional remote method invocation
- gRPC for high-performance cross-language RPCs
- Apache Spark for large-scale data processing
- Hazelcast or GridGain for in-memory distributed computing
Serialization Requirements: Tasks submitted to this context MUST:
- Implement `Serializable` (enforced by API)
- Have all referenced classes/data serializable
- Not depend on non-serializable local state (e.g., ThreadLocal)
Math Context Propagation: The implementation should automatically capture the current `MathContext` when tasks are submitted and restore it on remote workers before execution.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested classes/interfaces inherited from interface DistributedContext
DistributedContext.Priority -
Constructor Summary
ConstructorsConstructorDescriptionRemoteDistributedContext(String[] remoteHosts, int port, boolean useEncryption) Creates a remote distributed context. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of available processing nodes or cores.<T extends Serializable>
List<Future<T>> Submits a collection of tasks for execution.voidshutdown()Shuts down the context.<T extends Serializable>
Future<T> Submits a task for execution with NORMAL priority.
-
Constructor Details
-
RemoteDistributedContext
Creates a remote distributed context.- Parameters:
remoteHosts- array of remote host addresses (e.g., ["192.168.1.10", "192.168.1.11"])port- communication portuseEncryption- whether to use TLS/SSL encryption
-
-
Method Details
-
submit
Description copied from interface:DistributedContextSubmits a task for execution with NORMAL priority.- Specified by:
submitin interfaceDistributedContext- Type Parameters:
T- Result type- Parameters:
task- Task to execute- Returns:
- Future representing the result
-
invokeAll
Description copied from interface:DistributedContextSubmits a collection of tasks for execution.- Specified by:
invokeAllin interfaceDistributedContext- Type Parameters:
T- Result type- Parameters:
tasks- List of tasks- Returns:
- List of Futures
-
getParallelism
public int getParallelism()Description copied from interface:DistributedContextReturns the number of available processing nodes or cores.- Specified by:
getParallelismin interfaceDistributedContext
-
shutdown
public void shutdown()Description copied from interface:DistributedContextShuts down the context.- Specified by:
shutdownin interfaceDistributedContext
-