@InterfaceAudience.Private @InterfaceStability.Evolving public abstract class EditLogOutputStream extends Object implements Closeable
| Constructor and Description |
|---|
EditLogOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
abort()
Close the stream without necessarily flushing any pending data.
|
abstract void |
close()
Close the journal.
|
abstract void |
create()
Create and initialize underlying persistent edits log storage.
|
void |
flush()
Flush data to persistent store.
|
void |
flush(boolean durable) |
protected abstract void |
flushAndSync(boolean durable)
Flush and sync all data that is ready to be flush
setReadyToFlush() into underlying persistent store. |
String |
generateHtmlReport() |
protected long |
getNumSync()
Return number of calls to
#flushAndSync() |
abstract void |
setReadyToFlush()
All data that has been written to the stream so far will be flushed.
|
boolean |
shouldForceSync()
Implement the policy when to automatically sync the buffered edits log
The buffered edits can be flushed when the buffer becomes full or
a certain period of time is elapsed.
|
abstract void |
write(FSEditLogOp op)
Write edits log operation to the stream.
|
abstract void |
writeRaw(byte[] bytes,
int offset,
int length)
Write raw data to an edit log.
|
public EditLogOutputStream()
throws IOException
IOExceptionpublic abstract void write(FSEditLogOp op) throws IOException
op - operationIOExceptionpublic abstract void writeRaw(byte[] bytes,
int offset,
int length)
throws IOException
bytes - the bytes to write.offset - offset in the bytes to write fromlength - number of bytes to writeIOExceptionpublic abstract void create()
throws IOException
IOExceptionpublic abstract void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - if the journal can't be closed,
or if there are unflushed editspublic abstract void abort()
throws IOException
IOExceptionpublic abstract void setReadyToFlush()
throws IOException
IOExceptionprotected abstract void flushAndSync(boolean durable)
throws IOException
setReadyToFlush() into underlying persistent store.durable - if true, the edits should be made truly durable before
returningIOExceptionpublic void flush()
throws IOException
IOExceptionpublic void flush(boolean durable)
throws IOException
IOExceptionpublic boolean shouldForceSync()
protected long getNumSync()
#flushAndSync()public String generateHtmlReport()
Copyright © 2013 Apache Software Foundation. All rights reserved.