fapaul commented on a change in pull request #18097:
URL: https://github.com/apache/flink/pull/18097#discussion_r767899129
##########
File path:
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchSinkBuilderBase.java
##########
@@ -217,6 +220,44 @@ public B setConnectionPathPrefix(String prefix) {
return self();
}
+ /**
+ * Sets the timeout for requesting the connection of the Elasticsearch
cluster from the
+ * connection manager.
+ *
+ * @param timeout for the connection request
+ * @return this builder
+ */
+ public B setConnectionRequestTimeout(int timeout) {
+ checkState(timeout >= 0, "Connection request timeout be larger than or
equal to 0.");
+ this.connectionRequestTimeout = timeout;
+ return self();
+ }
+
+ /**
+ * Sets the timeout for establishing a connection of the Elasticsearch
cluster.
+ *
+ * @param timeout for the connection
+ * @return this builder
+ */
+ public B setConnectionTimeout(int timeout) {
+ checkState(timeout >= 0, "Connection timeout be larger than or equal
to 0.");
Review comment:
```suggestion
checkState(timeout >= 0, "Connection timeout must be larger than or
equal to 0.");
```
##########
File path:
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchSinkBuilderBase.java
##########
@@ -217,6 +220,44 @@ public B setConnectionPathPrefix(String prefix) {
return self();
}
+ /**
+ * Sets the timeout for requesting the connection of the Elasticsearch
cluster from the
+ * connection manager.
+ *
+ * @param timeout for the connection request
+ * @return this builder
+ */
+ public B setConnectionRequestTimeout(int timeout) {
+ checkState(timeout >= 0, "Connection request timeout be larger than or
equal to 0.");
Review comment:
```suggestion
checkState(timeout >= 0, "Connection request timeout must be larger
than or equal to 0.");
```
##########
File path:
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchSinkBuilderBase.java
##########
@@ -217,6 +220,44 @@ public B setConnectionPathPrefix(String prefix) {
return self();
}
+ /**
+ * Sets the timeout for requesting the connection of the Elasticsearch
cluster from the
+ * connection manager.
+ *
+ * @param timeout for the connection request
+ * @return this builder
+ */
+ public B setConnectionRequestTimeout(int timeout) {
+ checkState(timeout >= 0, "Connection request timeout be larger than or
equal to 0.");
+ this.connectionRequestTimeout = timeout;
+ return self();
+ }
+
+ /**
+ * Sets the timeout for establishing a connection of the Elasticsearch
cluster.
+ *
+ * @param timeout for the connection
+ * @return this builder
+ */
+ public B setConnectionTimeout(int timeout) {
+ checkState(timeout >= 0, "Connection timeout be larger than or equal
to 0.");
+ this.connectionTimeout = timeout;
+ return self();
+ }
+
+ /**
+ * Sets the timeout for waiting for data or, put differently, a maximum
period inactivity
+ * between two consecutive data packets.
+ *
+ * @param timeout for the socket
+ * @return this builder
+ */
+ public B setSocketTimeout(int timeout) {
+ checkState(timeout >= 0, "Socket timeout be larger than or equal to
0.");
Review comment:
```suggestion
checkState(timeout >= 0, "Socket timeout must be larger than or
equal to 0.");
```
##########
File path:
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/table/ElasticsearchDynamicSinkFactoryBaseTest.java
##########
@@ -227,4 +227,42 @@ public void validateWrongCredential() {
"")
.build()));
}
+
+ @Test
+ public void validateInvalidTimeouts() {
Review comment:
I think this test should be based in `ElasticsearchSinkBuilderBaseTest`
because it verifies behaviour of the connector build and is not specific to the
validation in the Table API.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]