Skip to content

Commit

Permalink
chore: make dead_code into inner crate
Browse files Browse the repository at this point in the history
* chore: make dead_code into inner crate

Signed-off-by: Alex Chi <[email protected]>

* remove unused deps

Signed-off-by: Alex Chi <[email protected]>

* ignore tests

Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh authored Jan 28, 2022
1 parent 5f077b9 commit daf29d9
Show file tree
Hide file tree
Showing 61 changed files with 86 additions and 142 deletions.
37 changes: 7 additions & 30 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion rust/batch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ version = "0.1.1"
anyhow = "1"
async-stream = "0.3"
async-trait = "0.1"
backtrace = "0.3"
byteorder = "1"
bytes = "1"
chrono = "0.4"
Expand Down
1 change: 0 additions & 1 deletion rust/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
anyhow = "1"
async-stream = "0.3"
async-trait = "0.1"
backtrace = "0.3"
byteorder = "1"
bytes = "1"
chrono = "0.4"
Expand Down
7 changes: 1 addition & 6 deletions rust/connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ aws-sdk-kinesis = "0.4.1"
aws-smithy-http = "0.34.0"
aws-smithy-types = "0.32.0"
aws-types = { version = "0.4.1", features = ["hardcoded-credentials"] }
backtrace = "0.3"
byteorder = "1"
bytes = { version = "1", features = ["serde"] }
chrono = "0.4"
Expand All @@ -22,7 +21,6 @@ either = "1"
farmhash = "1"
futures = { version = "0.3", default-features = false, features = ["alloc"] }
http = "0.2.6"
httpmock = "0.6.5"
hyper = "0.14.16"
itertools = "0.10"
lazy_static = "1"
Expand All @@ -31,17 +29,13 @@ memcomparable = { path = "../utils/memcomparable" }
num-traits = "0.2"
paste = "1"
prost = "0.9"
prost-types = "0.9"
protobuf = "2"
protobuf-codegen-pure = "2.25.2"
pulsar = { git = "https://github.com/shanicky/pulsar-rs.git", rev = "3b6353943833057f4379a354c1754a4e86fa57ff" }
rdkafka = { version = "0.28", features = ["cmake-build"] }
risingwave-pb = { path = "../prost" }
risingwave_common = { path = "../common" }
risingwave_storage = { path = "../storage" }
serde = { version = "1", features = ["derive"] }
serde-protobuf = "0.8"
serde-value = "0.7"
serde_derive = "1"
serde_json = "1"
serde_with = "1"
Expand All @@ -58,5 +52,6 @@ urlencoding = "2.1.0"

[dev-dependencies]
assert_matches = "1"
httpmock = "0.6.5"
rand = "0.8"
tempfile = "3"
1 change: 0 additions & 1 deletion rust/frontend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ risingwave_meta = { path = "../meta" }
risingwave_rpc_client = { path = "../rpc_client" }
risingwave_source = { path = "../source" }
risingwave_sqlparser = { path = "../sqlparser" }
serial_test = "*"
smallvec = { version = "1.6.1", features = ["serde"] }
thiserror = "1"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "sync", "macros", "time", "signal", "fs"] }
Expand Down
3 changes: 0 additions & 3 deletions rust/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ async-recursion = "0.2"
async-stream = "0.3"
async-trait = "0.1"
axum = "0.4"
backtrace = "0.3"
bincode = "1.3.3"
byteorder = "1"
bytes = { version = "1", features = ["serde"] }
Expand All @@ -28,8 +27,6 @@ num-integer = "0.1"
num-traits = "0.2"
paste = "1"
prost = "0.9"
prost-types = "0.9"
rdkafka = "0.28.0"
risingwave-pb = { path = "../prost" }
risingwave_common = { path = "../common" }
risingwave_rpc_client = { path = "../rpc_client" }
Expand Down
3 changes: 3 additions & 0 deletions rust/meta/src/barrier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Scheduled = (Command, Notifier);
/// store, some actions like "drop materialized view" or "create mv on mv" must be done in barrier
/// manager transactionally using [`Command`].
pub struct BarrierManager {
#[allow(dead_code)]
cluster_manager: Arc<StoredClusterManager>,

stream_meta_manager: StreamMetaManagerRef,
Expand Down Expand Up @@ -198,11 +199,13 @@ impl BarrierManager {
}

/// Schedule a command and return immediately.
#[allow(dead_code)]
pub async fn schedule_command(&self, command: Command) -> Result<()> {
self.do_schedule(command, Default::default())
}

/// Schedule a command and return when its coresponding barrier is about to sent.
#[allow(dead_code)]
pub async fn issue_command(&self, command: Command) -> Result<()> {
let (tx, rx) = oneshot::channel();
self.do_schedule(
Expand Down
7 changes: 0 additions & 7 deletions rust/meta/src/dashboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ pub struct DashboardService {

pub type Service = Arc<DashboardService>;

async fn handle_error(error: anyhow::Error) -> (StatusCode, String) {
(
StatusCode::INTERNAL_SERVER_ERROR,
format!("Internal error: {:?}", error),
)
}

mod handlers {
use axum::Json;
use risingwave_pb::common::WorkerNode;
Expand Down
2 changes: 2 additions & 0 deletions rust/meta/src/hummock/compaction.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

use bytes::Bytes;
use itertools::{EitherOrBoth, Itertools};
use risingwave_common::error::Result;
Expand Down
2 changes: 2 additions & 0 deletions rust/meta/src/hummock/hummock_manager.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

use std::collections::HashMap;
use std::ops::Add;
use std::sync::{Arc, Weak};
Expand Down
1 change: 0 additions & 1 deletion rust/meta/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
#![warn(clippy::disallowed_methods)]
#![warn(clippy::doc_markdown)]
#![warn(clippy::explicit_into_iter_loop)]
Expand Down
2 changes: 2 additions & 0 deletions rust/meta/src/manager/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

/// Column family name for table.
const TABLE_CF_NAME: &str = "cf/table";
/// Column family name for schema.
Expand Down
1 change: 1 addition & 0 deletions rust/meta/src/manager/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl MetaSrvEnv {
self.config.clone()
}

#[allow(dead_code)]
pub fn meta_store(&self) -> &dyn MetaStore {
&*self.meta_store
}
Expand Down
4 changes: 0 additions & 4 deletions rust/meta/src/manager/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ use risingwave_common::error::Result;
/// Epoch keeping for some specific key types.
pub(crate) const SINGLE_VERSION_EPOCH: Epoch = Epoch(0);

pub(crate) const MAX_NAMING_EPOCH: Epoch = Epoch(50);

pub const MIN_EPOCH: Epoch = Epoch(0);
pub const MAX_EPOCH: Epoch = Epoch(u64::MAX);
pub const EPOCH_PHYSICAL_SHIFT_BITS: u8 = 16;

#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd, Hash, Debug)]
Expand Down
2 changes: 0 additions & 2 deletions rust/meta/src/manager/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub trait IdGenerator: Sync + Send + 'static {
}
}

pub type IdGeneratorRef = Box<dyn IdGenerator>;

/// [`StoredIdGenerator`] implements id generator using metastore.
pub struct StoredIdGenerator {
meta_store_ref: MetaStoreRef,
Expand Down
14 changes: 1 addition & 13 deletions rust/meta/src/model/cluster.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use risingwave_common::error::Result;
use risingwave_pb::common::{HostAddress, WorkerNode, WorkerType};
use risingwave_pb::common::{HostAddress, WorkerNode};

use crate::model::MetadataModel;
use crate::storage::MetaStoreRef;

/// Column family name for cluster.
const WORKER_CF_NAME: &str = "cf/worker";
Expand Down Expand Up @@ -30,14 +29,3 @@ impl MetadataModel for Worker {
Ok(self.0.get_host()?.clone())
}
}

impl Worker {
/// TODO: refine this when metastore support prefix scan, using type as its key prefix.
pub async fn filter(store: &MetaStoreRef, r#type: WorkerType) -> Result<Vec<Self>> {
let workers = Self::list(store).await?;
Ok(workers
.into_iter()
.filter(|w| w.0.r#type == r#type as i32)
.collect::<Vec<_>>())
}
}
2 changes: 2 additions & 0 deletions rust/meta/src/rpc/service/stream_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub struct StreamServiceImpl {

id_gen_manager_ref: IdGeneratorManagerRef,
cluster_manager: Arc<StoredClusterManager>,

#[allow(dead_code)]
epoch_generator: EpochGeneratorRef,
}

Expand Down
2 changes: 1 addition & 1 deletion rust/meta/src/storage/metastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ pub enum OperationOption {
}

pub type MetaStoreRef = Arc<dyn MetaStore>;
pub type BoxedTransaction = Box<dyn Transaction>;

// TODO: introduce etcd as storage engine here.

Expand Down Expand Up @@ -165,6 +164,7 @@ pub struct MemStore {
}

impl MemStore {
#[cfg(test)]
pub fn new() -> Self {
MemStore {
entities: Mutex::new(HashMap::new()),
Expand Down
1 change: 1 addition & 0 deletions rust/meta/src/storage/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub enum Operation {

/// Preconditions are checked in the beginning of a transaction
pub enum Precondition {
#[allow(dead_code)]
KeyExists {
key: Key,
/// If version is None, a default global version is used.
Expand Down
Loading

0 comments on commit daf29d9

Please sign in to comment.