forked from apache/seatunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][Connector-V2] new connecotor of Elasticsearch source(apache…
- Loading branch information
iture123
committed
Aug 28, 2022
1 parent
ead3d68
commit d270890
Showing
18 changed files
with
892 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Elasticsearch | ||
|
||
## Description | ||
|
||
Read data from `Elasticsearch`. | ||
|
||
:::tip | ||
|
||
Engine Supported | ||
|
||
* supported `ElasticSearch version is >= 2.x and < 8.x` | ||
|
||
::: | ||
|
||
## Options | ||
|
||
| name | type | required | default value | | ||
|-------------|--------| -------- |---------------| | ||
| hosts | array | yes | - | | ||
| username | string | no | | | ||
| password | string | no | | | ||
| index | string | yes | - | | ||
| source | array | yes | - | | ||
| scroll_time | string | no | 1m | | ||
| scroll_size | int | no | 100 | | ||
|
||
|
||
|
||
### hosts [array] | ||
`Elasticsearch` cluster http address, the format is `host:port` , allowing multiple hosts to be specified. Such as `["host1:9200", "host2:9200"]`. | ||
|
||
### username [string] | ||
x-pack username | ||
|
||
### password [string] | ||
x-pack password | ||
|
||
### index [string] | ||
`Elasticsearch` index name, support * fuzzy matching | ||
|
||
### source [array] | ||
The fields of index. | ||
You can get the document id by specifying the field `_id`.If sink _id to other index,you need specify an alias for _id due to the `Elasticsearch` limit. | ||
|
||
### scroll_time [String] | ||
Amount of time `Elasticsearch` will keep the search context alive for scroll requests. | ||
|
||
### scroll_size [int] | ||
Maximum number of hits to be returned with each `Elasticsearch` scroll request. | ||
|
||
## Examples | ||
```bash | ||
Elasticsearch { | ||
hosts = ["localhost:9200"] | ||
index = "seatunnel-*" | ||
source = ["_id","name","age"] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...apache/seatunnel/connectors/seatunnel/elasticsearch/config/EsClusterConnectionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.seatunnel.connectors.seatunnel.elasticsearch.config; | ||
|
||
public class EsClusterConnectionConfig { | ||
|
||
public static final String HOSTS = "hosts"; | ||
|
||
public static final String USERNAME = "username"; | ||
|
||
public static final String PASSWORD = "password"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...a/org/apache/seatunnel/connectors/seatunnel/elasticsearch/config/source/SourceConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.seatunnel.connectors.seatunnel.elasticsearch.config.source; | ||
|
||
public class SourceConfig { | ||
|
||
public static final String INDEX = "index"; | ||
|
||
public static final String SOURCE = "source"; | ||
|
||
public static final String SCROLL_TIME = "scroll_time"; | ||
|
||
public static final String SCROLL_SIZE = "scroll_size"; | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...eatunnel/connectors/seatunnel/elasticsearch/config/source/SourceConfigDeaultConstant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.seatunnel.connectors.seatunnel.elasticsearch.config.source; | ||
|
||
public class SourceConfigDeaultConstant { | ||
|
||
public static final String SCROLLL_TIME = "1m"; | ||
|
||
public static final int SCROLLL_SIZE = 100; | ||
|
||
} |
Oops, something went wrong.