diff --git a/README.md b/README.md index 626c2fe..0ee0998 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ * Author: rickyHuo * Homepage: https://github.com/RickyHuo/hangout-output-clickhouse -* Version: 0.0.2 +* Version: 0.0.3 ### Description @@ -12,33 +12,31 @@ | name | type | required | default value | | --- | --- | --- | --- | -| [host](#host-string) | string | yes | - | +| [bulk_size](#bulk_size-list) | int | no | 1000 | | [database](#database-string) | string | yes | - | -| [table](#table-string) | string | yes | - | | [fields](#fields-list) | list | yes | - | -| [bulk_size](#bulk_size-list) | int | no | 1000 | +| [host](#host-string) | string | yes | - | | [replace_include_fields](#replace_include_fields-list) | list | no | - | | [replace_exclude_fields](#replace_exclude_fields-list) | list | no | - | +| [table](#table-string) | string | yes | - | +| [username](#username-string) | string | yes | - | +| [password](#password-string) | string | yes | - | -##### host [string] +##### bulk_size [string] -ClickHouse cluster host +批次写入量,默认为1000 ##### database [string] database -##### table [string] - -table - ##### fields [list] table fields, 必须和Hangout清洗后的字段保持一致 -##### bulk_size [string] +##### host [string] -批次写入量,默认为1000 +ClickHouse cluster host ##### replace_include_fields [list] @@ -48,12 +46,26 @@ table fields, 必须和Hangout清洗后的字段保持一致 不需要执行替换'字符操作的字段列表 +##### table [string] + +table + +##### username [string] + +ClickHouse withCredit username + +##### password [string] + +ClickHouse withCredit password + ### Examples ``` outputs: - com.sina.bip.hangout.outputs.Clickhouse: host: clickhouse.bip.sina.com.cn:8123 + username: user + password: passwd database: apm table: apm_netdiagno fields: ['_device_id', '_ping_small', '_domain', '_traceroute', '_ping_big', 'date', 'ts', '_snet'] diff --git a/src/main/java/com/sina/bip/hangout/outputs/Clickhouse.java b/src/main/java/com/sina/bip/hangout/outputs/Clickhouse.java index e308052..2e9114e 100644 --- a/src/main/java/com/sina/bip/hangout/outputs/Clickhouse.java +++ b/src/main/java/com/sina/bip/hangout/outputs/Clickhouse.java @@ -65,13 +65,13 @@ protected void prepare() { } this.table = (String) this.config.get("table"); - if(this.config.containsKey("user") && this.config.containsKey("password")) { - this.user = (String) this.config.get("user"); + if(this.config.containsKey("username") && this.config.containsKey("password")) { + this.user = (String) this.config.get("username"); this.password = (String) this.config.get("password"); this.withCredit = true; - } else if (this.config.containsKey("user") || this.config.containsKey("password")) { - log.warn("user and password must be included in config at same time"); + } else if (this.config.containsKey("username") || this.config.containsKey("password")) { + log.warn("username and password must be included in config at same time"); } else { this.withCredit = false; }