use async_trait::async_trait;
use nodedb_cluster::distributed_array::wire::{
ArrayShardAggReq, ArrayShardDeleteReq, ArrayShardPutReq,
};
use nodedb_cluster::distributed_array::{ArrayAggExec, ArrayLocalExecutor, ArraySliceExec};
use nodedb_cluster::error::Result;
use super::executor::DataPlaneArrayExecutor;
#[async_trait]
impl ArrayLocalExecutor for DataPlaneArrayExecutor {
async fn exec_slice(
&self,
req: &nodedb_cluster::distributed_array::wire::ArrayShardSliceReq,
) -> Result<ArraySliceExec> {
self.slice(req).await
}
async fn exec_agg(&self, req: &ArrayShardAggReq) -> Result<ArrayAggExec> {
self.agg(req).await
}
async fn exec_put(&self, req: &ArrayShardPutReq) -> Result<u64> {
self.put(req).await
}
async fn exec_delete(&self, req: &ArrayShardDeleteReq) -> Result<u64> {
self.delete(req).await
}
async fn exec_surrogate_bitmap_scan(
&self,
array_id_msgpack: &[u8],
slice_msgpack: &[u8],
) -> Result<Vec<u8>> {
self.surrogate_bitmap_scan(array_id_msgpack, slice_msgpack)
.await
}
}