You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/20 12:11:03 UTC
[GitHub] [flink] zhisheng17 opened a new pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
zhisheng17 opened a new pull request #11822:
URL: https://github.com/apache/flink/pull/11822
…config (eg: username/password)
<!--
*Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
*Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
- Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Travis CI to do that following [this guide](https://flink.apache.org/contributing/contribute-code.html#open-a-pull-request).
- Each pull request should address only one issue, not mix up code from multiple issues.
- Each commit in the pull request has a meaningful commit message (including the JIRA id)
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
## What is the purpose of the change
In a production environment, accessing elasticsearch usually requires authentication, require username and password to access it, but the current version of SQL DDL does not support users to configure these parameters. This change will support it.
## Brief change log
*(for example:)*
- *The TaskInfo is stored in the blob store on job creation time as a persistent artifact*
- *Deployments RPC transmits only the blob storage reference*
- *TaskManagers retrieve the TaskInfo from the blob cache*
## Verifying this change
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (100MB)*
- *Extended integration test for recovery after master (JobManager) failure*
- *Added test that validates that TaskInfo is transferred only once across recoveries*
- *Manually verified the change by running a 4 node cluser with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.*
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / **no**)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
- The serializers: (yes / **no** / don't know)
- The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
- The S3 file system connector: (yes / **no** / don't know)
## Documentation
- Does this pull request introduce a new feature? (**yes** / no)
- If yes, how is the feature documented? (not applicable / **docs** / JavaDocs / not documented)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 91704ccd87cb0ad9681e9081ad543951b6bb6781 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/161034368) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781)
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] KarmaGYZ commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
KarmaGYZ commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r416370101
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/ElasticsearchValidator.java
##########
@@ -76,12 +78,20 @@ public void validate(DescriptorProperties properties) {
properties.validateValue(CONNECTOR_TYPE, CONNECTOR_TYPE_VALUE_ELASTICSEARCH, false);
validateVersion(properties);
validateHosts(properties);
+ validateAuth(properties);
validateGeneralProperties(properties);
validateFailureHandler(properties);
validateBulkFlush(properties);
validateConnectionProperties(properties);
}
+ private void validateAuth(DescriptorProperties properties) {
+ if (properties.containsKey(CONNECTOR_USERNAME) || properties.containsKey(CONNECTOR_PASSWORD)) {
+ properties.validateString(CONNECTOR_USERNAME, false, 1);
+ properties.validateString(CONNECTOR_PASSWORD, false, 1);
Review comment:
Not sure if the password could be empty.
##########
File path: flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6UpsertTableSink.java
##########
@@ -189,6 +201,67 @@ protected ElasticsearchUpsertTableSinkBase copy(
// Helper classes
// --------------------------------------------------------------------------------------------
+ /**
+ * This class implements {@link RestClientFactory}, used for es with authentication.
+ */
+ static class AuthRestClientFactory implements RestClientFactory {
+
+ private String userName;
Review comment:
Same as other "userName" in this class.
##########
File path: docs/dev/table/connect.zh.md
##########
@@ -1040,6 +1048,10 @@ CREATE TABLE MyUserTable (
.index("MyUsers") # required: Elasticsearch index
.document_type("user") # required: Elasticsearch document type
+ # optional: configure Elasticsearch cluster username and password
+ .userName("myusername") # optional: Elasticsearch cluster username
+ .password("123456") # optional: Elasticsearch cluster password
Review comment:
```suggestion
.password("mypassword") # optional: Elasticsearch cluster password
```
##########
File path: flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6UpsertTableSink.java
##########
@@ -189,6 +201,67 @@ protected ElasticsearchUpsertTableSinkBase copy(
// Helper classes
// --------------------------------------------------------------------------------------------
+ /**
+ * This class implements {@link RestClientFactory}, used for es with authentication.
+ */
+ static class AuthRestClientFactory implements RestClientFactory {
+
+ private String userName;
Review comment:
```suggestion
private String username;
```
##########
File path: flink-connectors/flink-connector-elasticsearch7/src/main/java/org/apache/flink/streaming/connectors/elasticsearch7/Elasticsearch7UpsertTableSink.java
##########
@@ -211,6 +224,59 @@ protected ElasticsearchUpsertTableSinkBase copy(
// Helper classes
// --------------------------------------------------------------------------------------------
+ /**
+ * This class implements {@link RestClientFactory}, used for es with authentication.
+ */
+ static class AuthRestClientFactory implements RestClientFactory {
+
+ private String userName;
Review comment:
```suggestion
private String username;
```
##########
File path: docs/dev/table/connect.md
##########
@@ -998,6 +1002,10 @@ CREATE TABLE MyUserTable (
.index("MyUsers") // required: Elasticsearch index
.documentType("user") // required: Elasticsearch document type
+ // optional: configure Elasticsearch cluster username and password
+ .userName("myusername") // optional: Elasticsearch cluster username
Review comment:
Same as other docs.
##########
File path: flink-connectors/flink-connector-elasticsearch7/src/main/java/org/apache/flink/streaming/connectors/elasticsearch7/Elasticsearch7UpsertTableSink.java
##########
@@ -211,6 +224,59 @@ protected ElasticsearchUpsertTableSinkBase copy(
// Helper classes
// --------------------------------------------------------------------------------------------
+ /**
+ * This class implements {@link RestClientFactory}, used for es with authentication.
+ */
+ static class AuthRestClientFactory implements RestClientFactory {
+
+ private String userName;
Review comment:
Same as other "userName" in this class.
##########
File path: flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6UpsertTableSink.java
##########
@@ -159,12 +165,18 @@ protected ElasticsearchUpsertTableSinkBase copy(
Optional.ofNullable(sinkOptions.get(BULK_FLUSH_BACKOFF_DELAY))
.ifPresent(v -> builder.setBulkFlushBackoffDelay(Long.valueOf(v)));
- builder.setRestClientFactory(
- new DefaultRestClientFactory(
- Optional.ofNullable(sinkOptions.get(REST_MAX_RETRY_TIMEOUT))
- .map(Integer::valueOf)
- .orElse(null),
- sinkOptions.get(REST_PATH_PREFIX)));
+ String username = sinkOptions.get(USERNAME);
+ String password = sinkOptions.get(PASSWORD);
+ Integer maxRetryTimeout = Optional.ofNullable(sinkOptions.get(REST_MAX_RETRY_TIMEOUT))
+ .map(Integer::valueOf)
+ .orElse(null);
+ String pathPrefix = sinkOptions.get(REST_PATH_PREFIX);
+
+ if (Optional.ofNullable(username).isPresent() && Optional.ofNullable(password).isPresent()) {
Review comment:
What is the benefit we get compared to `username != null`?
##########
File path: docs/dev/table/connect.md
##########
@@ -998,6 +1002,10 @@ CREATE TABLE MyUserTable (
.index("MyUsers") // required: Elasticsearch index
.documentType("user") // required: Elasticsearch document type
+ // optional: configure Elasticsearch cluster username and password
+ .userName("myusername") // optional: Elasticsearch cluster username
Review comment:
```suggestion
.username("myusername") // optional: Elasticsearch cluster username
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zhisheng17 commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
zhisheng17 commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r417032637
##########
File path: flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6UpsertTableSink.java
##########
@@ -159,12 +165,18 @@ protected ElasticsearchUpsertTableSinkBase copy(
Optional.ofNullable(sinkOptions.get(BULK_FLUSH_BACKOFF_DELAY))
.ifPresent(v -> builder.setBulkFlushBackoffDelay(Long.valueOf(v)));
- builder.setRestClientFactory(
- new DefaultRestClientFactory(
- Optional.ofNullable(sinkOptions.get(REST_MAX_RETRY_TIMEOUT))
- .map(Integer::valueOf)
- .orElse(null),
- sinkOptions.get(REST_PATH_PREFIX)));
+ String username = sinkOptions.get(USERNAME);
+ String password = sinkOptions.get(PASSWORD);
+ Integer maxRetryTimeout = Optional.ofNullable(sinkOptions.get(REST_MAX_RETRY_TIMEOUT))
+ .map(Integer::valueOf)
+ .orElse(null);
+ String pathPrefix = sinkOptions.get(REST_PATH_PREFIX);
+
+ if (Optional.ofNullable(username).isPresent() && Optional.ofNullable(password).isPresent()) {
Review comment:
@KarmaGYZ I see other code use `Optional.ofNullable`, so i follow, the benefit is same to `username != null`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "PENDING",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "PENDING",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 91704ccd87cb0ad9681e9081ad543951b6bb6781 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161034368) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "FAILURE",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 794c7febb351309b3a41817031a748cd38f2e362 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/161235228) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860)
* 806d40c34b4c6bc8cc56bd8ff8a62057f76fc751 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zhisheng17 commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
zhisheng17 commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r412132038
##########
File path: flink-connectors/flink-connector-elasticsearch7/src/main/java/org/apache/flink/streaming/connectors/elasticsearch7/Elasticsearch7UpsertTableSink.java
##########
@@ -185,8 +191,18 @@ protected ElasticsearchUpsertTableSinkBase copy(
Optional.ofNullable(sinkOptions.get(BULK_FLUSH_BACKOFF_DELAY))
.ifPresent(v -> builder.setBulkFlushBackoffDelay(Long.valueOf(v)));
- builder.setRestClientFactory(
- new DefaultRestClientFactory(sinkOptions.get(REST_PATH_PREFIX)));
+ if (Optional.ofNullable(sinkOptions.get(CONNECTOR_USERNAME)).isPresent() &&
+ Optional.ofNullable(sinkOptions.get(CONNECTOR_PASSWORD)).isPresent()) {
+ builder.setRestClientFactory(new AuthRestClientFactory(
+ sinkOptions.get(CONNECTOR_USERNAME),
+ sinkOptions.get(CONNECTOR_PASSWORD),
+ sinkOptions.get(REST_PATH_PREFIX)
+ ));
+ } else {
+ builder.setRestClientFactory(
+ new DefaultRestClientFactory(
Review comment:
@wuchong es7 RestClientBuilder don't have maxRetryTimeout fields
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 91704ccd87cb0ad9681e9081ad543951b6bb6781 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "FAILURE",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 794c7febb351309b3a41817031a748cd38f2e362 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/161235228) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/162591367",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=390",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2100",
"triggerID" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"triggerType" : "PUSH"
}, {
"hash" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/168004326",
"triggerID" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"triggerType" : "PUSH"
}, {
"hash" : "a01fb4f44db2b1844989f5a21fc0a8a262540d0f",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2389",
"triggerID" : "a01fb4f44db2b1844989f5a21fc0a8a262540d0f",
"triggerType" : "PUSH"
}, {
"hash" : "a01fb4f44db2b1844989f5a21fc0a8a262540d0f",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/168603257",
"triggerID" : "a01fb4f44db2b1844989f5a21fc0a8a262540d0f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* a01fb4f44db2b1844989f5a21fc0a8a262540d0f Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/168603257) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2389)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wuchong commented on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-635066650
Hi @zhisheng17 , is there any problems to add a end-to-end test or IT case?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] kylemeow commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
kylemeow commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r429101087
##########
File path: docs/dev/table/connect.zh.md
##########
@@ -1040,6 +1048,10 @@ CREATE TABLE MyUserTable (
.index("MyUsers") # required: Elasticsearch index
.document_type("user") # required: Elasticsearch document type
+ # optional: configure Elasticsearch cluster username and password
+ .username("myusername") # optional: Elasticsearch cluster username
+ .password("mypassword") # optional: Elasticsearch cluster password
Review comment:
Hi~ Would you please align the indentation for the two comments?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/162591367",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=390",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 806d40c34b4c6bc8cc56bd8ff8a62057f76fc751 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/162591367) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=390)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "PENDING",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 794c7febb351309b3a41817031a748cd38f2e362 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/161235228) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] KarmaGYZ commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
KarmaGYZ commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r411364910
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/ElasticsearchValidator.java
##########
@@ -76,12 +78,18 @@ public void validate(DescriptorProperties properties) {
properties.validateValue(CONNECTOR_TYPE, CONNECTOR_TYPE_VALUE_ELASTICSEARCH, false);
validateVersion(properties);
validateHosts(properties);
+ validateAuth(properties);
validateGeneralProperties(properties);
validateFailureHandler(properties);
validateBulkFlush(properties);
validateConnectionProperties(properties);
}
+ private void validateAuth(DescriptorProperties properties) {
+ properties.validateString(CONNECTOR_USERNAME, true);
+ properties.validateString(CONNECTOR_PASSWORD, true);
Review comment:
I think it makes sense to set the minLen of the user name to 1. Besides, if the properties contain `CONNECTOR_USERNAME`, it seems the `CONNECTOR_PASSWORD` is not optional.
##########
File path: flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6UpsertTableSink.java
##########
@@ -189,6 +207,67 @@ protected ElasticsearchUpsertTableSinkBase copy(
// Helper classes
// --------------------------------------------------------------------------------------------
+ /**
+ * This class implements {@link RestClientFactory}, used for es with authentication.
+ */
+ static class AuthRestClientFactory implements RestClientFactory {
Review comment:
Does it make sense to add userName and password as two optional fields to the `DefaultRestClientFactory` instead of introducing this class?
##########
File path: flink-connectors/flink-connector-elasticsearch7/src/main/java/org/apache/flink/streaming/connectors/elasticsearch7/Elasticsearch7UpsertTableSink.java
##########
@@ -211,6 +227,59 @@ protected ElasticsearchUpsertTableSinkBase copy(
// Helper classes
// --------------------------------------------------------------------------------------------
+ /**
+ * This class implements {@link RestClientFactory}, used for es with authentication.
+ */
+ static class AuthRestClientFactory implements RestClientFactory {
Review comment:
Same as above.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/162591367",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=390",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2100",
"triggerID" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"triggerType" : "PUSH"
}, {
"hash" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/168004326",
"triggerID" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 7cd789769be5e83c93b115ac5e4ffd985532ce50 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/168004326) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2100)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "PENDING",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "PENDING",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 91704ccd87cb0ad9681e9081ad543951b6bb6781 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/161034368) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781)
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 794c7febb351309b3a41817031a748cd38f2e362 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161235228) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616513918
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 91704ccd87cb0ad9681e9081ad543951b6bb6781 (Mon Apr 20 12:14:48 UTC 2020)
✅no warnings
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zhisheng17 commented on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
zhisheng17 commented on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-617142483
@wuchong @KarmaGYZ Thanks, I made some changes, you can review it again, thx
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] KarmaGYZ commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
KarmaGYZ commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r417039344
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/ElasticsearchValidator.java
##########
@@ -76,12 +78,20 @@ public void validate(DescriptorProperties properties) {
properties.validateValue(CONNECTOR_TYPE, CONNECTOR_TYPE_VALUE_ELASTICSEARCH, false);
validateVersion(properties);
validateHosts(properties);
+ validateAuth(properties);
validateGeneralProperties(properties);
validateFailureHandler(properties);
validateBulkFlush(properties);
validateConnectionProperties(properties);
}
+ private void validateAuth(DescriptorProperties properties) {
+ if (properties.containsKey(CONNECTOR_USERNAME) || properties.containsKey(CONNECTOR_PASSWORD)) {
+ properties.validateString(CONNECTOR_USERNAME, false, 1);
+ properties.validateString(CONNECTOR_PASSWORD, false, 1);
Review comment:
I mean for elasticsearch, does it allow user to define an account with an empty password?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] wuchong commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r411878291
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/Elasticsearch.java
##########
@@ -93,6 +95,26 @@ public Elasticsearch host(String hostname, int port, String protocol) {
return this;
}
+ /**
+ * The Elasticsearch Cluster userName.
+ *
+ * @param userName Elasticsearch userName
+ */
+ public Elasticsearch userName(String userName) {
Review comment:
lower case for N
```suggestion
public Elasticsearch username(String username) {
```
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/Elasticsearch.java
##########
@@ -93,6 +95,26 @@ public Elasticsearch host(String hostname, int port, String protocol) {
return this;
}
+ /**
+ * The Elasticsearch Cluster userName.
Review comment:
ditto
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/ElasticsearchValidator.java
##########
@@ -76,12 +78,18 @@ public void validate(DescriptorProperties properties) {
properties.validateValue(CONNECTOR_TYPE, CONNECTOR_TYPE_VALUE_ELASTICSEARCH, false);
validateVersion(properties);
validateHosts(properties);
+ validateAuth(properties);
validateGeneralProperties(properties);
validateFailureHandler(properties);
validateBulkFlush(properties);
validateConnectionProperties(properties);
}
+ private void validateAuth(DescriptorProperties properties) {
+ properties.validateString(CONNECTOR_USERNAME, true);
+ properties.validateString(CONNECTOR_PASSWORD, true);
Review comment:
We should validate that both username and password should exist if one of them is configured.
##########
File path: flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6UpsertTableSink.java
##########
@@ -189,6 +207,67 @@ protected ElasticsearchUpsertTableSinkBase copy(
// Helper classes
// --------------------------------------------------------------------------------------------
+ /**
+ * This class implements {@link RestClientFactory}, used for es with authentication.
+ */
+ static class AuthRestClientFactory implements RestClientFactory {
+
+ private String userName;
+
+ private String password;
+
+ private Integer maxRetryTimeout;
+
+ private String pathPrefix;
+
+ private transient CredentialsProvider credentialsProvider;
+
+ public AuthRestClientFactory(@Nullable String userName, @Nullable String password,
Review comment:
`username` and `password` are not nullable, because you will use `AuthRestClientFactory` iff username and password are set.
##########
File path: flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6UpsertTableSink.java
##########
@@ -159,12 +165,24 @@ protected ElasticsearchUpsertTableSinkBase copy(
Optional.ofNullable(sinkOptions.get(BULK_FLUSH_BACKOFF_DELAY))
.ifPresent(v -> builder.setBulkFlushBackoffDelay(Long.valueOf(v)));
- builder.setRestClientFactory(
- new DefaultRestClientFactory(
+ if (Optional.ofNullable(sinkOptions.get(CONNECTOR_USERNAME)).isPresent() &&
+ Optional.ofNullable(sinkOptions.get(CONNECTOR_PASSWORD)).isPresent()) {
+ builder.setRestClientFactory(new AuthRestClientFactory(
+ sinkOptions.get(CONNECTOR_USERNAME),
+ sinkOptions.get(CONNECTOR_PASSWORD),
Optional.ofNullable(sinkOptions.get(REST_MAX_RETRY_TIMEOUT))
.map(Integer::valueOf)
.orElse(null),
- sinkOptions.get(REST_PATH_PREFIX)));
+ sinkOptions.get(REST_PATH_PREFIX)
+ ));
+ } else {
+ builder.setRestClientFactory(
+ new DefaultRestClientFactory(
+ Optional.ofNullable(sinkOptions.get(REST_MAX_RETRY_TIMEOUT))
+ .map(Integer::valueOf)
+ .orElse(null),
+ sinkOptions.get(REST_PATH_PREFIX)));
+ }
Review comment:
Could you extract the common vairable before the if else condition? e.g. maxRetry, pathPrefix, username, password.
##########
File path: flink-connectors/flink-connector-elasticsearch7/src/test/java/org/apache/flink/streaming/connectors/elasticsearch7/Elasticsearch7UpsertTableSinkFactoryTest.java
##########
@@ -102,7 +102,9 @@ public void testBuilder() {
expectedBuilder.setBulkFlushInterval(100);
expectedBuilder.setBulkFlushMaxActions(1000);
expectedBuilder.setBulkFlushMaxSizeMb(1);
- expectedBuilder.setRestClientFactory(new Elasticsearch7UpsertTableSink.DefaultRestClientFactory("/myapp"));
+ expectedBuilder.setRestClientFactory(new Elasticsearch7UpsertTableSink.AuthRestClientFactory("elastic",
+ "123456", "/myapp"));
+// expectedBuilder.setRestClientFactory(new Elasticsearch7UpsertTableSink.DefaultRestClientFactory("/myapp"));
Review comment:
remove useless code.
##########
File path: docs/dev/table/connect.md
##########
@@ -960,6 +960,10 @@ CREATE TABLE MyUserTable (
-- or "custom" for failure handling with a
-- ActionRequestFailureHandler subclass
+ -- optional: configure Elasticsearch cluster username and password
+ 'connector.username' = 'elastic', -- optional: Elasticsearch username
+ 'connector.password' = '123456', -- optional: Elasticsearch password
Review comment:
We can just use `myusername` or `mypassword` as an example.
```suggestion
'connector.username' = 'myusername', -- optional: Elasticsearch username
'connector.password' = 'mypassword', -- optional: Elasticsearch password
```
##########
File path: flink-connectors/flink-connector-elasticsearch7/src/main/java/org/apache/flink/streaming/connectors/elasticsearch7/Elasticsearch7UpsertTableSink.java
##########
@@ -185,8 +191,18 @@ protected ElasticsearchUpsertTableSinkBase copy(
Optional.ofNullable(sinkOptions.get(BULK_FLUSH_BACKOFF_DELAY))
.ifPresent(v -> builder.setBulkFlushBackoffDelay(Long.valueOf(v)));
- builder.setRestClientFactory(
- new DefaultRestClientFactory(sinkOptions.get(REST_PATH_PREFIX)));
+ if (Optional.ofNullable(sinkOptions.get(CONNECTOR_USERNAME)).isPresent() &&
+ Optional.ofNullable(sinkOptions.get(CONNECTOR_PASSWORD)).isPresent()) {
+ builder.setRestClientFactory(new AuthRestClientFactory(
+ sinkOptions.get(CONNECTOR_USERNAME),
+ sinkOptions.get(CONNECTOR_PASSWORD),
+ sinkOptions.get(REST_PATH_PREFIX)
+ ));
+ } else {
+ builder.setRestClientFactory(
+ new DefaultRestClientFactory(
Review comment:
I just wondering why es7 doesn't support `REST_MAX_RETRY_TIMEOUT`, I guess it is a mistake of FLINK-13025. Could you add the retry support for es7? cc @twalthr @yanghua
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchUpsertTableSinkBase.java
##########
@@ -319,6 +319,8 @@ private void validateKeyTypes(int[] keyFieldIndices) {
* Keys for optional parameterization of the sink.
*/
public enum SinkOption {
+ CONNECTOR_USERNAME,
Review comment:
We do not need `CONNECTOR_` prefix for `SinkOption`, I think just `USERNAME` and `PASSWORD` is fine.
##########
File path: docs/dev/table/connect.md
##########
@@ -1040,6 +1048,10 @@ CREATE TABLE MyUserTable (
.index("MyUsers") # required: Elasticsearch index
.document_type("user") # required: Elasticsearch document type
+ //optional: configure ElasticSearch cluster username and password
+ .userName("elastic") //optional: Elasticsearch cluster username
Review comment:
Python should use `#` as comments.
##########
File path: docs/dev/table/connect.md
##########
@@ -998,6 +1002,10 @@ CREATE TABLE MyUserTable (
.index("MyUsers") // required: Elasticsearch index
.documentType("user") // required: Elasticsearch document type
+ //optional: configure Elasticsearch cluster username and password
+ .userName("elastic") //optional: Elasticsearch cluster username
+ .password("123456") //optional: Elasticsearch cluster password
Review comment:
Please add a space after `//`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/162591367",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=390",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2100",
"triggerID" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"triggerType" : "PUSH"
}, {
"hash" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/168004326",
"triggerID" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"triggerType" : "PUSH"
}, {
"hash" : "a01fb4f44db2b1844989f5a21fc0a8a262540d0f",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "a01fb4f44db2b1844989f5a21fc0a8a262540d0f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 7cd789769be5e83c93b115ac5e4ffd985532ce50 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/168004326) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2100)
* a01fb4f44db2b1844989f5a21fc0a8a262540d0f UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 91704ccd87cb0ad9681e9081ad543951b6bb6781 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/161034368) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781)
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 794c7febb351309b3a41817031a748cd38f2e362 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zhisheng17 commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
zhisheng17 commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r417926719
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/ElasticsearchValidator.java
##########
@@ -76,12 +78,20 @@ public void validate(DescriptorProperties properties) {
properties.validateValue(CONNECTOR_TYPE, CONNECTOR_TYPE_VALUE_ELASTICSEARCH, false);
validateVersion(properties);
validateHosts(properties);
+ validateAuth(properties);
validateGeneralProperties(properties);
validateFailureHandler(properties);
validateBulkFlush(properties);
validateConnectionProperties(properties);
}
+ private void validateAuth(DescriptorProperties properties) {
+ if (properties.containsKey(CONNECTOR_USERNAME) || properties.containsKey(CONNECTOR_PASSWORD)) {
+ properties.validateString(CONNECTOR_USERNAME, false, 1);
+ properties.validateString(CONNECTOR_PASSWORD, false, 1);
Review comment:
@KarmaGYZ There should be no such case, I tried.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zhisheng17 commented on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
zhisheng17 commented on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-620962166
@KarmaGYZ Thanks help me review the code, I had fixed, I will add an integration test or end-to-end test When free
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zhisheng17 closed pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
zhisheng17 closed pull request #11822:
URL: https://github.com/apache/flink/pull/11822
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "16f89f88e2750769804c9c5e965721ea5d74c54a",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7860",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "794c7febb351309b3a41817031a748cd38f2e362",
"status" : "DELETED",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161235228",
"triggerID" : "794c7febb351309b3a41817031a748cd38f2e362",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/162591367",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=390",
"triggerID" : "806d40c34b4c6bc8cc56bd8ff8a62057f76fc751",
"triggerType" : "PUSH"
}, {
"hash" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "7cd789769be5e83c93b115ac5e4ffd985532ce50",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 16f89f88e2750769804c9c5e965721ea5d74c54a UNKNOWN
* 806d40c34b4c6bc8cc56bd8ff8a62057f76fc751 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/162591367) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=390)
* 7cd789769be5e83c93b115ac5e4ffd985532ce50 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zhisheng17 commented on a change in pull request #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
zhisheng17 commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r417035037
##########
File path: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/ElasticsearchValidator.java
##########
@@ -76,12 +78,20 @@ public void validate(DescriptorProperties properties) {
properties.validateValue(CONNECTOR_TYPE, CONNECTOR_TYPE_VALUE_ELASTICSEARCH, false);
validateVersion(properties);
validateHosts(properties);
+ validateAuth(properties);
validateGeneralProperties(properties);
validateFailureHandler(properties);
validateBulkFlush(properties);
validateConnectionProperties(properties);
}
+ private void validateAuth(DescriptorProperties properties) {
+ if (properties.containsKey(CONNECTOR_USERNAME) || properties.containsKey(CONNECTOR_PASSWORD)) {
+ properties.validateString(CONNECTOR_USERNAME, false, 1);
+ properties.validateString(CONNECTOR_PASSWORD, false, 1);
Review comment:
@KarmaGYZ if username is not empty and password is empty,
```java
properties.validateString(CONNECTOR_USERNAME, false, 1);
properties.validateString(CONNECTOR_PASSWORD, false, 1);
```
I will check the two property must required, not Optional. that case, will throw ValidationException in validateOptional function
```java
public void validateString(String key, boolean isOptional, int minLen) {
validateString(key, isOptional, minLen, Integer.MAX_VALUE);
}
public void validateString(String key, boolean isOptional, int minLen, int maxLen) {
validateOptional(
key,
isOptional,
(value) -> {
final int length = value.length();
if (length < minLen || length > maxLen) {
throw new ValidationException(
"Property '" + key + "' must have a length between " + minLen + " and " + maxLen + " but was: " + value);
}
});
}
private void validateOptional(String key, boolean isOptional, Consumer<String> valueValidation) {
if (!properties.containsKey(key)) {
if (!isOptional) {
throw new ValidationException("Could not find required property '" + key + "'.");
}
} else {
final String value = properties.get(key);
valueValidation.accept(value);
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on issue #11822: [FLINK-16788][Connector]ElasticSearch Connector SQL DDL add optional config (eg: username/password)
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11822:
URL: https://github.com/apache/flink/pull/11822#issuecomment-616522760
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://travis-ci.com/github/flink-ci/flink/builds/161034368",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
}, {
"hash" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"status" : "FAILURE",
"url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781",
"triggerID" : "91704ccd87cb0ad9681e9081ad543951b6bb6781",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 91704ccd87cb0ad9681e9081ad543951b6bb6781 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/161034368) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7781)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org