Class CachedDataOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.flink.core.fs.FSDataOutputStream
-
- org.apache.flink.state.forst.fs.cache.CachedDataOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class CachedDataOutputStream extends org.apache.flink.core.fs.FSDataOutputStreamAFSDataOutputStreamdelegates requests to other one and supports writing data withByteBuffer. The data will be written to the original output stream and the cache output stream. When the stream is closed, the data will be put into the cache and ready to be read.
-
-
Constructor Summary
Constructors Constructor Description CachedDataOutputStream(org.apache.flink.core.fs.Path originalPath, org.apache.flink.core.fs.Path cachePath, org.apache.flink.core.fs.FSDataOutputStream originalOutputStream, org.apache.flink.core.fs.FSDataOutputStream cacheOutputStream, FileBasedCache cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()longgetPos()voidsync()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
CachedDataOutputStream
public CachedDataOutputStream(org.apache.flink.core.fs.Path originalPath, org.apache.flink.core.fs.Path cachePath, org.apache.flink.core.fs.FSDataOutputStream originalOutputStream, @Nullable org.apache.flink.core.fs.FSDataOutputStream cacheOutputStream, FileBasedCache cache)
-
-
Method Detail
-
getPos
public long getPos() throws IOException- Specified by:
getPosin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
sync
public void sync() throws IOException- Specified by:
syncin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
-