Class BlockManagerParameters

java.lang.Object
org.apache.hadoop.fs.impl.prefetch.BlockManagerParameters

@Private public final class BlockManagerParameters extends Object
This class is used to provide parameters to BlockManager.
  • Constructor Details

    • BlockManagerParameters

      public BlockManagerParameters()
  • Method Details

    • getFuturePool

      public ExecutorServiceFuturePool getFuturePool()
      Returns:
      The Executor future pool to perform async prefetch tasks.
    • getBlockData

      public BlockData getBlockData()
      Returns:
      The object holding blocks data info for the underlying file.
    • getBufferPoolSize

      public int getBufferPoolSize()
      Returns:
      The size of the in-memory cache.
    • getPrefetchingStatistics

      public PrefetchingStatistics getPrefetchingStatistics()
      Returns:
      The prefetching statistics for the stream.
    • getConf

      public Configuration getConf()
      Returns:
      The configuration object.
    • getLocalDirAllocator

      public LocalDirAllocator getLocalDirAllocator()
      Returns:
      The local dir allocator instance.
    • getMaxBlocksCount

      public int getMaxBlocksCount()
      Returns:
      The max blocks count to be kept in cache at any time.
    • getTrackerFactory

      public DurationTrackerFactory getTrackerFactory()
      Returns:
      The duration tracker with statistics to update.
    • withFuturePool

      public BlockManagerParameters withFuturePool(ExecutorServiceFuturePool pool)
      Sets the executor service future pool that is later used to perform async prefetch tasks.
      Parameters:
      pool - The future pool.
      Returns:
      The builder.
    • withBlockData

      public BlockManagerParameters withBlockData(BlockData data)
      Sets the object holding blocks data info for the underlying file.
      Parameters:
      data - The block data object.
      Returns:
      The builder.
    • withBufferPoolSize

      public BlockManagerParameters withBufferPoolSize(int poolSize)
      Sets the in-memory cache size as number of blocks.
      Parameters:
      poolSize - The buffer pool size as number of blocks.
      Returns:
      The builder.
    • withPrefetchingStatistics

      public BlockManagerParameters withPrefetchingStatistics(PrefetchingStatistics statistics)
      Sets the prefetching statistics for the stream.
      Parameters:
      statistics - The prefetching statistics.
      Returns:
      The builder.
    • withConf

      public BlockManagerParameters withConf(Configuration configuration)
      Sets the configuration object.
      Parameters:
      configuration - The configuration object.
      Returns:
      The builder.
    • withLocalDirAllocator

      public BlockManagerParameters withLocalDirAllocator(LocalDirAllocator dirAllocator)
      Sets the local dir allocator for round-robin disk allocation while creating files.
      Parameters:
      dirAllocator - The local dir allocator object.
      Returns:
      The builder.
    • withMaxBlocksCount

      public BlockManagerParameters withMaxBlocksCount(int blocksCount)
      Sets the max blocks count to be kept in cache at any time.
      Parameters:
      blocksCount - The max blocks count.
      Returns:
      The builder.
    • withTrackerFactory

      public BlockManagerParameters withTrackerFactory(DurationTrackerFactory factory)
      Sets the duration tracker with statistics to update.
      Parameters:
      factory - The tracker factory object.
      Returns:
      The builder.