mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-08 22:32:55 +00:00
feat: introduce reconciliation interface (#6614)
* feat: introduce reconcile interface Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: apply suggestions from CR Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: apply suggestions from CR Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: upgrade proto Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use api::v1::meta::ReconcileRequest;
|
||||
use async_trait::async_trait;
|
||||
use catalog::CatalogManagerRef;
|
||||
use common_error::ext::BoxedError;
|
||||
@@ -57,6 +58,17 @@ impl ProcedureServiceHandler for ProcedureServiceOperator {
|
||||
.map(|pid| String::from_utf8_lossy(&pid.key).to_string()))
|
||||
}
|
||||
|
||||
async fn reconcile(&self, request: ReconcileRequest) -> QueryResult<Option<String>> {
|
||||
Ok(self
|
||||
.procedure_executor
|
||||
.reconcile(&ExecutorContext::default(), request)
|
||||
.await
|
||||
.map_err(BoxedError::new)
|
||||
.context(query_error::ProcedureServiceSnafu)?
|
||||
.pid
|
||||
.map(|pid| String::from_utf8_lossy(&pid.key).to_string()))
|
||||
}
|
||||
|
||||
async fn query_procedure_state(&self, pid: &str) -> QueryResult<ProcedureStateResponse> {
|
||||
self.procedure_executor
|
||||
.query_procedure_state(&ExecutorContext::default(), pid)
|
||||
|
||||
Reference in New Issue
Block a user