Class OnlineIndexer.Config.Builder
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.OnlineIndexer.Config.Builder
-
- Enclosing class:
- OnlineIndexer.Config
@API(UNSTABLE) public static class OnlineIndexer.Config.Builder extends Object
A builder forOnlineIndexer.Config
. These are the mutable configuration parameters used while building indexes and are designed to be safe to be updated while a build is running.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnlineIndexer.Config
build()
Build aOnlineIndexer.Config
.OnlineIndexer.Config.Builder
setIncreaseLimitAfter(int increaseLimitAfter)
Set the number of successful range builds before re-increasing the number of records to process in a single transaction.OnlineIndexer.Config.Builder
setMaxLimit(int limit)
Set the maximum number of records to process in one transaction.OnlineIndexer.Config.Builder
setMaxRetries(int maxRetries)
Set the maximum number of times to retry a single range rebuild.OnlineIndexer.Config.Builder
setProgressLogIntervalMillis(long progressLogIntervalMillis)
Set the minimum time between successful progress logs when building across transactions.OnlineIndexer.Config.Builder
setRecordsPerSecond(int recordsPerSecond)
Set the maximum number of records to process in a single second.OnlineIndexer.Config.Builder
setWriteLimitBytes(int limit)
Set the maximum transaction size in a single transaction.
-
-
-
Method Detail
-
setMaxLimit
@Nonnull public OnlineIndexer.Config.Builder setMaxLimit(int limit)
Set the maximum number of records to process in one transaction. The default limit isOnlineIndexer.DEFAULT_LIMIT
= 100.- Parameters:
limit
- the maximum number of records to process in one transaction- Returns:
- this builder
-
setWriteLimitBytes
@Nonnull public OnlineIndexer.Config.Builder setWriteLimitBytes(int limit)
Set the maximum transaction size in a single transaction. The default limit isOnlineIndexer.DEFAULT_WRITE_LIMIT_BYTES
= 900000.- Parameters:
limit
- the approximate maximum write size in one transaction- Returns:
- this builder
-
setMaxRetries
@Nonnull public OnlineIndexer.Config.Builder setMaxRetries(int maxRetries)
Set the maximum number of times to retry a single range rebuild. The default number of retries isOnlineIndexer.DEFAULT_MAX_RETRIES
= 100.- Parameters:
maxRetries
- the maximum number of times to retry a single range rebuild- Returns:
- this builder
-
setRecordsPerSecond
@Nonnull public OnlineIndexer.Config.Builder setRecordsPerSecond(int recordsPerSecond)
Set the maximum number of records to process in a single second. The default number of retries isOnlineIndexer.DEFAULT_RECORDS_PER_SECOND
= 10000.- Parameters:
recordsPerSecond
- the maximum number of records to process in a single second- Returns:
- this builder
-
setProgressLogIntervalMillis
@Nonnull public OnlineIndexer.Config.Builder setProgressLogIntervalMillis(long progressLogIntervalMillis)
Set the minimum time between successful progress logs when building across transactions. Negative will not log at all, 0 will log after every commit.- Parameters:
progressLogIntervalMillis
- the number of milliseconds to wait between successful logs- Returns:
- this builder
-
setIncreaseLimitAfter
@Nonnull public OnlineIndexer.Config.Builder setIncreaseLimitAfter(int increaseLimitAfter)
Set the number of successful range builds before re-increasing the number of records to process in a single transaction. The number of records to process in a single transaction will never go aboveOnlineIndexer.Config.getMaxLimit()
. By default this isOnlineIndexer.DO_NOT_RE_INCREASE_LIMIT
, which means it will not re-increase after successes.- Parameters:
increaseLimitAfter
- the number of successful range builds before increasing the number of records processed in a single transaction- Returns:
- this builder
-
build
@Nonnull public OnlineIndexer.Config build()
Build aOnlineIndexer.Config
.- Returns:
- a new Config object needed by
OnlineIndexer
-
-