From 82cb9e9f125359604eee3c06d088e754380e412a Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Tue, 6 Feb 2024 16:17:13 +0800 Subject: [PATCH] move connector result Signed-off-by: Bugen Zhao --- src/connector/src/error.rs | 2 ++ .../src/source/cdc/external/mock_external_table.rs | 5 ++--- src/connector/src/source/cdc/external/mod.rs | 4 +--- src/connector/src/source/cdc/external/postgres.rs | 6 +++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/connector/src/error.rs b/src/connector/src/error.rs index 08b538568712f..99aaa15d871ca 100644 --- a/src/connector/src/error.rs +++ b/src/connector/src/error.rs @@ -22,3 +22,5 @@ def_anyhow_newtype! { /// application and callers may not expect to handle it in a fine-grained way. pub ConnectorError; } + +pub type ConnectorResult = std::result::Result; diff --git a/src/connector/src/source/cdc/external/mock_external_table.rs b/src/connector/src/source/cdc/external/mock_external_table.rs index 2c8ee00f67af9..d7c39e2a9aa8b 100644 --- a/src/connector/src/source/cdc/external/mock_external_table.rs +++ b/src/connector/src/source/cdc/external/mock_external_table.rs @@ -19,10 +19,9 @@ use futures_async_stream::try_stream; use risingwave_common::row::OwnedRow; use risingwave_common::types::ScalarImpl; -use crate::error::ConnectorError; +use crate::error::{ConnectorError, ConnectorResult}; use crate::source::cdc::external::{ - CdcOffset, CdcOffsetParseFunc, ConnectorResult, ExternalTableReader, MySqlOffset, - SchemaTableName, + CdcOffset, CdcOffsetParseFunc, ExternalTableReader, MySqlOffset, SchemaTableName, }; #[derive(Debug)] diff --git a/src/connector/src/source/cdc/external/mod.rs b/src/connector/src/source/cdc/external/mod.rs index c9fe938da4b9f..f281d1ecea58a 100644 --- a/src/connector/src/source/cdc/external/mod.rs +++ b/src/connector/src/source/cdc/external/mod.rs @@ -32,13 +32,11 @@ use risingwave_common::types::DataType; use risingwave_common::util::iter_util::ZipEqFast; use serde_derive::{Deserialize, Serialize}; -use crate::error::ConnectorError; +use crate::error::{ConnectorError, ConnectorResult}; use crate::parser::mysql_row_to_owned_row; use crate::source::cdc::external::mock_external_table::MockExternalTableReader; use crate::source::cdc::external::postgres::{PostgresExternalTableReader, PostgresOffset}; -pub type ConnectorResult = std::result::Result; - #[derive(Debug)] pub enum CdcTableType { Undefined, diff --git a/src/connector/src/source/cdc/external/postgres.rs b/src/connector/src/source/cdc/external/postgres.rs index f8f0c9d402347..bd8a0b51c04e7 100644 --- a/src/connector/src/source/cdc/external/postgres.rs +++ b/src/connector/src/source/cdc/external/postgres.rs @@ -28,11 +28,11 @@ use thiserror_ext::AsReport; use tokio_postgres::types::PgLsn; use tokio_postgres::NoTls; -use crate::error::ConnectorError; +use crate::error::{ConnectorError, ConnectorResult}; use crate::parser::postgres_row_to_owned_row; use crate::source::cdc::external::{ - CdcOffset, CdcOffsetParseFunc, ConnectorResult, DebeziumOffset, ExternalTableConfig, - ExternalTableReader, SchemaTableName, + CdcOffset, CdcOffsetParseFunc, DebeziumOffset, ExternalTableConfig, ExternalTableReader, + SchemaTableName, }; #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]