Class ParallelBulkReader<TData>
- Namespace
- Hi.Common.ParallelBulkUtils
- Assembly
- HiGeom.dll
Parallel bulk reader that provides efficient data access with caching capabilities. Manages reading data in parallel with forward and backward caching to optimize performance.
public class ParallelBulkReader<TData> : IDisposable where TData : class
Type Parameters
TDataThe type of data to read.
- Inheritance
-
ParallelBulkReader<TData>
- Implements
- Inherited Members
- Extension Methods
Constructors
ParallelBulkReader(int, int, int, ReadBulkDelegate<TData>, Func<TData, int?>, Func<int>)
Initializes a new instance of the ParallelBulkReader<TData> class.
public ParallelBulkReader(int cacheBackwardDistance, int cacheForwardDistance, int cacheQueueLimit, ReadBulkDelegate<TData> readBulkFunc, Func<TData, int?> getIndexFunc, Func<int> countFunc)
Parameters
cacheBackwardDistanceintThe distance to cache backward from the current index.
cacheForwardDistanceintThe distance to cache forward from the current index.
cacheQueueLimitintThe maximum number of cache entries to maintain in the queue.
readBulkFuncReadBulkDelegate<TData>The function used to read bulk data.
getIndexFuncFunc<TData, int?>The function used to extract an index from a data item.
countFuncFunc<int>The function that returns the total count of available data items.
Properties
GetIndexFunc
Gets the function used to extract an index from a data item.
public Func<TData, int?> GetIndexFunc { get; }
Property Value
Methods
ClearCache()
Clears all cached data and disposes of all cache entries.
public void ClearCache()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the ParallelBulkReader<TData> and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposingbooltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
GetStep(int)
Gets a data item at the specified step index, with automatic caching.
public TData GetStep(int stepIndex)
Parameters
stepIndexintThe index of the step to retrieve.
Returns
- TData
The data item at the specified index.