@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
IOException
public abstract void write(FSEditLogOp op) throws IOException
op
- operationIOException
public 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 writeIOException
public abstract void create() throws IOException
IOException
public abstract void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if the journal can't be closed,
or if there are unflushed editspublic abstract void abort() throws IOException
IOException
public abstract void setReadyToFlush() throws IOException
IOException
protected abstract void flushAndSync(boolean durable) throws IOException
setReadyToFlush()
into underlying persistent store.durable
- if true, the edits should be made truly durable before
returningIOException
public void flush() throws IOException
IOException
public void flush(boolean durable) throws IOException
IOException
public boolean shouldForceSync()
protected long getNumSync()
#flushAndSync()
public String generateHtmlReport()
Copyright © 2013 Apache Software Foundation. All rights reserved.