Package nz.org.riskscape.engine.io
Class DiskStorageWriter
java.lang.Object
nz.org.riskscape.engine.io.DiskStorageWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,nz.org.riskscape.engine.io.TupleWriter
public class DiskStorageWriter
extends Object
implements nz.org.riskscape.engine.io.TupleWriter, Closeable
Wraps a DataOutputStreamTupleWriter
to write out to a buffered and byte counted FileOutputStream
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final long
-
Constructor Summary
ConstructorDescriptionDiskStorageWriter
(File file, boolean compressed) DiskStorageWriter
(File file, boolean compressed, com.codahale.metrics.Counter metricsCounter) -
Method Summary
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE- See Also:
-
OUT_OF_DISK_THRESHOLD_BYTES
public static final long OUT_OF_DISK_THRESHOLD_BYTES- See Also:
-
-
Constructor Details
-
DiskStorageWriter
- Throws:
IOException
-
DiskStorageWriter
public DiskStorageWriter(File file, boolean compressed, com.codahale.metrics.Counter metricsCounter) throws IOException - Throws:
IOException
-
-
Method Details
-
write
- Specified by:
write
in interfacenz.org.riskscape.engine.io.TupleWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
remove
- Specified by:
remove
in interfacenz.org.riskscape.engine.io.TupleWriter
- Throws:
IOException
-
getBytesWritten
- Returns:
- the number of bytes written to the buffer so far.
- Throws:
IOException
-
getFile
-