Package org.ojalgo.netio
Class ShardedFile
java.lang.Object
org.ojalgo.netio.ShardedFile
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Explicitly delete all files/shards as well as the parent directory (make sure there is nothing else in that directory)boolean
files()
int
hashCode()
<T> Supplier
<FromFileReader<T>> newSequencedFactory
(Function<File, FromFileReader<T>> factory) Each reader instantiated by this factory will read from the shards in sequence, until all of them are done.static ShardedFile
static ShardedFile
shard
(int index) File[]
shards()
private static File[]
splitToShards
(File file, int numberOfShards) toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
numberOfShards
public final int numberOfShards -
single
A valid single file used as a template when creating the shards. Can also be used for meta data or merged/aggregated data from the shards. -
myShards
-
-
Constructor Details
-
ShardedFile
ShardedFile(File template, int nbShards)
-
-
Method Details
-
of
-
of
-
splitToShards
-
delete
public void delete()Explicitly delete all files/shards as well as the parent directory (make sure there is nothing else in that directory) -
directory
- Returns:
- A parent directory to all the shards
-
equals
-
files
-
filesWithShardIndex
- Returns:
- Same as
files()
but paired with the shard index.
-
hashCode
public int hashCode() -
newSequencedFactory
public <T> Supplier<FromFileReader<T>> newSequencedFactory(Function<File, FromFileReader<T>> factory) Each reader instantiated by this factory will read from the shards in sequence, until all of them are done. The idea is that you can create multiple readers and have them work in parallel (each shard will only be read once by one of the readers). -
shard
-
shards
-
toString
-