Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyHuo committed Jan 16, 2018
2 parents 36aad86 + aa745dc commit 29f8c94
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

* Author: rickyHuo
* Homepage: https://github.com/RickyHuo/hangout-output-clickhouse
* Version: 0.0.2
* Version: 0.0.3

### Description

Expand All @@ -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]

Expand All @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>sina</groupId>
<artifactId>hangout-output-plugins-clickhouse</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
<packaging>jar</packaging>

<name>hangout-output-plugins-clickhouse</name>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/sina/bip/hangout/outputs/Clickhouse.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 29f8c94

Please sign in to comment.