|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
com.bigdata.bfs.FileVersionOutputStream
public class FileVersionOutputStream
Class buffers up to a block of data at a time and flushes blocks using an atomic append operation on the identifier file version.
| Field Summary | |
|---|---|
protected String |
id
|
protected BigdataFileSystem |
repo
|
protected int |
version
|
| Constructor Summary | |
|---|---|
FileVersionOutputStream(BigdataFileSystem repo,
String id,
int version)
Create an output stream that will atomically append blocks of data to the specified file version. |
|
| Method Summary | |
|---|---|
void |
close()
Flushes the buffer. |
long |
copyStream(InputStream is)
Consumes the input stream, writing blocks onto the file version. |
void |
flush()
If there is data data accumulated in the buffer then it is written on the file version using an atomic append (empty buffers are NOT flushed). |
long |
getBlockCount()
#of blocks written onto the file version. |
long |
getByteCount()
#of bytes written onto this output stream. |
String |
getId()
The file identifier. |
int |
getVersion()
The file version identifer. |
void |
write(int b)
Buffers the byte. |
| Methods inherited from class java.io.OutputStream |
|---|
write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final BigdataFileSystem repo
protected final String id
protected final int version
| Constructor Detail |
|---|
public FileVersionOutputStream(BigdataFileSystem repo,
String id,
int version)
id - The file identifier.version - The version identifier.| Method Detail |
|---|
public String getId()
public int getVersion()
public long getByteCount()
Long.MAX_VALUE.public long getBlockCount()
public void write(int b)
throws IOException
write in class OutputStreamIOException
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException
public long copyStream(InputStream is)
throws IOException
is - The input stream (closed iff it is fully consumed).
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||