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 DataLoaderOptionsbuild()DataLoaderOptions.BuildersetBatchingEnabled(boolean batchingEnabled)Sets the option that determines whether batch loading is enabled.DataLoaderOptions.BuildersetBatchLoaderContextProvider(BatchLoaderContextProvider environmentProvider)Sets the batch loader environment provider that will be used to give context to batch load functionsDataLoaderOptions.BuildersetBatchLoaderScheduler(BatchLoaderScheduler batchLoaderScheduler)Sets in a newBatchLoaderSchedulerthat allows the call to aBatchLoaderfunction to be scheduled to some future time.DataLoaderOptions.BuildersetCacheKeyFunction(CacheKey<?> cacheKeyFunction)Sets the function to use for creating the cache key, if caching is enabled.DataLoaderOptions.BuildersetCacheMap(CacheMap<?,?> cacheMap)Sets the cache map implementation to use for caching, if caching is enabled.DataLoaderOptions.BuildersetCachingEnabled(boolean cachingEnabled)Sets the option that determines whether caching is enabled.DataLoaderOptions.BuildersetCachingExceptionsEnabled(boolean cachingExceptionsEnabled)Sets the option that determines whether exceptional values are cache enabled.DataLoaderOptions.BuildersetInstrumentation(DataLoaderInstrumentation instrumentation)Sets in a newDataLoaderInstrumentationDataLoaderOptions.BuildersetMaxBatchSize(int maxBatchSize)Sets the maximum number of keys that will be presented to theBatchLoaderfunction before they are split into multiple classDataLoaderOptions.BuildersetStatisticsCollector(java.util.function.Supplier<StatisticsCollector> statisticsCollector)Sets the statistics collector supplier that will be used with these data loader options.DataLoaderOptions.BuildersetValueCache(ValueCache<?,?> valueCache)Sets the value cache implementation to use for caching values, if caching is enabled.DataLoaderOptions.BuildersetValueCacheOptions(ValueCacheOptions valueCacheOptions)Sets theValueCacheOptionsthat control how theValueCachewill be used
-
-
-
Method Detail
-
setBatchingEnabled
public DataLoaderOptions.Builder setBatchingEnabled(boolean batchingEnabled)
Sets the option that determines whether batch loading is enabled.- Parameters:
batchingEnabled-trueto enable batch loading,falseotherwise- Returns:
- this builder for fluent coding
-
setCachingEnabled
public DataLoaderOptions.Builder setCachingEnabled(boolean cachingEnabled)
Sets the option that determines whether caching is enabled.- Parameters:
cachingEnabled-trueto enable caching,falseotherwise- 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-trueto enable caching exceptional values,falseotherwise- 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 theBatchLoaderfunction 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 theValueCacheOptionsthat control how theValueCachewill be used- Parameters:
valueCacheOptions- the value cache options- Returns:
- this builder for fluent coding
-
setBatchLoaderScheduler
public DataLoaderOptions.Builder setBatchLoaderScheduler(BatchLoaderScheduler batchLoaderScheduler)
Sets in a newBatchLoaderSchedulerthat allows the call to aBatchLoaderfunction 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()
-
-