Class ExecutorServiceHandler
java.lang.Object
com.loomcache.server.handler.ExecutorServiceHandler
Local protocol handler for executor service operations.
Executes incoming EXECUTOR_* messages against a node-local
DistributedExecutorService instance obtained from the
DataStructureRegistry. Cluster entry points must only expose these
operations when they are modeled safely for Raft replication; otherwise
requests must be rejected before reaching this handler.
Message Format
- mapName — executor service name
- key — task ID (for cancel/status/result) or routing key (for submitToKey)
- value — Kryo-serialized
Callable(for submit operations) or target member ID (for submitToMember)
Supported Operations
- EXECUTOR_SUBMIT — submit a task, returns task ID
- EXECUTOR_SUBMIT_TO_KEY — submit a task routed to a key owner
- EXECUTOR_SUBMIT_TO_MEMBER — submit a task to a specific member
- EXECUTOR_SUBMIT_TO_ALL — submit a task to all members (local only)
- EXECUTOR_CANCEL — cancel a task by ID
- EXECUTOR_STATUS — query task status
- EXECUTOR_RESULT — retrieve task result
- EXECUTOR_SHUTDOWN — shut down a named executor
- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer) Create an executor service handler.ExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer, ExecutorTaskAllowlist taskAllowlist) ExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer, ExecutorTaskAllowlist taskAllowlist, BooleanSupplier executionEnabled) ExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer, ExecutorTaskAllowlist taskAllowlist, BooleanSupplier executionEnabled, int maxTaskPayloadBytes) -
Method Summary
Modifier and TypeMethodDescription@Nullable MessageHandle an executor service operation message.static booleanisExecutorOperation(@Nullable MessageType type) Check whether the given message type is an executor operation.
-
Constructor Details
-
ExecutorServiceHandler
public ExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer) Create an executor service handler.- Parameters:
registry- the data structure registry for executor lookupinstanceNumber- the node instance number (for logging)kryoSerializer- the Kryo serializer for task deserialization
-
ExecutorServiceHandler
public ExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer, ExecutorTaskAllowlist taskAllowlist) -
ExecutorServiceHandler
public ExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer, ExecutorTaskAllowlist taskAllowlist, BooleanSupplier executionEnabled) -
ExecutorServiceHandler
public ExecutorServiceHandler(DataStructureRegistry registry, int instanceNumber, KryoSerializer kryoSerializer, ExecutorTaskAllowlist taskAllowlist, BooleanSupplier executionEnabled, int maxTaskPayloadBytes)
-
-
Method Details
-
handle
-
isExecutorOperation
Check whether the given message type is an executor operation.- Parameters:
type- the message type to check- Returns:
- true if this is an EXECUTOR_* operation
-