public static final class SplitClientConfig.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
SplitClientConfig |
build() |
SplitClientConfig.Builder |
connectionTimeout(int ms)
Http client connection timeout.
|
SplitClientConfig.Builder |
disableDestroyOnShutDown()
Disables running destroy() on shutdown by default.
|
SplitClientConfig.Builder |
disableLabels()
Disable label capturing
|
SplitClientConfig.Builder |
enableDebug() |
SplitClientConfig.Builder |
endpoint(String endpoint,
String eventsEndpoint)
The rest endpoint that sdk will hit for latest features and segments.
|
SplitClientConfig.Builder |
eventFlushIntervalInMillis(long eventFlushIntervalInMillis)
How often to flush data to the collection services
|
SplitClientConfig.Builder |
eventsQueueSize(int eventsQueueSize)
Max size of the queue to trigger a flush
|
SplitClientConfig.Builder |
featuresRefreshRate(int seconds)
The SDK will poll the endpoint for changes to features at this period.
|
SplitClientConfig.Builder |
impressionListener(ImpressionListener impressionListener,
int queueSize)
You can provide your own ImpressionListener to capture all impressions
generated by SplitClient.
|
SplitClientConfig.Builder |
impressionsQueueSize(int impressionsQueueSize)
The impression listener captures the which key saw what treatment ("on", "off", etc)
at what time.
|
SplitClientConfig.Builder |
impressionsRefreshRate(int seconds)
The ImpressionListener captures the which key saw what treatment ("on", "off", etc)
at what time.
|
SplitClientConfig.Builder |
metricsRefreshRate(int seconds)
The diagnostic metrics collected by the SDK are pushed back to split endpoint
at this period.
|
SplitClientConfig.Builder |
numThreadsForSegmentFetch(int numThreadsForSegmentFetch)
The amount of threads used for the thread pool that fetches segments.
|
SplitClientConfig.Builder |
proxyHost(String proxyHost)
The host location of the proxy.
|
SplitClientConfig.Builder |
proxyPassword(String proxyPassword)
Set the password for authentication against the proxy (if proxy settings are enabled).
|
SplitClientConfig.Builder |
proxyPort(int proxyPort)
The port of the proxy.
|
SplitClientConfig.Builder |
proxyUsername(String proxyUsername)
Set the username for authentication against the proxy (if proxy settings are enabled).
|
SplitClientConfig.Builder |
readTimeout(int ms)
Http client read timeout.
|
SplitClientConfig.Builder |
segmentsRefreshRate(int seconds)
The SDK will poll the endpoint for changes to segments at this period in seconds.
|
SplitClientConfig.Builder |
setBlockUntilReadyTimeout(int milliseconds)
The SDK kicks off background threads to download data necessary
for using the SDK.
|
SplitClientConfig.Builder |
splitFile(String splitFile)
Set the location of the new yaml file for localhost mode defaulting to .split (legacy and deprecated format)
This setting is optional.
|
SplitClientConfig.Builder |
waitBeforeShutdown(int waitTime)
How long to wait for impressions background thread before shutting down
the underlying connections.
|
public SplitClientConfig.Builder numThreadsForSegmentFetch(int numThreadsForSegmentFetch)
numThreadsForSegmentFetch - MUST be > 0. Default is 2.public SplitClientConfig.Builder eventsQueueSize(int eventsQueueSize)
eventsQueueSize - public SplitClientConfig.Builder eventFlushIntervalInMillis(long eventFlushIntervalInMillis)
eventFlushIntervalInMillis - public SplitClientConfig.Builder endpoint(String endpoint, String eventsEndpoint)
endpoint - MUST NOT be nullpublic SplitClientConfig.Builder featuresRefreshRate(int seconds)
Implementation Note: The SDK actually polls at a random interval chosen between (0.5 * n, n). This is to ensure that SDKs that are deployed simultaneously on different machines do not inundate the backend with requests at the same interval.
seconds - MUST be greater than 0. Default value is 60.public SplitClientConfig.Builder segmentsRefreshRate(int seconds)
Implementation Note: The SDK actually polls at a random interval chosen between (0.5 * n, n). This is to ensure that SDKs that are deployed simultaneously on different machines do not inundate the backend with requests at the same interval.
seconds - MUST be greater than 0. Default value is 60.public SplitClientConfig.Builder impressionsRefreshRate(int seconds)
seconds - MUST be > 0.public SplitClientConfig.Builder impressionsQueueSize(int impressionsQueueSize)
This is an ADVANCED parameter.
impressionsQueueSize - MUST be > 0. Default is 5000.public SplitClientConfig.Builder impressionListener(ImpressionListener impressionListener, int queueSize)
Note that we will wrap any ImpressionListener provided in our own implementation with an Executor controlling impressions going into your ImpressionListener. This is done to protect SplitClient from any slowness caused by your ImpressionListener. The Executor will be given the capacity you provide as parameter which is the number of impressions that can be saved in a blocking queue while waiting for your ImpressionListener to log them. Of course, the larger the value of capacity, the more memory can be taken up.
The executor will create two threads.
This is an ADVANCED function.
impressionListener - queueSize - maximum number of impressions that will be queued in memory. If the impressionListener is
slow, the queue will fill up and any subsequent impressions will be dropped.public SplitClientConfig.Builder metricsRefreshRate(int seconds)
seconds - MUST be > 0.public SplitClientConfig.Builder connectionTimeout(int ms)
ms - MUST be greater than 0.public SplitClientConfig.Builder readTimeout(int ms)
ms - MUST be greater than 0.public SplitClientConfig.Builder enableDebug()
public SplitClientConfig.Builder disableLabels()
public SplitClientConfig.Builder setBlockUntilReadyTimeout(int milliseconds)
If this parameter is set to a non-negative value, the SDK
will block for that number of milliseconds for the data to be downloaded when
SplitClient.blockUntilReady() or SplitManager.blockUntilReady()
is called
milliseconds - MUST BE greater than or equal to 0;public SplitClientConfig.Builder waitBeforeShutdown(int waitTime)
waitTime - tine in millisecondspublic SplitClientConfig.Builder proxyHost(String proxyHost)
proxyHost - location of the proxypublic SplitClientConfig.Builder proxyPort(int proxyPort)
proxyPort - port for the proxypublic SplitClientConfig.Builder proxyUsername(String proxyUsername)
proxyUsername - public SplitClientConfig.Builder proxyPassword(String proxyPassword)
proxyPassword - public SplitClientConfig.Builder disableDestroyOnShutDown()
public SplitClientConfig.Builder splitFile(String splitFile)
splitFile - locationpublic SplitClientConfig build()
Copyright © 2019. All rights reserved.