Package org.dataloader
Class DataLoaderOptions.Builder
- java.lang.Object
-
- org.dataloader.DataLoaderOptions.Builder
-
- Enclosing class:
- DataLoaderOptions
public static class DataLoaderOptions.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataLoaderOptions
build()
DataLoaderOptions.Builder
setBatchingEnabled(boolean batchingEnabled)
Sets the option that determines whether batch loading is enabled.DataLoaderOptions.Builder
setBatchLoaderContextProvider(BatchLoaderContextProvider environmentProvider)
Sets the batch loader environment provider that will be used to give context to batch load functionsDataLoaderOptions.Builder
setBatchLoaderScheduler(BatchLoaderScheduler batchLoaderScheduler)
Sets in a newBatchLoaderScheduler
that allows the call to aBatchLoader
function to be scheduled to some future time.DataLoaderOptions.Builder
setCacheKeyFunction(CacheKey<?> cacheKeyFunction)
Sets the function to use for creating the cache key, if caching is enabled.DataLoaderOptions.Builder
setCacheMap(CacheMap<?,?> cacheMap)
Sets the cache map implementation to use for caching, if caching is enabled.DataLoaderOptions.Builder
setCachingEnabled(boolean cachingEnabled)
Sets the option that determines whether caching is enabled.DataLoaderOptions.Builder
setCachingExceptionsEnabled(boolean cachingExceptionsEnabled)
Sets the option that determines whether exceptional values are cache enabled.DataLoaderOptions.Builder
setInstrumentation(DataLoaderInstrumentation instrumentation)
Sets in a newDataLoaderInstrumentation
DataLoaderOptions.Builder
setMaxBatchSize(int maxBatchSize)
Sets the maximum number of keys that will be presented to theBatchLoader
function before they are split into multiple classDataLoaderOptions.Builder
setStatisticsCollector(java.util.function.Supplier<StatisticsCollector> statisticsCollector)
Sets the statistics collector supplier that will be used with these data loader options.DataLoaderOptions.Builder
setValueCache(ValueCache<?,?> valueCache)
Sets the value cache implementation to use for caching values, if caching is enabled.DataLoaderOptions.Builder
setValueCacheOptions(ValueCacheOptions valueCacheOptions)
Sets theValueCacheOptions
that control how theValueCache
will be used
-
-
-
Method Detail
-
setBatchingEnabled
public DataLoaderOptions.Builder setBatchingEnabled(boolean batchingEnabled)
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
public DataLoaderOptions.Builder setCachingEnabled(boolean cachingEnabled)
Sets the option that determines whether caching is enabled.- Parameters:
cachingEnabled
-true
to enable caching,false
otherwise- Returns:
- this builder for fluent coding
-
setCachingExceptionsEnabled
public DataLoaderOptions.Builder setCachingExceptionsEnabled(boolean cachingExceptionsEnabled)
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
public DataLoaderOptions.Builder setCacheKeyFunction(CacheKey<?> cacheKeyFunction)
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
public DataLoaderOptions.Builder setCacheMap(CacheMap<?,?> cacheMap)
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
public DataLoaderOptions.Builder setValueCache(ValueCache<?,?> valueCache)
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
public DataLoaderOptions.Builder setMaxBatchSize(int maxBatchSize)
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(java.util.function.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
public DataLoaderOptions.Builder setValueCacheOptions(ValueCacheOptions valueCacheOptions)
Sets theValueCacheOptions
that control how theValueCache
will be used- Parameters:
valueCacheOptions
- the value cache options- Returns:
- this builder for fluent coding
-
setBatchLoaderScheduler
public DataLoaderOptions.Builder setBatchLoaderScheduler(BatchLoaderScheduler batchLoaderScheduler)
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
public DataLoaderOptions.Builder setInstrumentation(DataLoaderInstrumentation instrumentation)
Sets in a newDataLoaderInstrumentation
- Parameters:
instrumentation
- the newDataLoaderInstrumentation
- Returns:
- this builder for fluent coding
-
build
public DataLoaderOptions build()
-
-