public class RotatingFileOutputStreamSupplier extends Object implements org.neo4j.function.Supplier<OutputStream>, Closeable
Supplier of OutputStreams backed by on-disk files, which
are rotated and archived when a specified size is reached. The get() method
will always return an OutputStream to the current output file without directly performing
any IO or blocking, and, when necessary, will trigger rotation via the Executor
supplied during construction.| Modifier and Type | Class and Description |
|---|---|
static class |
RotatingFileOutputStreamSupplier.RotationListener
A listener for the rotation process
|
| Constructor and Description |
|---|
RotatingFileOutputStreamSupplier(org.neo4j.io.fs.FileSystemAbstraction fileSystem,
File outputFile,
long rotationThresholdBytes,
int rotationDelaySeconds,
int maxArchives,
Executor rotationExecutor) |
RotatingFileOutputStreamSupplier(org.neo4j.io.fs.FileSystemAbstraction fileSystem,
File outputFile,
long rotationThresholdBytes,
int rotationDelaySeconds,
int maxArchives,
Executor rotationExecutor,
RotatingFileOutputStreamSupplier.RotationListener rotationListener) |
public RotatingFileOutputStreamSupplier(org.neo4j.io.fs.FileSystemAbstraction fileSystem,
File outputFile,
long rotationThresholdBytes,
int rotationDelaySeconds,
int maxArchives,
Executor rotationExecutor)
throws IOException
fileSystem - The filesystem to useoutputFile - The file that the latest OutputStream should output torotationThresholdBytes - The size above which the file should be rotatedrotationDelaySeconds - The minimum time (in seconds) after last rotation before the file may be rotated againmaxArchives - The maximum number of archived output files to keeprotationExecutor - An Executor for performing the rotationIOException - If the output file cannot be createdpublic RotatingFileOutputStreamSupplier(org.neo4j.io.fs.FileSystemAbstraction fileSystem,
File outputFile,
long rotationThresholdBytes,
int rotationDelaySeconds,
int maxArchives,
Executor rotationExecutor,
RotatingFileOutputStreamSupplier.RotationListener rotationListener)
throws IOException
fileSystem - The filesystem to useoutputFile - The file that the latest OutputStream should output torotationThresholdBytes - The size above which the file should be rotatedrotationDelaySeconds - The minimum time (in seconds) after last rotation before the file may be rotated againmaxArchives - The maximum number of archived output files to keeprotationExecutor - An Executor for performing the rotationrotationListener - A RotatingFileOutputStreamSupplier.RotationListener that can observe the rotation process and be notified of errorsIOException - If the output file cannot be createdpublic OutputStream get()
get in interface org.neo4j.function.Supplier<OutputStream>get in interface org.neo4j.function.ThrowingSupplier<OutputStream,RuntimeException>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2002–2015 The Neo4j Graph Database Project. All rights reserved.