Skip to content

Commit bb53d78

Browse files
authored
Merge branch 'main' into view-schema
2 parents fe9ba2d + 2c44fe4 commit bb53d78

File tree

66 files changed

+1106
-1919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1106
-1919
lines changed

Cargo.lock

Lines changed: 99 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/doc/00-overview/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Databend uses the latest techniques in vectorized query processing to allow you
2525

2626
- __Easy to Use__
2727

28-
Databend has no indexes to build, no manual tuning required, no manual figuring out partitions or shard data, it’s all done for you as data is loaded into the table.
28+
No manual tuning is required. You don't need to manually index, partition, or shard the data. Once you load your data into a table, Databend will handle everything else.
2929

3030
## Design Overview
3131

src/binaries/query/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ async fn main_entrypoint() -> Result<()> {
180180

181181
// Cluster register.
182182
{
183-
let cluster_discovery = ClusterDiscovery::instance();
184-
let register_to_metastore = cluster_discovery.register_to_metastore(&conf);
185-
register_to_metastore.await?;
183+
ClusterDiscovery::instance()
184+
.register_to_metastore(&conf)
185+
.await?;
186186
info!(
187187
"Databend query has been registered:{:?} to metasrv:{:?}.",
188188
conf.query.cluster_id, conf.meta.endpoints

src/common/base/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ futures = "0.3.24"
3434
libc = "0.2.133"
3535
num_cpus = "1.13.1"
3636
once_cell = "1.15.0"
37+
parking_lot = "0.12"
3738
pin-project-lite = "0.2.9"
3839
pprof = { version = "0.10.1", features = [
3940
"flamegraph",
@@ -42,6 +43,7 @@ pprof = { version = "0.10.1", features = [
4243
] }
4344
semver = "1.0.10"
4445
serde = { workspace = true }
46+
state = "0.5"
4547
tikv-jemalloc-ctl = { version = "0.5.0", optional = true }
4648
tikv-jemalloc-sys = "0.5.2"
4749
tokio = { version = "1.21.1", features = ["full"] }

src/common/base/src/base/global_runtime.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,25 @@
1515
use std::sync::Arc;
1616

1717
use common_exception::Result;
18-
use once_cell::sync::OnceCell;
1918

20-
use crate::base::singleton_instance::Singleton;
19+
use super::GlobalInstance;
2120
use crate::base::Runtime;
2221

2322
pub struct GlobalIORuntime;
2423

25-
static GLOBAL_RUNTIME: OnceCell<Singleton<Arc<Runtime>>> = OnceCell::new();
26-
2724
impl GlobalIORuntime {
28-
pub fn init(num_cpus: usize, v: Singleton<Arc<Runtime>>) -> Result<()> {
25+
pub fn init(num_cpus: usize) -> Result<()> {
2926
let thread_num = std::cmp::max(num_cpus, num_cpus::get() / 2);
3027
let thread_num = std::cmp::max(2, thread_num);
3128

32-
v.init(Arc::new(Runtime::with_worker_threads(
29+
GlobalInstance::set(Arc::new(Runtime::with_worker_threads(
3330
thread_num,
3431
Some("IO-worker".to_owned()),
35-
)?))?;
36-
37-
GLOBAL_RUNTIME.set(v.clone()).ok();
32+
)?));
3833
Ok(())
3934
}
4035

4136
pub fn instance() -> Arc<Runtime> {
42-
match GLOBAL_RUNTIME.get() {
43-
None => panic!("GlobalRuntime is not init"),
44-
Some(global_runtime) => global_runtime.get(),
45-
}
37+
GlobalInstance::get()
4638
}
4739
}

src/common/base/src/base/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ pub use shutdown_signal::signal_stream;
4949
pub use shutdown_signal::DummySignalStream;
5050
pub use shutdown_signal::SignalStream;
5151
pub use shutdown_signal::SignalType;
52-
pub use singleton_instance::Singleton;
53-
pub use singleton_instance::SingletonImpl;
52+
pub use singleton_instance::GlobalInstance;
5453
pub use stop_handle::StopHandle;
5554
pub use stoppable::Stoppable;
5655
pub use string_func::escape_for_key;

0 commit comments

Comments
 (0)