Class AbstractConfiguration<T extends AbstractConfiguration>
- All Implemented Interfaces:
Cloneable,org.apache.commons.configuration2.Configuration,org.apache.commons.configuration2.event.EventSource,org.apache.commons.configuration2.ImmutableConfiguration,org.apache.commons.configuration2.sync.SynchronizerSupport
- Direct Known Subclasses:
ClientConfiguration,ServerConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Class<? extends EntryFormatter>protected static final Class<? extends LedgerIdFormatter>protected static final ClassLoaderprotected static final intstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringThis list will be passed toSSLEngine.setEnabledCipherSuites(java.lang.String[]).protected static final StringThis list will be passed toSSLEngine.setEnabledProtocols(java.lang.String[]).protected static final Stringprotected static final Stringprotected static final StringTLS KeyStore, TrustStore, Password files and Certificate Paths.protected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasJson()returns the string representation of json format of this config.booleanReturn the configured leak detection policy for the allocator.intGet the client authentication provider factory class name.intGet the desired number of zones per write quorum in ZoneAwarePlacementPolicy.booleanGet the flag to enforce minimum number of fault domains for write.booleanGet the flag which enforces the minimum number of racks per write quorum.booleanGet the flag to enforce strict zoneaware placement.Class<? extends EntryFormatter>Get entry formatter class.getFeature(String configProperty, Feature defaultValue) booleanWhether to ignore localnode in placementpolicy.Class<? extends LedgerIdFormatter>Get ledger id formatter class.Class<? extends LedgerManagerFactory>Get ledger manager factory class.Get Ledger Manager Factory Class Name.Get layout string ("null" if unconfigured).Deprecated.intGet Ledger metadata format version.booleanReturn the flag indicating whether to limit stats logging.Get metadata service uri.Get metadata service uri.Get metastore implementation class.intGet max entries per scan in metastore.intGet the minimum number of racks per write quorum.intGet the minimum number of zones per write quorum in ZoneAwarePlacementPolicy.intGet the maximum netty frame size in bytes.String[]Get array of users specified in this property.booleanWhether to preserve MDC for tasks in Executor.intGet the bytes rate of re-replication.longGet the re-replication entry batch size.Get the class prefix of the shaded ledger manager factory class name allowed to be used for instantiating ledger manager factory.booleanReturn the flag that indicates whether auditor is using system time as underreplicated ledger mark time.protected abstract TgetThis()Trickery to allow inheritance with fluent style.longGet tls certificate files refresh duration in seconds.booleanWhether the client will send an TLS certificate on TLS-handshake.Get the list of enabled TLS cipher suites.Get the list of enabled TLS protocols.Get TLS Provider (JDK or OpenSSL).Get the security provider factory class name.Deprecated.Deprecated.doubleget the max tasks can be acquired per second of re-replication.doubleGet zookeeper access request rate limit.intGet zookeeper client backoff max retry times.Deprecated.since 4.7.0intGet zookeeper timeout.booleanReturn whether the busy-wait is enabled for BookKeeper and Netty IO threads.booleanIs shaded ledger manager factory class name allowed to be used for instantiating ledger manager factory.booleanAre z-node created with strict ACLs.voidYou can load configurations in precedence order.voidloadConf(org.apache.commons.configuration2.CompositeConfiguration baseConf) You can load configuration from other configuration.setAllocatorLeakDetectionPolicy(LeakDetectionPolicy leakDetectionPolicy) Enable the leak detection for the allocator.setAllocatorOutOfMemoryPolicy(OutOfMemoryPolicy oomPolicy) Define the memory allocator out of memory policy.setAllocatorPoolingConcurrency(int concurrency) Controls the amount of concurrency for the memory pool.setAllocatorPoolingPolicy(PoolingPolicy poolingPolicy) Define the memory pooling policy.setAllowShadedLedgerManagerFactoryClass(boolean allowed) Set the flag to allow using shaded ledger manager factory class for instantiating a ledger manager factory.setBusyWaitEnabled(boolean busyWaitEnabled) Option to enable busy-wait settings.setClientAuthProviderFactoryClass(String factoryClass) Set the client authentication provider factory class name.voidsetDesiredNumZonesPerWriteQuorum(int desiredNumZonesPerWriteQuorum) Set the desired number of zones per write quorum in ZoneAwarePlacementPolicy.voidsetEnforceMinNumFaultDomainsForWrite(boolean enforceMinNumFaultDomainsForWrite) Set the flag to enforce minimum number of fault domains for write.voidsetEnforceMinNumRacksPerWriteQuorum(boolean enforceMinNumRacksPerWriteQuorum) Set the flag to enforce minimum number of racks per write quorum.voidsetEnforceStrictZoneawarePlacement(boolean enforceStrictZoneawarePlacement) Set the flag to enforce strict zoneaware placement.voidsetEntryFormatterClass(Class<? extends EntryFormatter> formatterClass) Set entry formatter Class.setExitOnOutOfMemory(boolean exitOnOutOfMemory) voidsetFeature(String configProperty, Feature feature) voidsetIgnoreLocalNodeInPlacementPolicy(boolean ignoreLocalNodeInPlacementPolicy) Sets the flag to ignore usage of localnode in placement policy.voidsetLedgerIdFormatterClass(Class<? extends LedgerIdFormatter> formatterClass) Set Ledger id formatter Class.voidsetLedgerManagerFactoryClass(Class<? extends LedgerManagerFactory> factoryClass) Set Ledger Manager Factory Class.voidsetLedgerManagerFactoryClassName(String factoryClassName) Set Ledger Manager Factory Class Name.voidsetLedgerManagerType(String lmType) voidsetLedgerMetadataFormatVersion(int metadataFormatVersion) Set Ledger metadata format version.setLimitStatsLogging(boolean limitStatsLogging) Sets flag to limit the stats logging.setMetadataServiceUri(String serviceUri) Set the metadata service uri.voidsetMetastoreImplClass(String metastoreImplClass) Set metastore implementation class.voidsetMetastoreMaxEntriesPerScan(int maxEntries) Set max entries per scan in metastore.voidsetMinNumRacksPerWriteQuorum(int minNumRacksPerWriteQuorum) Set the minimum number of racks per write quorum.voidsetMinNumZonesPerWriteQuorum(int minNumZonesPerWriteQuorum) Set the minimum number of zones per write quorum in ZoneAwarePlacementPolicy.setNettyMaxFrameSizeBytes(int maxSize) Set the max number of bytes a single message can be that is read by the bookie.voidLimit who can start the application to prevent future permission errors.setPreserveMdcForTaskExecution(boolean enabled) Whether to preserve MDC for tasks in Executor.setReplicationRateByBytes(int rate) Set the bytes rate of re-replication.voidsetRereplicationEntryBatchSize(long rereplicationEntryBatchSize) Set the max entries to keep in fragment for re-replication.setShadedLedgerManagerFactoryClassPrefix(String classPrefix) Set the class prefix of the shaded ledger manager factory class for instantiating a ledger manager factory.setStoreSystemTimeAsLedgerUnderreplicatedMarkTime(boolean enabled) Enable the Auditor to use system time as underreplicated ledger mark time.setTLSCertFilesRefreshDurationSeconds(long certFilesRefreshSec) Set tls certificate files refresh duration in seconds.setTLSClientAuthentication(boolean enabled) Specify whether the client will send an TLS certificate on TLS-handshake.Set the list of enabled TLS cipher suites.setTLSEnabledProtocols(String list) Set the list of enabled TLS protocols.setTLSProvider(String provider) Set TLS Provider (JDK or OpenSSL).setTLSProviderFactoryClass(String factoryClass) Set the client security provider factory class name.voidsetZkEnableSecurity(boolean zkEnableSecurity) Set the usage of ACLs of new z-nodes.voidsetZkLedgersRootPath(String zkLedgersPath) Deprecated.setZkReplicationTaskRateLimit(double zkReplicationTaskRateLimit) set the max tasks can be acquired per second of re-replication, default is 0, which means no limit.voidsetZkRequestRateLimit(double rateLimit) Set zookeeper access request rate limit.setZkRetryBackoffMaxRetries(int maxRetries) Set zookeeper client backoff max retry times.setZkServers(String zkServers) Deprecated.setZkTimeout(int zkTimeout) Set zookeeper timeout.Methods inherited from class org.apache.commons.configuration2.CompositeConfiguration
addConfiguration, addConfiguration, addConfigurationFirst, addConfigurationFirst, addPropertyDirect, clearInternal, clearPropertyDirect, clone, containsKeyInternal, containsValueInternal, getConfiguration, getInMemoryConfiguration, getKeysInternal, getKeysInternal, getKeysInternal, getList, getNumberOfConfigurations, getPropertyInternal, getSource, getStringArray, isEmptyInternal, removeConfiguration, setListDelimiterHandlerMethods inherited from class org.apache.commons.configuration2.AbstractConfiguration
addErrorLogListener, addProperty, addPropertyInternal, append, beginRead, beginWrite, clear, clearProperty, cloneInterpolator, contains, containsKey, containsValue, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getDuration, getDuration, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getKeys, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, interpolatedConfiguration, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setPropertyInternal, setSynchronizer, setThrowExceptionOnMissing, size, sizeInternal, subset, unlockMethods inherited from class org.apache.commons.configuration2.event.BaseEventSource
addEventListener, clearErrorListeners, clearEventListeners, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEventsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.configuration2.ImmutableConfiguration
getEnum, getEnum
-
Field Details
-
READ_SYSTEM_PROPERTIES_PROPERTY
- See Also:
-
DEFAULT_LOADER
-
ZK_TIMEOUT
- See Also:
-
ZK_SERVERS
- See Also:
-
ZK_RETRY_BACKOFF_MAX_RETRIES
- See Also:
-
LEDGER_MANAGER_TYPE
- See Also:
-
LEDGER_MANAGER_FACTORY_CLASS
- See Also:
-
LEDGER_METADATA_FORMAT_VERSION
- See Also:
-
ALLOW_SHADED_LEDGER_MANAGER_FACTORY_CLASS
- See Also:
-
SHADED_LEDGER_MANAGER_FACTORY_CLASS_PREFIX
- See Also:
-
METADATA_SERVICE_URI
- See Also:
-
ZK_LEDGERS_ROOT_PATH
- See Also:
-
ZK_REQUEST_RATE_LIMIT
- See Also:
-
ZK_REPLICATION_TASK_RATE_LIMIT
- See Also:
-
AVAILABLE_NODE
- See Also:
-
REREPLICATION_ENTRY_BATCH_SIZE
- See Also:
-
STORE_SYSTEMTIME_AS_LEDGER_UNDERREPLICATED_MARK_TIME
- See Also:
-
STORE_SYSTEMTIME_AS_LEDGER_CREATION_TIME
- See Also:
-
ENABLE_BUSY_WAIT
- See Also:
-
ENABLE_HEALTH_CHECK
- See Also:
-
METASTORE_IMPL_CLASS
- See Also:
-
METASTORE_MAX_ENTRIES_PER_SCAN
- See Also:
-
TLS_PROVIDER
- See Also:
-
TLS_PROVIDER_FACTORY_CLASS
- See Also:
-
LEDGERID_FORMATTER_CLASS
- See Also:
-
ENTRY_FORMATTER_CLASS
- See Also:
-
TLS_CLIENT_AUTHENTICATION
- See Also:
-
PRESERVE_MDC_FOR_TASK_EXECUTION
- See Also:
-
DEFAULT_ENTRY_FORMATTER
-
DEFAULT_LEDGERID_FORMATTER
-
TLS_CERT_FILES_REFRESH_DURATION_SECONDS
- See Also:
-
TLS_ENABLED_CIPHER_SUITES
This list will be passed toSSLEngine.setEnabledCipherSuites(java.lang.String[]). Please refer to official JDK JavaDocs- See Also:
-
TLS_ENABLED_PROTOCOLS
This list will be passed toSSLEngine.setEnabledProtocols(java.lang.String[]). Please refer to official JDK JavaDocs- See Also:
-
TLS_KEYSTORE_TYPE
TLS KeyStore, TrustStore, Password files and Certificate Paths.- See Also:
-
TLS_KEYSTORE
- See Also:
-
TLS_KEYSTORE_PASSWORD_PATH
- See Also:
-
TLS_TRUSTSTORE_TYPE
- See Also:
-
TLS_TRUSTSTORE
- See Also:
-
TLS_TRUSTSTORE_PASSWORD_PATH
- See Also:
-
TLS_CERTIFICATE_PATH
- See Also:
-
NETTY_MAX_FRAME_SIZE
- See Also:
-
DEFAULT_NETTY_MAX_FRAME_SIZE
protected static final int DEFAULT_NETTY_MAX_FRAME_SIZE- See Also:
-
ZK_ENABLE_SECURITY
- See Also:
-
LEDGER_MANAGER_FACTORY_DISABLE_CLASS_CHECK
- See Also:
-
PERMITTED_STARTUP_USERS
- See Also:
-
MIN_NUM_RACKS_PER_WRITE_QUORUM
- See Also:
-
ENFORCE_MIN_NUM_RACKS_PER_WRITE_QUORUM
- See Also:
-
ENFORCE_MIN_NUM_FAULT_DOMAINS_FOR_WRITE
- See Also:
-
IGNORE_LOCAL_NODE_IN_PLACEMENT_POLICY
- See Also:
-
MIN_NUM_ZONES_PER_WRITE_QUORUM
- See Also:
-
DESIRED_NUM_ZONES_PER_WRITE_QUORUM
- See Also:
-
ENFORCE_STRICT_ZONEAWARE_PLACEMENT
- See Also:
-
ALLOCATOR_POOLING_POLICY
- See Also:
-
ALLOCATOR_POOLING_CONCURRENCY
- See Also:
-
ALLOCATOR_OOM_POLICY
- See Also:
-
ALLOCATOR_LEAK_DETECTION_POLICY
- See Also:
-
ALLOCATOR_EXIT_ON_OUT_OF_MEMORY
- See Also:
-
LIMIT_STATS_LOGGING
- See Also:
-
REPLICATION_RATE_BY_BYTES
- See Also:
-
-
Constructor Details
-
AbstractConfiguration
protected AbstractConfiguration()
-
-
Method Details
-
setPermittedStartupUsers
Limit who can start the application to prevent future permission errors. -
getPermittedStartupUsers
Get array of users specified in this property. -
loadConf
public void loadConf(URL confURL) throws org.apache.commons.configuration2.ex.ConfigurationException You can load configurations in precedence order. The first one takes precedence over any loaded later.- Parameters:
confURL- Configuration URL- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
loadConf
public void loadConf(org.apache.commons.configuration2.CompositeConfiguration baseConf) You can load configuration from other configuration.- Parameters:
baseConf- Other Configuration
-
getMetadataServiceUriUnchecked
Get metadata service uri.Warning: this method silently converts checked exceptions to unchecked exceptions. It is useful to use this method in lambda expressions. However it should not be used with places which have logics to handle checked exceptions. In such cases use
getMetadataServiceUri()instead.- Returns:
- metadata service uri
- Throws:
UncheckedConfigurationException- if the metadata service uri is invalid.
-
getMetadataServiceUri
public String getMetadataServiceUri() throws org.apache.commons.configuration2.ex.ConfigurationExceptionGet metadata service uri.- Returns:
- metadata service uri.
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException- if the metadata service uri is invalid.
-
setMetadataServiceUri
Set the metadata service uri.- Parameters:
serviceUri- the metadata service uri.- Returns:
- the configuration object.
-
getZkServers
Deprecated.since 4.7.0Get zookeeper servers to connect.`zkServers` is deprecating, in favor of using `metadataServiceUri`
- Returns:
- zookeeper servers
-
setZkServers
Deprecated.Set zookeeper servers to connect.`zkServers` is deprecating, in favor of using `metadataServiceUri`
- Parameters:
zkServers- ZooKeeper servers to connect
-
getZkTimeout
public int getZkTimeout()Get zookeeper timeout.- Returns:
- zookeeper server timeout
-
setZkTimeout
Set zookeeper timeout.- Parameters:
zkTimeout- ZooKeeper server timeout- Returns:
- server configuration
-
getZkRetryBackoffMaxRetries
public int getZkRetryBackoffMaxRetries()Get zookeeper client backoff max retry times.- Returns:
- zk backoff max retry times.
-
setZkRetryBackoffMaxRetries
Set zookeeper client backoff max retry times.- Parameters:
maxRetries- backoff max retry times- Returns:
- server configuration.
-
setLedgerManagerType
Deprecated.Set Ledger Manager Type.- Parameters:
lmType- Ledger Manager Type
-
getLedgerManagerType
Deprecated.replaced bygetLedgerManagerFactoryClass()Get Ledger Manager Type.- Returns:
- ledger manager type
-
setAllowShadedLedgerManagerFactoryClass
Set the flag to allow using shaded ledger manager factory class for instantiating a ledger manager factory.- Parameters:
allowed- the flag to allow/disallow using shaded ledger manager factory class- Returns:
- configuration instance.
-
isShadedLedgerManagerFactoryClassAllowed
public boolean isShadedLedgerManagerFactoryClassAllowed()Is shaded ledger manager factory class name allowed to be used for instantiating ledger manager factory.- Returns:
- ledger manager factory class name.
-
setShadedLedgerManagerFactoryClassPrefix
Set the class prefix of the shaded ledger manager factory class for instantiating a ledger manager factory.This setting only takes effects when
isShadedLedgerManagerFactoryClassAllowed()returns true.- Parameters:
classPrefix- the class prefix of shaded ledger manager factory class- Returns:
- configuration instance.
-
getShadedLedgerManagerFactoryClassPrefix
Get the class prefix of the shaded ledger manager factory class name allowed to be used for instantiating ledger manager factory.This setting only takes effects when
isShadedLedgerManagerFactoryClassAllowed()returns true- Returns:
- ledger manager factory class name.
- See Also:
-
setLedgerManagerFactoryClassName
Set Ledger Manager Factory Class Name.- Parameters:
factoryClassName- Ledger Manager Factory Class Name
-
getLedgerManagerFactoryClassName
Get Ledger Manager Factory Class Name.- Returns:
- ledger manager factory class name.
-
setLedgerMetadataFormatVersion
public void setLedgerMetadataFormatVersion(int metadataFormatVersion) Set Ledger metadata format version.- Parameters:
metadataFormatVersion- Ledger metadata format version. pass -1 to use default version
-
getLedgerMetadataFormatVersion
public int getLedgerMetadataFormatVersion()Get Ledger metadata format version.- Returns:
- ledger metadata format version.
-
getLedgerManagerLayoutStringFromFactoryClass
public String getLedgerManagerLayoutStringFromFactoryClass() throws org.apache.commons.configuration2.ex.ConfigurationExceptionGet layout string ("null" if unconfigured).- Returns:
- null, hierarchical, longhierarchical, or flat based on LEDGER_MANAGER_FACTORY_CLASS
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
setLedgerManagerFactoryClass
Set Ledger Manager Factory Class.- Parameters:
factoryClass- Ledger Manager Factory Class
-
getLedgerManagerFactoryClass
public Class<? extends LedgerManagerFactory> getLedgerManagerFactoryClass() throws org.apache.commons.configuration2.ex.ConfigurationExceptionGet ledger manager factory class.- Returns:
- ledger manager factory class
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
setZkLedgersRootPath
Deprecated.Set Zk Ledgers Root Path.- Parameters:
zkLedgersPath- zk ledgers root path
-
getZkLedgersRootPath
Deprecated.Get Zk Ledgers Root Path.- Returns:
- zk ledgers root path
-
getZkRequestRateLimit
public double getZkRequestRateLimit()Get zookeeper access request rate limit.- Returns:
- zookeeper access request rate limit.
-
setZkRequestRateLimit
public void setZkRequestRateLimit(double rateLimit) Set zookeeper access request rate limit.- Parameters:
rateLimit- zookeeper access request rate limit.
-
isZkEnableSecurity
public boolean isZkEnableSecurity()Are z-node created with strict ACLs.- Returns:
- usage of secure ZooKeeper ACLs
-
setZkEnableSecurity
public void setZkEnableSecurity(boolean zkEnableSecurity) Set the usage of ACLs of new z-nodes.- Parameters:
zkEnableSecurity-
-
getZkAvailableBookiesPath
Deprecated.Get the node under which available bookies are stored.- Returns:
- Node under which available bookies are stored.
-
setRereplicationEntryBatchSize
public void setRereplicationEntryBatchSize(long rereplicationEntryBatchSize) Set the max entries to keep in fragment for re-replication. If fragment has more entries than this count, then the original fragment will be split into multiple small logical fragments by keeping max entries count to rereplicationEntryBatchSize. So, re-replication will happen in batches wise. -
getRereplicationEntryBatchSize
public long getRereplicationEntryBatchSize()Get the re-replication entry batch size. -
getMetastoreImplClass
Get metastore implementation class.- Returns:
- metastore implementation class name.
-
setMetastoreImplClass
Set metastore implementation class.- Parameters:
metastoreImplClass- Metastore implementation Class name.
-
getMetastoreMaxEntriesPerScan
public int getMetastoreMaxEntriesPerScan()Get max entries per scan in metastore.- Returns:
- max entries per scan in metastore.
-
setMetastoreMaxEntriesPerScan
public void setMetastoreMaxEntriesPerScan(int maxEntries) Set max entries per scan in metastore.- Parameters:
maxEntries- Max entries per scan in metastore.
-
setFeature
-
getFeature
-
setLedgerIdFormatterClass
Set Ledger id formatter Class.- Parameters:
formatterClass- LedgerIdFormatter Class
-
getLedgerIdFormatterClass
public Class<? extends LedgerIdFormatter> getLedgerIdFormatterClass() throws org.apache.commons.configuration2.ex.ConfigurationExceptionGet ledger id formatter class.- Returns:
- LedgerIdFormatter class
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
setEntryFormatterClass
Set entry formatter Class.- Parameters:
formatterClass- EntryFormatter Class
-
getEntryFormatterClass
public Class<? extends EntryFormatter> getEntryFormatterClass() throws org.apache.commons.configuration2.ex.ConfigurationExceptionGet entry formatter class.- Returns:
- EntryFormatter class
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException
-
setClientAuthProviderFactoryClass
Set the client authentication provider factory class name. If this is not set, no authentication will be used- Parameters:
factoryClass- the client authentication provider factory class name- Returns:
- client configuration
-
getClientAuthProviderFactoryClass
Get the client authentication provider factory class name. If this returns null, no authentication will take place.- Returns:
- the client authentication provider factory class name or null.
-
getNettyMaxFrameSizeBytes
public int getNettyMaxFrameSizeBytes()Get the maximum netty frame size in bytes. Any message received larger that this will be rejected.- Returns:
- the maximum netty frame size in bytes.
-
setNettyMaxFrameSizeBytes
Set the max number of bytes a single message can be that is read by the bookie. Any message larger than that size will be rejected.- Parameters:
maxSize- the max size in bytes- Returns:
- server configuration
-
getTLSProviderFactoryClass
Get the security provider factory class name. If this returns null, no security will be enforced on the channel.- Returns:
- the security provider factory class name or null.
-
setTLSProviderFactoryClass
Set the client security provider factory class name. If this is not set, no security will be used on the channel.- Parameters:
factoryClass- the client security provider factory class name- Returns:
- client configuration
-
getTLSProvider
Get TLS Provider (JDK or OpenSSL).- Returns:
- the TLS provider to use in creating TLS Context
-
setTLSProvider
Set TLS Provider (JDK or OpenSSL).- Parameters:
provider- TLS Provider type- Returns:
- Client Configuration
-
getTLSClientAuthentication
public boolean getTLSClientAuthentication()Whether the client will send an TLS certificate on TLS-handshake.- Returns:
- whether TLS is enabled on the bookie or not.
- See Also:
-
setTLSClientAuthentication
Specify whether the client will send an TLS certificate on TLS-handshake.- Parameters:
enabled- Whether to send a certificate or not- Returns:
- client configuration
-
setTLSCertFilesRefreshDurationSeconds
Set tls certificate files refresh duration in seconds.- Parameters:
certFilesRefreshSec- tls certificate files refresh duration in seconds (set 0 to disable auto refresh)- Returns:
- current configuration
-
getTLSCertFilesRefreshDurationSeconds
public long getTLSCertFilesRefreshDurationSeconds()Get tls certificate files refresh duration in seconds.- Returns:
- tls certificate files refresh duration in seconds. Default 0 to disable auto refresh.
-
setTLSEnabledCipherSuites
Set the list of enabled TLS cipher suites. Leave null not to override default JDK list. This list will be passed toSSLEngine.setEnabledCipherSuites(java.lang.String[]). Please refer to official JDK JavaDocs- Parameters:
list- comma separated list of enabled TLS cipher suites- Returns:
- current configuration
-
getTLSEnabledCipherSuites
Get the list of enabled TLS cipher suites.- Returns:
- this list of enabled TLS cipher suites
- See Also:
-
setTLSEnabledProtocols
Set the list of enabled TLS protocols. Leave null not to override default JDK list. This list will be passed toSSLEngine.setEnabledProtocols(java.lang.String[]). Please refer to official JDK JavaDocs- Parameters:
list- comma separated list of enabled TLS cipher suites- Returns:
- current configuration
-
getTLSEnabledProtocols
Get the list of enabled TLS protocols.- Returns:
- the list of enabled TLS protocols.
- See Also:
-
setMinNumRacksPerWriteQuorum
public void setMinNumRacksPerWriteQuorum(int minNumRacksPerWriteQuorum) Set the minimum number of racks per write quorum. -
getMinNumRacksPerWriteQuorum
public int getMinNumRacksPerWriteQuorum()Get the minimum number of racks per write quorum. -
setMinNumZonesPerWriteQuorum
public void setMinNumZonesPerWriteQuorum(int minNumZonesPerWriteQuorum) Set the minimum number of zones per write quorum in ZoneAwarePlacementPolicy. -
getMinNumZonesPerWriteQuorum
public int getMinNumZonesPerWriteQuorum()Get the minimum number of zones per write quorum in ZoneAwarePlacementPolicy. -
setDesiredNumZonesPerWriteQuorum
public void setDesiredNumZonesPerWriteQuorum(int desiredNumZonesPerWriteQuorum) Set the desired number of zones per write quorum in ZoneAwarePlacementPolicy. -
getDesiredNumZonesPerWriteQuorum
public int getDesiredNumZonesPerWriteQuorum()Get the desired number of zones per write quorum in ZoneAwarePlacementPolicy. -
setEnforceStrictZoneawarePlacement
public void setEnforceStrictZoneawarePlacement(boolean enforceStrictZoneawarePlacement) Set the flag to enforce strict zoneaware placement.in ZoneawareEnsemblePlacementPolicy if strict placement is enabled then minZones/desiredZones in writeQuorum would be maintained otherwise it will pick nodes randomly.
-
getEnforceStrictZoneawarePlacement
public boolean getEnforceStrictZoneawarePlacement()Get the flag to enforce strict zoneaware placement.in ZoneawareEnsemblePlacementPolicy if strict placement is enabled then minZones/desiredZones in writeQuorum would be maintained otherwise it will pick nodes randomly.
-
setEnforceMinNumRacksPerWriteQuorum
public void setEnforceMinNumRacksPerWriteQuorum(boolean enforceMinNumRacksPerWriteQuorum) Set the flag to enforce minimum number of racks per write quorum. -
getEnforceMinNumRacksPerWriteQuorum
public boolean getEnforceMinNumRacksPerWriteQuorum()Get the flag which enforces the minimum number of racks per write quorum. -
setEnforceMinNumFaultDomainsForWrite
public void setEnforceMinNumFaultDomainsForWrite(boolean enforceMinNumFaultDomainsForWrite) Set the flag to enforce minimum number of fault domains for write. -
getEnforceMinNumFaultDomainsForWrite
public boolean getEnforceMinNumFaultDomainsForWrite()Get the flag to enforce minimum number of fault domains for write. -
setIgnoreLocalNodeInPlacementPolicy
public void setIgnoreLocalNodeInPlacementPolicy(boolean ignoreLocalNodeInPlacementPolicy) Sets the flag to ignore usage of localnode in placement policy. -
getIgnoreLocalNodeInPlacementPolicy
public boolean getIgnoreLocalNodeInPlacementPolicy()Whether to ignore localnode in placementpolicy. -
setStoreSystemTimeAsLedgerUnderreplicatedMarkTime
Enable the Auditor to use system time as underreplicated ledger mark time.If this is enabled, Auditor will write a ctime field into the underreplicated ledger znode.
- Parameters:
enabled- flag to enable/disable Auditor using system time as underreplicated ledger mark time.
-
getStoreSystemTimeAsLedgerUnderreplicatedMarkTime
public boolean getStoreSystemTimeAsLedgerUnderreplicatedMarkTime()Return the flag that indicates whether auditor is using system time as underreplicated ledger mark time.- Returns:
- the flag that indicates whether auditor is using system time as underreplicated ledger mark time.
-
getPreserveMdcForTaskExecution
public boolean getPreserveMdcForTaskExecution()Whether to preserve MDC for tasks in Executor.- Returns:
- flag to enable/disable MDC preservation in Executor.
-
setPreserveMdcForTaskExecution
Whether to preserve MDC for tasks in Executor.- Parameters:
enabled- flag to enable/disable MDC preservation in Executor.- Returns:
- configuration.
-
getAllocatorPoolingPolicy
- Returns:
- the configured pooling policy for the allocator.
-
setAllocatorPoolingPolicy
Define the memory pooling policy.Default is
PoolingPolicy.PooledDirect- Parameters:
poolingPolicy- the memory pooling policy- Returns:
- configuration object.
-
getAllocatorPoolingConcurrency
public int getAllocatorPoolingConcurrency()- Returns:
- the configured pooling concurrency for the allocator.
-
setAllocatorPoolingConcurrency
Controls the amount of concurrency for the memory pool.Default is to have a number of allocator arenas equals to 2 * CPUS.
Decreasing this number will reduce the amount of memory overhead, at the expense of increased allocation contention.
- Parameters:
concurrency- the concurrency level to use for the allocator pool- Returns:
- configuration object.
-
getAllocatorOutOfMemoryPolicy
- Returns:
- the configured ouf of memory policy for the allocator.
-
setAllocatorOutOfMemoryPolicy
Define the memory allocator out of memory policy.Default is
OutOfMemoryPolicy.FallbackToHeap- Parameters:
oomPolicy- the "out-of-memory" policy for the memory allocator- Returns:
- configuration object.
-
getAllocatorLeakDetectionPolicy
Return the configured leak detection policy for the allocator. -
setAllocatorLeakDetectionPolicy
Enable the leak detection for the allocator.Default is
LeakDetectionPolicy.Disabled- Parameters:
leakDetectionPolicy- the leak detection policy for the memory allocator- Returns:
- configuration object.
-
setExitOnOutOfMemory
-
exitOnOutOfMemory
public boolean exitOnOutOfMemory() -
isBusyWaitEnabled
public boolean isBusyWaitEnabled()Return whether the busy-wait is enabled for BookKeeper and Netty IO threads.Default is false
- Returns:
- the value of the option
-
setBusyWaitEnabled
Option to enable busy-wait settings.Default is false.
WARNING: This option will enable spin-waiting on executors and IO threads in order to reduce latency during context switches. The spinning will consume 100% CPU even when bookie is not doing any work. It is recommended to reduce the number of threads in the main workers pool (
ClientConfiguration.setNumWorkerThreads(int)) and Netty event loopClientConfiguration.setNumIOThreads(int)to only have few CPU cores busy.- Parameters:
busyWaitEnabled- if enabled, use spin-waiting strategy to reduce latency in context switches- See Also:
-
getLimitStatsLogging
public boolean getLimitStatsLogging()Return the flag indicating whether to limit stats logging.- Returns:
- the boolean flag indicating whether to limit stats logging
-
setLimitStatsLogging
Sets flag to limit the stats logging.- Parameters:
limitStatsLogging- flag to limit the stats logging.- Returns:
- configuration.
-
getReplicationRateByBytes
public int getReplicationRateByBytes()Get the bytes rate of re-replication. Default value is -1 which it means entries will replicated without any throttling activity.- Returns:
- bytes rate of re-replication.
-
setReplicationRateByBytes
Set the bytes rate of re-replication.- Parameters:
rate- bytes rate of re-replication.- Returns:
- ClientConfiguration
-
getZkReplicationTaskRateLimit
public double getZkReplicationTaskRateLimit()get the max tasks can be acquired per second of re-replication.- Returns:
- max tasks can be acquired per second of re-replication.
-
setZkReplicationTaskRateLimit
set the max tasks can be acquired per second of re-replication, default is 0, which means no limit. Value greater than 0 will enable the rate limiting. Decimal value is allowed. For example, 0.5 means 1 task per 2 seconds, 1 means 1 task per second.- Parameters:
zkReplicationTaskRateLimit-- Returns:
- ClientConfiguration
-
getThis
Trickery to allow inheritance with fluent style. -
asJson
returns the string representation of json format of this config.- Returns:
- Throws:
JsonUtil.ParseJsonException
-
getLedgerManagerFactoryClass()