Package org.dataloader
Class DataLoaderOptions.Builder
java.lang.Object
org.dataloader.DataLoaderOptions.Builder
- Enclosing class:
- DataLoaderOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
setBatchingEnabled
(boolean batchingEnabled) Sets the option that determines whether batch loading is enabled.setBatchLoaderContextProvider
(BatchLoaderContextProvider environmentProvider) Sets the batch loader environment provider that will be used to give context to batch load functionssetBatchLoaderScheduler
(BatchLoaderScheduler batchLoaderScheduler) Sets in a newBatchLoaderScheduler
that allows the call to aBatchLoader
function to be scheduled to some future time.setCacheKeyFunction
(CacheKey<?> cacheKeyFunction) Sets the function to use for creating the cache key, if caching is enabled.setCacheMap
(CacheMap<?, ?> cacheMap) Sets the cache map implementation to use for caching, if caching is enabled.setCachingEnabled
(boolean cachingEnabled) Sets the option that determines whether caching is enabled.setCachingExceptionsEnabled
(boolean cachingExceptionsEnabled) Sets the option that determines whether exceptional values are cache enabled.setInstrumentation
(DataLoaderInstrumentation instrumentation) Sets in a newDataLoaderInstrumentation
setMaxBatchSize
(int maxBatchSize) Sets the maximum number of keys that will be presented to theBatchLoader
function before they are split into multiple classsetStatisticsCollector
(Supplier<StatisticsCollector> statisticsCollector) Sets the statistics collector supplier that will be used with these data loader options.setValueCache
(ValueCache<?, ?> valueCache) Sets the value cache implementation to use for caching values, if caching is enabled.setValueCacheOptions
(ValueCacheOptions valueCacheOptions) Sets theValueCacheOptions
that control how theValueCache
will be used
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setBatchingEnabled
Sets the option that determines whether batch loading is enabled.- Parameters:
batchingEnabled
-true
to enable batch loading,false
otherwise- Returns:
- this builder for fluent coding
-
setCachingEnabled
Sets the option that determines whether caching is enabled.- Parameters:
cachingEnabled
-true
to enable caching,false
otherwise- Returns:
- this builder for fluent coding
-
setCachingExceptionsEnabled
Sets the option that determines whether exceptional values are cache enabled.- Parameters:
cachingExceptionsEnabled
-true
to enable caching exceptional values,false
otherwise- Returns:
- this builder for fluent coding
-
setCacheKeyFunction
Sets the function to use for creating the cache key, if caching is enabled.- Parameters:
cacheKeyFunction
- the cache key function to use- Returns:
- this builder for fluent coding
-
setCacheMap
Sets the cache map implementation to use for caching, if caching is enabled.- Parameters:
cacheMap
- the cache map instance- Returns:
- this builder for fluent coding
-
setValueCache
Sets the value cache implementation to use for caching values, if caching is enabled.- Parameters:
valueCache
- the value cache instance- Returns:
- this builder for fluent coding
-
setMaxBatchSize
Sets the maximum number of keys that will be presented to theBatchLoader
function before they are split into multiple class- Parameters:
maxBatchSize
- the maximum batch size- Returns:
- this builder for fluent coding
-
setStatisticsCollector
public DataLoaderOptions.Builder setStatisticsCollector(Supplier<StatisticsCollector> statisticsCollector) Sets the statistics collector supplier that will be used with these data loader options. Since it uses the supplier pattern, you can create a new statistics collector on each call, or you can reuse a common value- Parameters:
statisticsCollector
- the statistics collector to use- Returns:
- this builder for fluent coding
-
setBatchLoaderContextProvider
public DataLoaderOptions.Builder setBatchLoaderContextProvider(BatchLoaderContextProvider environmentProvider) Sets the batch loader environment provider that will be used to give context to batch load functions- Parameters:
environmentProvider
- the batch loader context provider- Returns:
- this builder for fluent coding
-
setValueCacheOptions
Sets theValueCacheOptions
that control how theValueCache
will be used- Parameters:
valueCacheOptions
- the value cache options- Returns:
- this builder for fluent coding
-
setBatchLoaderScheduler
Sets in a newBatchLoaderScheduler
that allows the call to aBatchLoader
function to be scheduled to some future time.- Parameters:
batchLoaderScheduler
- the scheduler- Returns:
- this builder for fluent coding
-
setInstrumentation
Sets in a newDataLoaderInstrumentation
- Parameters:
instrumentation
- the newDataLoaderInstrumentation
- Returns:
- this builder for fluent coding
-
build
-