java.io.Closeable, java.lang.AutoCloseableEditLogFileOutputStream@Private
@Evolving
public abstract class EditLogOutputStream
extends java.lang.Object
implements java.io.Closeable
| Constructor | Description |
|---|---|
EditLogOutputStream() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract void |
abort() |
Close the stream without necessarily flushing any pending data.
|
abstract void |
close() |
Close the journal.
|
abstract void |
create(int layoutVersion) |
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. |
java.lang.String |
generateReport() |
|
int |
getCurrentLogVersion() |
|
long |
getLastJournalledTxId() |
Get the last txId journalled in the stream.
|
protected long |
getNumSync() |
Return number of calls to
flushAndSync(boolean) |
void |
setCurrentLogVersion(int logVersion) |
|
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 java.io.IOException
java.io.IOExceptionpublic long getLastJournalledTxId()
public abstract void write(FSEditLogOp op) throws java.io.IOException
op - operationjava.io.IOExceptionpublic abstract void writeRaw(byte[] bytes,
int offset,
int length)
throws java.io.IOException
bytes - the bytes to write.offset - offset in the bytes to write fromlength - number of bytes to writejava.io.IOExceptionpublic abstract void create(int layoutVersion)
throws java.io.IOException
layoutVersion - The LayoutVersion of the journaljava.io.IOExceptionpublic abstract void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOException - if the journal can't be closed,
or if there are unflushed editspublic abstract void abort()
throws java.io.IOException
java.io.IOExceptionpublic abstract void setReadyToFlush()
throws java.io.IOException
java.io.IOExceptionprotected abstract void flushAndSync(boolean durable)
throws java.io.IOException
setReadyToFlush() into underlying persistent store.durable - if true, the edits should be made truly durable before
returningjava.io.IOExceptionpublic void flush()
throws java.io.IOException
java.io.IOExceptionpublic void flush(boolean durable)
throws java.io.IOException
java.io.IOExceptionpublic boolean shouldForceSync()
protected long getNumSync()
flushAndSync(boolean)public java.lang.String generateReport()
public int getCurrentLogVersion()
public void setCurrentLogVersion(int logVersion)
logVersion - The version of the current edit logCopyright © 2008–2025 Apache Software Foundation. All rights reserved.