Class DataLoaderOptions.Builder

  • Enclosing class:
    DataLoaderOptions

    public static class DataLoaderOptions.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • 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 the BatchLoader 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