This is an automated email from the ASF dual-hosted git repository.
liuyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new c821a28 Add annotations for ClientConfigurationData (#11258)
c821a28 is described below
commit c821a2872328e8a1bac6d2863e4d833890942564
Author: feynmanlin <[email protected]>
AuthorDate: Fri Jul 16 08:10:38 2021 +0800
Add annotations for ClientConfigurationData (#11258)
* Add annotation for ClientConfigurationData
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* Update
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
Co-authored-by: Anonymitaet <[email protected]>
* fix typo
* change name
Co-authored-by: Anonymitaet <[email protected]>
---
.../client/impl/conf/ClientConfigurationData.java | 202 ++++++++++++++++++++-
1 file changed, 197 insertions(+), 5 deletions(-)
diff --git
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
index 9d5b12d..0723708 100644
---
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
+++
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java
@@ -21,6 +21,7 @@ package org.apache.pulsar.client.impl.conf;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Sets;
+import io.swagger.annotations.ApiModelProperty;
import java.net.InetSocketAddress;
import java.net.URI;
import java.time.Clock;
@@ -49,70 +50,261 @@ import org.apache.pulsar.client.util.Secret;
public class ClientConfigurationData implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
+ @ApiModelProperty(
+ name = "serviceUrl",
+ value = "Pulsar cluster HTTP URL to connect to a broker."
+ )
private String serviceUrl;
+ @ApiModelProperty(
+ name = "serviceUrlProvider",
+ value = "The implementation class of ServiceUrlProvider used to
generate ServiceUrl."
+ )
@JsonIgnore
private transient ServiceUrlProvider serviceUrlProvider;
+ @ApiModelProperty(
+ name = "authentication",
+ value = "Authentication settings of the client."
+ )
@JsonIgnore
private Authentication authentication;
+
+ @ApiModelProperty(
+ name = "authPluginClassName",
+ value = "Class name of authentication plugin of the client."
+ )
private String authPluginClassName;
+ @ApiModelProperty(
+ name = "authParams",
+ value = "Authentication parameter of the client."
+ )
@Secret
private String authParams;
+
+ @ApiModelProperty(
+ name = "authParamMap",
+ value = "Authentication map of the client."
+ )
@Secret
private Map<String, String> authParamMap;
+ @ApiModelProperty(
+ name = "operationTimeoutMs",
+ value = "Client operation timeout (in millisecond)."
+ )
private long operationTimeoutMs = 30000;
+
+ @ApiModelProperty(
+ name = "statsIntervalSeconds",
+ value = " Interval to print client stats (in second)."
+ )
private long statsIntervalSeconds = 60;
+ @ApiModelProperty(
+ name = "numIoThreads",
+ value = "Number of IO threads."
+ )
private int numIoThreads = 1;
+
+ @ApiModelProperty(
+ name = "numListenerThreads",
+ value = "Number of consumer listener threads."
+ )
private int numListenerThreads = 1;
+
+ @ApiModelProperty(
+ name = "connectionsPerBroker",
+ value = "Number of connections established between the client and
each Broker."
+ )
private int connectionsPerBroker = 1;
+ @ApiModelProperty(
+ name = "useTcpNoDelay",
+ value = "Whether to use TCP NoDelay option."
+ )
private boolean useTcpNoDelay = true;
+ @ApiModelProperty(
+ name = "useTls",
+ value = "Whether to use TLS."
+ )
private boolean useTls = false;
+
+ @ApiModelProperty(
+ name = "tlsTrustCertsFilePath",
+ value = "Path to the trusted TLS certificate file."
+ )
private String tlsTrustCertsFilePath = "";
+
+ @ApiModelProperty(
+ name = "tlsAllowInsecureConnection",
+ value = "Whether the client accepts untrusted TLS certificates
from the broker."
+ )
private boolean tlsAllowInsecureConnection = false;
+
+ @ApiModelProperty(
+ name = "tlsHostnameVerificationEnable",
+ value = "Whether the hostname is validated when the proxy creates
a TLS connection with brokers."
+ )
private boolean tlsHostnameVerificationEnable = false;
+ @ApiModelProperty(
+ name = "concurrentLookupRequest",
+ value = "The number of concurrent lookup requests that can be sent
on each broker connection. "
+ + "Setting a maximum prevents overloading a broker."
+ )
private int concurrentLookupRequest = 5000;
+
+ @ApiModelProperty(
+ name = "maxLookupRequest",
+ value = "Maximum number of lookup requests allowed on "
+ + "each broker connection to prevent overloading a broker."
+ )
private int maxLookupRequest = 50000;
+
+ @ApiModelProperty(
+ name = "maxLookupRedirects",
+ value = "Maximum times of redirected lookup requests."
+ )
private int maxLookupRedirects = 20;
+
+ @ApiModelProperty(
+ name = "maxNumberOfRejectedRequestPerConnection",
+ value = "Maximum number of rejected requests of a broker in a
certain time frame (30 seconds) "
+ + "after the current connection is closed and the client "
+ + "creating a new connection to connect to a different
broker."
+ )
private int maxNumberOfRejectedRequestPerConnection = 50;
+
+ @ApiModelProperty(
+ name = "keepAliveIntervalSeconds",
+ value = "Seconds of keeping alive interval for each client broker
connection."
+ )
private int keepAliveIntervalSeconds = 30;
+
+ @ApiModelProperty(
+ name = "connectionTimeoutMs",
+ value = "Duration of waiting for a connection to a broker to be
established."
+ + "If the duration passes without a response from a
broker, the connection attempt is dropped."
+ )
private int connectionTimeoutMs = 10000;
+ @ApiModelProperty(
+ name = "requestTimeoutMs",
+ value = "Maximum duration for completing a request."
+ )
private int requestTimeoutMs = 60000;
+
+ @ApiModelProperty(
+ name = "initialBackoffIntervalNanos",
+ value = "Initial backoff interval (in nanosecond)."
+ )
private long initialBackoffIntervalNanos =
TimeUnit.MILLISECONDS.toNanos(100);
+
+ @ApiModelProperty(
+ name = "maxBackoffIntervalNanos",
+ value = "Max backoff interval (in nanosecond)."
+ )
private long maxBackoffIntervalNanos = TimeUnit.SECONDS.toNanos(60);
+
+ @ApiModelProperty(
+ name = "enableBusyWait",
+ value = "Whether to enable BusyWait for EpollEventLoopGroup."
+ )
private boolean enableBusyWait = false;
- //
+
+ @ApiModelProperty(
+ name = "listenerName",
+ value = "Listener name for lookup. Clients can use listenerName to
choose one of the listeners "
+ + "as the service URL to create a connection to the broker
as long as the network is accessible."
+ + "\"advertisedListeners\" must enabled in broker side."
+ )
private String listenerName;
- // set TLS using KeyStore way.
+ @ApiModelProperty(
+ name = "useKeyStoreTls",
+ value = "Set TLS using KeyStore way."
+ )
private boolean useKeyStoreTls = false;
+ @ApiModelProperty(
+ name = "sslProvider",
+ value = "The TLS provider used by an internal client to
authenticate with other Pulsar brokers."
+ )
private String sslProvider = null;
- // needed when client auth is required
+
+ @ApiModelProperty(
+ name = "tlsTrustStoreType",
+ value = "TLS TrustStore type configuration. You need to set this
configuration when client authentication is required."
+ )
private String tlsTrustStoreType = "JKS";
+
+ @ApiModelProperty(
+ name = "tlsTrustStorePath",
+ value = "Path of TLS TrustStore."
+ )
private String tlsTrustStorePath = null;
+
+ @ApiModelProperty(
+ name = "tlsTrustStorePassword",
+ value = "Password of TLS TrustStore."
+ )
private String tlsTrustStorePassword = null;
+
+ @ApiModelProperty(
+ name = "tlsCiphers",
+ value = "Set of TLS Ciphers."
+ )
private Set<String> tlsCiphers = Sets.newTreeSet();
+
+ @ApiModelProperty(
+ name = "tlsProtocols",
+ value = "Protocols of TLS."
+ )
private Set<String> tlsProtocols = Sets.newTreeSet();
+ @ApiModelProperty(
+ name = "memoryLimitBytes",
+ value = "Limit of client memory usage (in byte)."
+ )
private long memoryLimitBytes = 0;
- /** proxyServiceUrl and proxyProtocol must be mutually inclusive **/
+ @ApiModelProperty(
+ name = "proxyServiceUrl",
+ value = "URL of proxy service. proxyServiceUrl and proxyProtocol
must be mutually inclusive."
+ )
private String proxyServiceUrl;
+
+ @ApiModelProperty(
+ name = "proxyProtocol",
+ value = "Protocol of proxy service. proxyServiceUrl and
proxyProtocol must be mutually inclusive."
+ )
private ProxyProtocol proxyProtocol;
- // transaction
+ @ApiModelProperty(
+ name = "enableTransaction",
+ value = "Whether to enable transaction."
+ )
private boolean enableTransaction = false;
@JsonIgnore
private Clock clock = Clock.systemDefaultZone();
// socks5
+ @ApiModelProperty(
+ name = "socks5ProxyAddress",
+ value = "Address of SOCKS5 proxy."
+ )
private InetSocketAddress socks5ProxyAddress;
+
+ @ApiModelProperty(
+ name = "socks5ProxyUsername",
+ value = "User name of SOCKS5 proxy."
+ )
private String socks5ProxyUsername;
+
+ @ApiModelProperty(
+ name = "socks5ProxyUsername",
+ value = "Password of SOCKS5 proxy."
+ )
private String socks5ProxyPassword;
public Authentication getAuthentication() {