Dispatch an incoming array shard RPC to the appropriate local handler. `opcode` is the `VShardMessageType` discriminant (u16). `local_vshard_id` is this shard's own vShard ID (for routing validation). `payload` is the zerompk-encoded request body. `executor` reaches into the local Data Plane array engine. Returns the zerompk-encoded response body on success, ready to be placed into a response `V
(
opcode: u32,
local_vshard_id: u32,
payload: &[u8],
executor: &Arc<dyn ArrayLocalExecutor>,
)
| 39 | /// Returns the zerompk-encoded response body on success, ready to be placed |
| 40 | /// into a response `VShardEnvelope`. |
| 41 | pub async fn handle_array_shard_rpc( |
| 42 | opcode: u32, |
| 43 | local_vshard_id: u32, |
| 44 | payload: &[u8], |
| 45 | executor: &Arc<dyn ArrayLocalExecutor>, |
| 46 | ) -> Result<Vec<u8>> { |
| 47 | match opcode { |
| 48 | ARRAY_SHARD_SLICE_REQ => handle_slice(local_vshard_id, payload, executor).await, |
| 49 | ARRAY_SHARD_AGG_REQ => handle_agg(local_vshard_id, payload, executor).await, |
| 50 | ARRAY_SHARD_PUT_REQ => handle_put(local_vshard_id, payload, executor).await, |
| 51 | ARRAY_SHARD_DELETE_REQ => handle_delete(local_vshard_id, payload, executor).await, |
| 52 | ARRAY_SHARD_SURROGATE_BITMAP_REQ => { |
| 53 | handle_surrogate_bitmap(local_vshard_id, payload, executor).await |
| 54 | } |
| 55 | other => Err(ClusterError::Codec { |
| 56 | detail: format!("handle_array_shard_rpc: unknown opcode {other}"), |
| 57 | }), |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | async fn handle_slice( |
| 62 | local_vshard_id: u32, |
no test coverage detected