1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::sinks::prelude::*;

// sub level implementations
mod logs;
mod metrics;

fn default_dbname() -> String {
    greptimedb_ingester::DEFAULT_SCHEMA_NAME.to_string()
}

fn default_dbname_template() -> Template {
    Template::try_from(default_dbname()).unwrap()
}

fn default_pipeline_template() -> Template {
    Template::try_from("greptime_identity").unwrap()
}

#[derive(Clone, Copy, Debug, Default)]
struct GreptimeDBDefaultBatchSettings;

impl SinkBatchSettings for GreptimeDBDefaultBatchSettings {
    const MAX_EVENTS: Option<usize> = Some(20);
    const MAX_BYTES: Option<usize> = None;
    const TIMEOUT_SECS: f64 = 1.0;
}