mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-01 04:40:39 +00:00
feat: enable concurrent write (#3214)
* feat: enable concurrent write * chore: apply suggestions from CR * chore: apply suggestions from CR
This commit is contained in:
@@ -43,6 +43,9 @@ use crate::statement::StatementExecutor;
|
||||
/// Buffer size to flush data to object stores.
|
||||
const WRITE_BUFFER_THRESHOLD: ReadableSize = ReadableSize::mb(8);
|
||||
|
||||
/// Default number of concurrent write, it only works on object store backend(e.g., S3).
|
||||
const WRITE_CONCURRENCY: usize = 8;
|
||||
|
||||
impl StatementExecutor {
|
||||
async fn stream_to_file(
|
||||
&self,
|
||||
@@ -59,6 +62,7 @@ impl StatementExecutor {
|
||||
object_store,
|
||||
path,
|
||||
threshold,
|
||||
WRITE_CONCURRENCY,
|
||||
)
|
||||
.await
|
||||
.context(error::WriteStreamToFileSnafu { path }),
|
||||
@@ -67,6 +71,7 @@ impl StatementExecutor {
|
||||
object_store,
|
||||
path,
|
||||
threshold,
|
||||
WRITE_CONCURRENCY,
|
||||
)
|
||||
.await
|
||||
.context(error::WriteStreamToFileSnafu { path }),
|
||||
@@ -75,6 +80,7 @@ impl StatementExecutor {
|
||||
object_store,
|
||||
path,
|
||||
threshold,
|
||||
WRITE_CONCURRENCY,
|
||||
)
|
||||
.await
|
||||
.context(error::WriteStreamToFileSnafu { path }),
|
||||
|
||||
Reference in New Issue
Block a user