Skip to content

Commit

Permalink
chore: refine raft-types import path (#16764)
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer authored Nov 6, 2024
1 parent 3797fb6 commit 8b59fb0
Show file tree
Hide file tree
Showing 66 changed files with 202 additions and 238 deletions.
14 changes: 7 additions & 7 deletions src/meta/binaries/metactl/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ use databend_common_meta_sled_store::get_sled_db;
use databend_common_meta_sled_store::init_sled_db;
use databend_common_meta_sled_store::openraft::storage::RaftLogStorageExt;
use databend_common_meta_sled_store::openraft::RaftSnapshotBuilder;
use databend_common_meta_types::raft_types::CommittedLeaderId;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::EntryPayload;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::Membership;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::sys_data::SysData;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::CommittedLeaderId;
use databend_common_meta_types::Endpoint;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EntryPayload;
use databend_common_meta_types::LogEntry;
use databend_common_meta_types::LogId;
use databend_common_meta_types::Membership;
use databend_common_meta_types::Node;
use databend_common_meta_types::NodeId;
use databend_common_meta_types::StoredMembership;
use databend_meta::store::RaftStore;
use url::Url;

Expand Down
2 changes: 1 addition & 1 deletion src/meta/process/src/kv_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

use anyhow::Error;
use databend_common_meta_raft_store::key_spaces::RaftStoreEntry;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::seq_value::SeqV;
use databend_common_meta_types::txn_condition::Target;
use databend_common_meta_types::txn_op::Request;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::Entry;
use databend_common_meta_types::LogEntry;
use databend_common_meta_types::Operation;
use databend_common_meta_types::TxnCondition;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/applier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ use std::time::Duration;

use databend_common_base::display::display_unix_epoch::DisplayUnixTimeStampExt;
use databend_common_meta_types::protobuf as pb;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::EntryPayload;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::seq_value::SeqV;
use databend_common_meta_types::seq_value::SeqValue;
use databend_common_meta_types::txn_condition;
Expand All @@ -27,13 +30,10 @@ use databend_common_meta_types::Change;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::CmdContext;
use databend_common_meta_types::ConditionResult;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EntryPayload;
use databend_common_meta_types::Interval;
use databend_common_meta_types::MatchSeq;
use databend_common_meta_types::MetaSpec;
use databend_common_meta_types::Node;
use databend_common_meta_types::StoredMembership;
use databend_common_meta_types::TxnCondition;
use databend_common_meta_types::TxnDeleteByPrefixRequest;
use databend_common_meta_types::TxnDeleteByPrefixResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/meta/raft-store/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use std::sync::LazyLock;

use databend_common_exception::Result;
use databend_common_grpc::DNSResolver;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::Endpoint;
use databend_common_meta_types::MetaStartupError;
use databend_common_meta_types::NodeId;

pub static DATABEND_COMMIT_VERSION: LazyLock<String> = LazyLock::new(|| {
let build_semver = option_env!("VERGEN_BUILD_SEMVER");
Expand Down
8 changes: 4 additions & 4 deletions src/meta/raft-store/src/key_spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ use databend_common_meta_sled_store::SledKeySpace;
use databend_common_meta_sled_store::SledOrderedSerde;
use databend_common_meta_sled_store::SledSerde;
use databend_common_meta_stoerr::MetaStorageError;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::LogIndex;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::seq_value::SeqV;
use databend_common_meta_types::Entry;
use databend_common_meta_types::LogId;
use databend_common_meta_types::LogIndex;
use databend_common_meta_types::Node;
use databend_common_meta_types::NodeId;
use databend_common_meta_types::SeqNum;
use serde::Deserialize;
use serde::Serialize;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/leveled_store/sys_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

use std::collections::BTreeMap;

use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::sys_data::SysData;
use databend_common_meta_types::LogId;
use databend_common_meta_types::Node;
use databend_common_meta_types::NodeId;
use databend_common_meta_types::StoredMembership;

use crate::leveled_store::sys_data_api::SysDataApiRO;

Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/leveled_store/sys_data_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

use std::collections::BTreeMap;

use databend_common_meta_types::LogId;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::Node;
use databend_common_meta_types::NodeId;
use databend_common_meta_types::StoredMembership;

/// APIs to access the non-user-data of the state machine(leveled map).
pub trait SysDataApiRO {
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/log/raft_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use databend_common_meta_sled_store::sled;
use databend_common_meta_sled_store::AsKeySpace;
use databend_common_meta_sled_store::SledTree;
use databend_common_meta_stoerr::MetaStorageError;
use databend_common_meta_types::Entry;
use databend_common_meta_types::LogId;
use databend_common_meta_types::LogIndex;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::LogIndex;
use log::info;

use crate::config::RaftConfig;
Expand Down
4 changes: 2 additions & 2 deletions src/meta/raft-store/src/sm_v003/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use std::iter::repeat_with;
use std::sync::Arc;
use std::sync::Mutex;

use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::snapshot_db::DB;
use databend_common_meta_types::sys_data::SysData;
use databend_common_meta_types::LogId;
use databend_common_meta_types::SnapshotData;
use databend_common_meta_types::StoredMembership;
use itertools::Itertools;
use log::info;
use openraft::SnapshotId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use databend_common_meta_types::raft_types::Membership;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::seq_value::KVMeta;
use databend_common_meta_types::Endpoint;
use databend_common_meta_types::Membership;
use databend_common_meta_types::Node;
use databend_common_meta_types::StoredMembership;
use databend_common_meta_types::UpsertKV;
use futures_util::TryStreamExt;
use maplit::btreemap;
Expand Down
4 changes: 2 additions & 2 deletions src/meta/raft-store/src/sm_v003/compact_with_db_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

use std::io;

use databend_common_meta_types::raft_types::Membership;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::seq_value::KVMeta;
use databend_common_meta_types::Endpoint;
use databend_common_meta_types::Membership;
use databend_common_meta_types::Node;
use databend_common_meta_types::StoredMembership;
use databend_common_meta_types::UpsertKV;
use futures_util::TryStreamExt;
use maplit::btreemap;
Expand Down
4 changes: 2 additions & 2 deletions src/meta/raft-store/src/sm_v003/received.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

use std::fmt;

use databend_common_meta_types::SnapshotMeta;
use databend_common_meta_types::Vote;
use databend_common_meta_types::raft_types::SnapshotMeta;
use databend_common_meta_types::raft_types::Vote;

/// Contains information about a received snapshot data.
#[derive(Debug)]
Expand Down
4 changes: 2 additions & 2 deletions src/meta/raft-store/src/sm_v003/receiver_v003.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use std::io::BufWriter;
use std::io::Write;

use databend_common_meta_types::protobuf::SnapshotChunkRequestV003;
use databend_common_meta_types::SnapshotMeta;
use databend_common_meta_types::Vote;
use databend_common_meta_types::raft_types::SnapshotMeta;
use databend_common_meta_types::raft_types::Vote;
use log::debug;
use log::error;
use log::info;
Expand Down
4 changes: 2 additions & 2 deletions src/meta/raft-store/src/sm_v003/sm_v003.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ use databend_common_meta_kvapi::kvapi::KVStream;
use databend_common_meta_kvapi::kvapi::UpsertKVReply;
use databend_common_meta_kvapi::kvapi::UpsertKVReq;
use databend_common_meta_types::protobuf::StreamItem;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::StorageError;
use databend_common_meta_types::seq_value::SeqV;
use databend_common_meta_types::seq_value::SeqValue;
use databend_common_meta_types::snapshot_db::DB;
use databend_common_meta_types::sys_data::SysData;
use databend_common_meta_types::AppliedState;
use databend_common_meta_types::CmdContext;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EvalExpireTime;
use databend_common_meta_types::MatchSeqExt;
use databend_common_meta_types::Operation;
use databend_common_meta_types::StorageError;
use databend_common_meta_types::TxnReply;
use databend_common_meta_types::TxnRequest;
use databend_common_meta_types::UpsertKV;
Expand Down
4 changes: 2 additions & 2 deletions src/meta/raft-store/src/sm_v003/snapshot_store_v002.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use std::io;
use std::str::FromStr;

use databend_common_meta_stoerr::MetaStorageError;
use databend_common_meta_types::ErrorSubject;
use databend_common_meta_types::raft_types::ErrorSubject;
use databend_common_meta_types::raft_types::StorageError;
use databend_common_meta_types::SnapshotData;
use databend_common_meta_types::StorageError;
use log::error;
use log::info;
use log::warn;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/state/raft_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ use databend_common_meta_sled_store::sled;
use databend_common_meta_sled_store::AsKeySpace;
use databend_common_meta_sled_store::SledTree;
use databend_common_meta_stoerr::MetaStorageError;
use databend_common_meta_types::LogId;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::raft_types::Vote;
use databend_common_meta_types::MetaStartupError;
use databend_common_meta_types::NodeId;
use databend_common_meta_types::Vote;
use log::debug;
use log::info;

Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/state/raft_state_kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use databend_common_meta_sled_store::SledBytesError;
use databend_common_meta_sled_store::SledOrderedSerde;
use databend_common_meta_sled_store::SledSerde;
use databend_common_meta_types::anyerror::AnyError;
use databend_common_meta_types::LogId;
use databend_common_meta_types::NodeId;
use databend_common_meta_types::Vote;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::raft_types::Vote;
use serde::Deserialize;
use serde::Serialize;
use sled::IVec;
Expand Down
2 changes: 1 addition & 1 deletion src/meta/raft-store/src/state_machine/log_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use databend_common_meta_sled_store::SledBytesError;
use databend_common_meta_sled_store::SledOrderedSerde;
use databend_common_meta_sled_store::SledSerde;
use databend_common_meta_types::anyerror::AnyError;
use databend_common_meta_types::LogId;
use databend_common_meta_types::raft_types::LogId;
use serde::Deserialize;
use serde::Serialize;
use sled::IVec;
Expand Down
10 changes: 5 additions & 5 deletions src/meta/raft-store/src/state_machine/sm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ use databend_common_meta_sled_store::Store;
use databend_common_meta_sled_store::TransactionSledTree;
use databend_common_meta_stoerr::MetaStorageError;
use databend_common_meta_types::protobuf as pb;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::EntryPayload;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::NodeId;
use databend_common_meta_types::raft_types::StoredMembership;
use databend_common_meta_types::seq_value::SeqV;
use databend_common_meta_types::seq_value::SeqValue;
use databend_common_meta_types::txn_condition;
Expand All @@ -38,17 +43,12 @@ use databend_common_meta_types::Change;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::CmdContext;
use databend_common_meta_types::ConditionResult;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EntryPayload;
use databend_common_meta_types::Interval;
use databend_common_meta_types::LogId;
use databend_common_meta_types::MatchSeq;
use databend_common_meta_types::MatchSeqExt;
use databend_common_meta_types::MetaSpec;
use databend_common_meta_types::Node;
use databend_common_meta_types::NodeId;
use databend_common_meta_types::Operation;
use databend_common_meta_types::StoredMembership;
use databend_common_meta_types::TxnCondition;
use databend_common_meta_types::TxnDeleteByPrefixRequest;
use databend_common_meta_types::TxnDeleteByPrefixResponse;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/state_machine/snapshot_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use std::str::FromStr;
use std::time::SystemTime;
use std::time::UNIX_EPOCH;

use databend_common_meta_types::new_log_id;
use databend_common_meta_types::LogId;
use databend_common_meta_types::raft_types::new_log_id;
use databend_common_meta_types::raft_types::LogId;

/// Structured snapshot id used by meta service
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
Expand Down Expand Up @@ -153,7 +153,7 @@ impl Display for MetaSnapshotId {
mod tests {
use std::str::FromStr;

use databend_common_meta_types::new_log_id;
use databend_common_meta_types::raft_types::new_log_id;

use crate::state_machine::snapshot_id::MetaSnapshotId;

Expand Down
4 changes: 2 additions & 2 deletions src/meta/raft-store/src/state_machine/state_machine_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use databend_common_meta_sled_store::SledBytesError;
use databend_common_meta_sled_store::SledOrderedSerde;
use databend_common_meta_sled_store::SledSerde;
use databend_common_meta_types::anyerror::AnyError;
use databend_common_meta_types::LogId;
use databend_common_meta_types::StoredMembership;
use databend_common_meta_types::raft_types::LogId;
use databend_common_meta_types::raft_types::StoredMembership;
use serde::Deserialize;
use serde::Serialize;
use sled::IVec;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/src/state_machine/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// limitations under the License.

use databend_common_meta_sled_store::openraft;
use databend_common_meta_types::new_log_id;
use databend_common_meta_types::raft_types::new_log_id;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::EntryPayload;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EntryPayload;
use databend_common_meta_types::LogEntry;
use databend_common_meta_types::RaftTxId;
use databend_common_meta_types::UpsertKV;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/tests/it/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// limitations under the License.

use databend_common_meta_raft_store::log::RaftLog;
use databend_common_meta_types::new_log_id;
use databend_common_meta_types::raft_types::new_log_id;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::EntryPayload;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EntryPayload;
use databend_common_meta_types::LogEntry;
use databend_common_meta_types::UpsertKV;
use test_harness::test;
Expand Down
2 changes: 1 addition & 1 deletion src/meta/raft-store/tests/it/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use databend_common_meta_raft_store::state::RaftState;
use databend_common_meta_types::Vote;
use databend_common_meta_types::raft_types::Vote;
use test_harness::test;

use crate::testing::new_raft_test_context;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/tests/it/state_machine/expire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ use databend_common_meta_raft_store::key_spaces::GenericKV;
use databend_common_meta_raft_store::state_machine::ExpireKey;
use databend_common_meta_raft_store::state_machine::StateMachine;
use databend_common_meta_sled_store::AsKeySpace;
use databend_common_meta_types::new_log_id;
use databend_common_meta_types::raft_types::new_log_id;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::EntryPayload;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EntryPayload;
use databend_common_meta_types::LogEntry;
use databend_common_meta_types::MetaSpec;
use databend_common_meta_types::UpsertKV;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/raft-store/tests/it/state_machine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ use std::time::UNIX_EPOCH;

use databend_common_meta_kvapi::kvapi::KVApi;
use databend_common_meta_raft_store::state_machine::StateMachine;
use databend_common_meta_types::new_log_id;
use databend_common_meta_types::raft_types::new_log_id;
use databend_common_meta_types::raft_types::Entry;
use databend_common_meta_types::raft_types::EntryPayload;
use databend_common_meta_types::seq_value::KVMeta;
use databend_common_meta_types::seq_value::SeqV;
use databend_common_meta_types::seq_value::SeqValue;
Expand All @@ -27,8 +29,6 @@ use databend_common_meta_types::Change;
use databend_common_meta_types::Cmd;
use databend_common_meta_types::CmdContext;
use databend_common_meta_types::Endpoint;
use databend_common_meta_types::Entry;
use databend_common_meta_types::EntryPayload;
use databend_common_meta_types::LogEntry;
use databend_common_meta_types::MatchSeq;
use databend_common_meta_types::MetaSpec;
Expand Down
Loading

0 comments on commit 8b59fb0

Please sign in to comment.