Package org.apache.zookeeper.client
Class ZKClientConfig
java.lang.Object
org.apache.zookeeper.common.ZKConfig
org.apache.zookeeper.client.ZKClientConfig
Handles client specific properties
- Since:
- 3.5.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final StringThis controls whether automatic watch resetting is enabled.static final StringDNS SRV refresh interval in seconds for DnsSrvHostProvider.static final longstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringSetting this to "true" will enable encrypted client-server communication.static final Stringstatic final booleanstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final longFeature is disabled by default.static final Stringstatic final Stringstatic final StringTrue value preserves the old behavior is to shuffle the addresses in DNS response regardless of address type.static final booleanFields inherited from class org.apache.zookeeper.common.ZKConfig
JGSS_NATIVE, JUTE_MAXBUFFER, KINIT_COMMAND -
Constructor Summary
ConstructorsConstructorDescriptionZKClientConfig(File configFile) Deprecated.ZKClientConfig(String configPath) Deprecated.ZKClientConfig(Path configPath) -
Method Summary
Modifier and TypeMethodDescriptionlongGet the value of thekeyproperty as anlong.protected voidNow onwards client code will use properties from this class but older clients still be setting properties through system properties.booleanReturns true if the SASL client is enabled.booleanReturn true if we need to use the old behavior of default DNS resolver and always shuffle the IP addresses in the DNS lookup response in order to pick a completely random IP address.Methods inherited from class org.apache.zookeeper.common.ZKConfig
addConfiguration, addConfiguration, addConfiguration, getBoolean, getBoolean, getInt, getJaasConfKey, getProperty, getProperty, setProperty
-
Field Details
-
ZK_SASL_CLIENT_USERNAME
- See Also:
-
ZK_SASL_CLIENT_USERNAME_DEFAULT
- See Also:
-
ZK_SASL_CLIENT_CANONICALIZE_HOSTNAME
- See Also:
-
ZK_SASL_CLIENT_CANONICALIZE_HOSTNAME_DEFAULT
- See Also:
-
LOGIN_CONTEXT_NAME_KEY
- See Also:
-
LOGIN_CONTEXT_NAME_KEY_DEFAULT
- See Also:
-
ENABLE_CLIENT_SASL_KEY
- See Also:
-
ENABLE_CLIENT_SASL_DEFAULT
- See Also:
-
ZOOKEEPER_SERVER_REALM
- See Also:
-
DISABLE_AUTO_WATCH_RESET
This controls whether automatic watch resetting is enabled. Clients automatically reset watches during session reconnect, this option allows the client to turn off this behavior by setting the property "zookeeper.disableAutoWatchReset" to "true"- See Also:
-
ZOOKEEPER_CLIENT_CNXN_SOCKET
- See Also:
-
SECURE_CLIENT
Setting this to "true" will enable encrypted client-server communication.- See Also:
-
CLIENT_MAX_PACKET_LENGTH_DEFAULT
public static final int CLIENT_MAX_PACKET_LENGTH_DEFAULT- See Also:
-
ZOOKEEPER_REQUEST_TIMEOUT
- See Also:
-
ZOOKEEPER_SERVER_PRINCIPAL
- See Also:
-
ZOOKEEPER_REQUEST_TIMEOUT_DEFAULT
public static final long ZOOKEEPER_REQUEST_TIMEOUT_DEFAULTFeature is disabled by default.- See Also:
-
ZK_SASL_CLIENT_ALLOW_REVERSE_DNS
- See Also:
-
ZK_SASL_CLIENT_ALLOW_REVERSE_DNS_DEFAULT
public static final boolean ZK_SASL_CLIENT_ALLOW_REVERSE_DNS_DEFAULT- See Also:
-
ZOOKEEPER_SHUFFLE_DNS_RESPONSE
True value preserves the old behavior is to shuffle the addresses in DNS response regardless of address type. This could help with buggy DNS servers which always return addresses in the same order, but at the same time ignores the JVM option java.net.preferIPv6Addresses.- See Also:
-
ZOOKEEPER_SHUFFLE_DNS_RESPONSE_DEFAULT
public static final boolean ZOOKEEPER_SHUFFLE_DNS_RESPONSE_DEFAULT- See Also:
-
DNS_SRV_REFRESH_INTERVAL_SECONDS
DNS SRV refresh interval in seconds for DnsSrvHostProvider. A value of 0 disables periodic refresh.- See Also:
-
DNS_SRV_REFRESH_INTERVAL_SECONDS_DEFAULT
public static final long DNS_SRV_REFRESH_INTERVAL_SECONDS_DEFAULT- See Also:
-
-
Constructor Details
-
ZKClientConfig
public ZKClientConfig() -
ZKClientConfig
Deprecated.Use
ZKClientConfig(Path configPath)instead.The signature of this method will be changed to throw
ConfigExceptioninstead ofQuorumPeerConfig.ConfigExceptionin future release.- Throws:
QuorumPeerConfig.ConfigException
-
ZKClientConfig
Deprecated.Use
ZKClientConfig(Path configPath)instead.The signature of this method will be changed to throw
ConfigExceptioninstead ofQuorumPeerConfig.ConfigExceptionin future release.- Throws:
QuorumPeerConfig.ConfigException
-
ZKClientConfig
- Throws:
ConfigException
-
-
Method Details
-
handleBackwardCompatibility
protected void handleBackwardCompatibility()Description copied from class:ZKConfigNow onwards client code will use properties from this class but older clients still be setting properties through system properties. So to make this change backward compatible we should set old system properties in this configuration.- Overrides:
handleBackwardCompatibilityin classZKConfig
-
isSaslClientEnabled
public boolean isSaslClientEnabled()Returns true if the SASL client is enabled. By default, the client is enabled but can be disabled by setting the system propertyzookeeper.sasl.clienttofalse. See ZOOKEEPER-1657 for more information.- Returns:
- true if the SASL client is enabled.
-
isShuffleDnsResponseEnabled
public boolean isShuffleDnsResponseEnabled()Return true if we need to use the old behavior of default DNS resolver and always shuffle the IP addresses in the DNS lookup response in order to pick a completely random IP address. -
getLong
Get the value of thekeyproperty as anlong. If property is not set, the provideddefaultValueis returned- Parameters:
key- property key.defaultValue- default value.- Returns:
- return property value as an
long, ordefaultValue - Throws:
NumberFormatException- when the value is invalid
-