Class ReadableChannelSources
java.lang.Object
org.aksw.commons.io.input.ReadableChannelSources
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Path cacheBaseFolder, String cacheEntryId, AdvancedRangeCacheConfig cacheConfig) static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Path cacheBaseFolder, Path<String> cacheEntryId, AdvancedRangeCacheConfig cacheConfig) static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Path cacheBaseFolder, Path<String> cacheEntryId, AdvancedRangeCacheConfig cacheConfig, Consumer<com.esotericsoftware.kryo.Kryo> customRegistrator) static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Slice<A> slice, AdvancedRangeCacheConfig cacheConfig) Set up an advanced range cache with a certain slice backendstatic <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, ObjectStore objectStore, Path<String> cacheEntryId, AdvancedRangeCacheConfig cacheConfig) static <A> ReadableChannelSource<A> cacheInMemory(ReadableChannelSource<A> source, int pageSize, int maxPages, long maxRequestSize) Simple mem-cache setupstatic ReadableChannelSource<byte[]> static ReadableChannelSource<byte[]> static <T> ReadableChannelSource<T[]> ofStreamFactory(Supplier<Stream<T>> streamFactory) Create a source where channels are based on creating a new stream and skipping to the specified offset.static <A, T extends ReadableChannelSource<A>>
Stream<SourceSplit<A, T>> splitByCount(T source, int splitCount) Create a number of splits of the given source.static <A, T extends ReadableChannelSource<A>>
Stream<SourceSplit<A, T>> splitBySize(T source, long splitSize) Create splits of the given size.
-
Constructor Details
-
ReadableChannelSources
public ReadableChannelSources()
-
-
Method Details
-
of
- Throws:
IOException
-
ofStreamFactory
Create a source where channels are based on creating a new stream and skipping to the specified offset. -
of
- Parameters:
path- The path which to wrap as a DataStreamSourcecacheSize- If true the file size will be cached. If false then every size request delegates to Files.size(path) which can massively degrade performance.- Returns:
- Throws:
IOException
-
cacheInMemory
public static <A> ReadableChannelSource<A> cacheInMemory(ReadableChannelSource<A> source, int pageSize, int maxPages, long maxRequestSize) Simple mem-cache setup -
cache
public static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Path cacheBaseFolder, String cacheEntryId, AdvancedRangeCacheConfig cacheConfig) -
cache
public static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Path cacheBaseFolder, Path<String> cacheEntryId, AdvancedRangeCacheConfig cacheConfig) -
cache
public static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Path cacheBaseFolder, Path<String> cacheEntryId, AdvancedRangeCacheConfig cacheConfig, Consumer<com.esotericsoftware.kryo.Kryo> customRegistrator) -
cache
public static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, ObjectStore objectStore, Path<String> cacheEntryId, AdvancedRangeCacheConfig cacheConfig) -
cache
public static <A> ReadableChannelSource<A> cache(ReadableChannelSource<A> source, Slice<A> slice, AdvancedRangeCacheConfig cacheConfig) Set up an advanced range cache with a certain slice backend -
splitByCount
public static <A, T extends ReadableChannelSource<A>> Stream<SourceSplit<A,T>> splitByCount(T source, int splitCount) throws IOException Create a number of splits of the given source.- Throws:
IOException
-
splitBySize
public static <A, T extends ReadableChannelSource<A>> Stream<SourceSplit<A,T>> splitBySize(T source, long splitSize) throws IOException Create splits of the given size.- Throws:
IOException
-