@InterfaceAudience.Private @InterfaceStability.Evolving public interface WAL extends Closeable, WALFileLengthProvider
Modifier and Type | Interface and Description |
---|---|
static class |
WAL.Entry
Utility class that lets us keep track of the edit with it's key.
|
static interface |
WAL.Reader
When outside clients need to consume persisted WALs, they rely on a provided
Reader.
|
Modifier and Type | Method and Description |
---|---|
void |
abortCacheFlush(byte[] encodedRegionName)
Abort a cache flush.
|
long |
append(RegionInfo info,
WALKeyImpl key,
WALEdit edits,
boolean inMemstore)
Append a set of edits to the WAL.
|
void |
close()
Caller no longer needs any edits from this WAL.
|
void |
completeCacheFlush(byte[] encodedRegionName)
Complete the cache flush.
|
WALCoprocessorHost |
getCoprocessorHost() |
long |
getEarliestMemStoreSeqNum(byte[] encodedRegionName)
Deprecated.
Since version 1.2.0. Removing because not used and exposes subtle internal
workings. Use
getEarliestMemStoreSeqNum(byte[], byte[]) |
long |
getEarliestMemStoreSeqNum(byte[] encodedRegionName,
byte[] familyName)
Gets the earliest unflushed sequence id in the memstore for the store.
|
void |
registerWALActionsListener(WALActionsListener listener)
Registers WALActionsListener
|
byte[][] |
rollWriter()
Roll the log writer.
|
byte[][] |
rollWriter(boolean force)
Roll the log writer.
|
void |
shutdown()
Stop accepting new writes.
|
Long |
startCacheFlush(byte[] encodedRegionName,
Map<byte[],Long> familyToSeq) |
Long |
startCacheFlush(byte[] encodedRegionName,
Set<byte[]> families)
WAL keeps track of the sequence numbers that are as yet not flushed im memstores
in order to be able to do accounting to figure which WALs can be let go.
|
void |
sync()
Sync what we have in the WAL.
|
default void |
sync(boolean forceSync) |
void |
sync(long txid)
Sync the WAL if the txId was not already sync'd.
|
default void |
sync(long txid,
boolean forceSync) |
String |
toString()
Human readable identifying information about the state of this WAL.
|
boolean |
unregisterWALActionsListener(WALActionsListener listener)
Unregisters WALActionsListener
|
void |
updateStore(byte[] encodedRegionName,
byte[] familyName,
Long sequenceid,
boolean onlyIfGreater)
updates the seuence number of a specific store.
|
getLogFileSizeIfBeingWritten
void registerWALActionsListener(WALActionsListener listener)
boolean unregisterWALActionsListener(WALActionsListener listener)
byte[][] rollWriter() throws FailedLogCloseException, IOException
The implementation is synchronized in order to make sure there's one rollWriter running at any given time.
RegionInfo.getEncodedName()
FailedLogCloseException
IOException
byte[][] rollWriter(boolean force) throws FailedLogCloseException, IOException
The implementation is synchronized in order to make sure there's one rollWriter running at any given time.
force
- If true, force creation of a new writer even if no entries have
been written to the current writerRegionInfo.getEncodedName()
FailedLogCloseException
IOException
void shutdown() throws IOException
IOException
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
long append(RegionInfo info, WALKeyImpl key, WALEdit edits, boolean inMemstore) throws IOException
key
will
have the region edit/sequence id filled in.info
- the regioninfo associated with appendkey
- Modified by this call; we add to it this edits region edit/sequence id.edits
- Edits to append. MAY CONTAIN NO EDITS for case where we want to get an edit
sequence id that is after all currently appended edits.inMemstore
- Always true except for case where we are writing a compaction completion
record into the WAL; in this case the entry is just so we can finish an unfinished compaction
-- it is not an edit for memstore.key
will have the region edit/sequence id
in it.IOException
void updateStore(byte[] encodedRegionName, byte[] familyName, Long sequenceid, boolean onlyIfGreater)
encodedRegionName
- familyName
- sequenceid
- onlyIfGreater
- void sync() throws IOException
IOException
void sync(long txid) throws IOException
txid
- Transaction id to sync to.IOException
default void sync(boolean forceSync) throws IOException
forceSync
- Flag to force sync rather than flushing to the buffer. Example - Hadoop hflush
vs hsync.IOException
default void sync(long txid, boolean forceSync) throws IOException
txid
- Transaction id to sync to.forceSync
- Flag to force sync rather than flushing to the buffer. Example - Hadoop hflush
vs hsync.IOException
Long startCacheFlush(byte[] encodedRegionName, Set<byte[]> families)
Currently, it is expected that the update lock is held for the region; i.e. no concurrent appends while we set up cache flush.
families
- Families to flush. May be a subset of all families in the region.HConstants.NO_SEQNUM
if we are flushing the whole region OR if
we are flushing a subset of all families but there are no edits in those families not
being flushed; in other words, this is effectively same as a flush of all of the region
though we were passed a subset of regions. Otherwise, it returns the sequence id of the
oldest/lowest outstanding edit.completeCacheFlush(byte[])
,
abortCacheFlush(byte[])
void completeCacheFlush(byte[] encodedRegionName)
encodedRegionName
- Encoded region name.startCacheFlush(byte[], Set)
,
abortCacheFlush(byte[])
void abortCacheFlush(byte[] encodedRegionName)
encodedRegionName
- Encoded region name.WALCoprocessorHost getCoprocessorHost()
@Deprecated long getEarliestMemStoreSeqNum(byte[] encodedRegionName)
getEarliestMemStoreSeqNum(byte[], byte[])
encodedRegionName
- The region to get the number for.long getEarliestMemStoreSeqNum(byte[] encodedRegionName, byte[] familyName)
encodedRegionName
- The region to get the number for.familyName
- The family to get the number for.String toString()
Copyright © 2007–2019 Cloudera. All rights reserved.