Package nz.org.riskscape.engine.io
Class DiskStorage
java.lang.Object
nz.org.riskscape.engine.io.DiskStorage
- All Implemented Interfaces:
nz.org.riskscape.engine.io.TupleStorage
TupleStorage
backed by a directory on the filesystem.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate disk storage that writes out the to the JVM's temp dir.DiskStorage
(com.codahale.metrics.Counter counter) DiskStorage
(Path dataDir) Create disk storage that writes files in to the given directoryDiskStorage
(Path dataDir, boolean useCompression) DiskStorage
(Path dataDir, boolean useCompression, com.codahale.metrics.Counter counter) Create disk storage based on a given directory -
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.engine.io.TupleWriter
getReader
(DiskStorageWriter writer) nz.org.riskscape.engine.io.TupleReader
getReader
(nz.org.riskscape.engine.io.TupleWriter writer)
-
Field Details
-
TUPLES_FILE_FORMAT
- See Also:
-
TUPLES_FILE_PATTERN
-
-
Constructor Details
-
DiskStorage
Create disk storage that writes files in to the given directory
- Parameters:
dataDir
- directory to store tuples in
-
DiskStorage
public DiskStorage()Create disk storage that writes out the to the JVM's temp dir.
-
DiskStorage
Create disk storage based on a given directory
- Parameters:
dataDir
- directory to store tuples inuseCompression
- if true, all readers and writers from this storage will use gzip compression. This can use less disk at the cost of CPU when reading in and out.
-
DiskStorage
public DiskStorage(com.codahale.metrics.Counter counter) -
DiskStorage
-
-
Method Details
-
createTemporaryWriter
- Specified by:
createTemporaryWriter
in interfacenz.org.riskscape.engine.io.TupleStorage
- Throws:
IOException
-
getReader
- Throws:
IOException
-
getReader
public nz.org.riskscape.engine.io.TupleReader getReader(nz.org.riskscape.engine.io.TupleWriter writer) throws IOException - Specified by:
getReader
in interfacenz.org.riskscape.engine.io.TupleStorage
- Throws:
IOException
-
getDataDir
-