Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Jul 23, 2024
1 parent 4239bdd commit e798d73
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use crate::hash::VirtualNode;

/// Use the maximum value for HTTP/2 connection window size to avoid deadlock among multiplexed
/// streams on the same connection.
pub const MAX_CONNECTION_WINDOW_SIZE: u32 = (1 << 31) - 2;
pub const MAX_CONNECTION_WINDOW_SIZE: u32 = (1 << 31) - 1;
/// Use a large value for HTTP/2 stream window size to improve the performance of remote exchange,
/// as we don't rely on this for back-pressure.
pub const STREAM_WINDOW_SIZE: u32 = 32 * 1024 * 1024; // 32 MB
Expand Down
2 changes: 1 addition & 1 deletion src/meta/node/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pub async fn start_service_as_election_leader(
prometheus_client,
prometheus_selector,
metadata_manager: metadata_manager.clone(),
compute_clients: ComputeClientPool::adhoc(), // TODO
compute_clients: ComputeClientPool::adhoc(),
diagnose_command,
trace_state,
};
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/manager/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ impl MetaSrvEnv {
meta_store_impl: MetaStoreImpl,
) -> MetaResult<Self> {
let idle_manager = Arc::new(IdleManager::new(opts.max_idle_ms));
let stream_client_pool = Arc::new(StreamClientPool::adhoc()); // TODO
let stream_client_pool = Arc::new(StreamClientPool::adhoc());
let event_log_manager = Arc::new(start_event_log_manager(
opts.event_log_enabled,
opts.event_log_channel_max_size,
Expand Down
5 changes: 5 additions & 0 deletions src/rpc_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,28 @@ impl<S> std::fmt::Debug for RpcClientPool<S> {
}
}

/// Intentionally not implementing `Default` to let callers be explicit about the pool size.
impl<S> !Default for RpcClientPool<S> {}

impl<S> RpcClientPool<S>
where
S: RpcClient,
{
/// Create a new pool with the given `connection_pool_size`, which is the number of
/// connections to each node that will be reused.
pub fn new(connection_pool_size: u16) -> Self {
Self {
connection_pool_size,
clients: Cache::new(u64::MAX),
}
}

/// Create a pool for testing purposes. Same as [`Self::adhoc`].
pub fn for_test() -> Self {
Self::adhoc()
}

/// Create a pool for ad-hoc usage, where the number of connections to each node is 1.
pub fn adhoc() -> Self {
Self::new(1)
}
Expand Down

0 comments on commit e798d73

Please sign in to comment.