private static class DisabledWALProvider.DisabledWAL extends Object implements WAL
WAL.Entry, WAL.Reader| Modifier and Type | Field and Description |
|---|---|
protected AtomicBoolean |
closed |
protected WALCoprocessorHost |
coprocessorHost |
protected List<WALActionsListener> |
listeners |
protected org.apache.hadoop.fs.Path |
path |
| Constructor and Description |
|---|
DisabledWAL(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
List<WALActionsListener> listeners) |
| 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)
Gets the earliest unflushed sequence id in the memstore for the region.
|
long |
getEarliestMemStoreSeqNum(byte[] encodedRegionName,
byte[] familyName)
Gets the earliest unflushed sequence id in the memstore for the store.
|
OptionalLong |
getLogFileSizeIfBeingWritten(org.apache.hadoop.fs.Path path) |
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> flushedFamilyNamesToSeq) |
Long |
startCacheFlush(byte[] encodedRegionName,
Set<byte[]> flushedFamilyNames)
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.
|
void |
sync(long txid)
Sync the WAL if the txId was not already sync'd.
|
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.
|
protected final List<WALActionsListener> listeners
protected final org.apache.hadoop.fs.Path path
protected final WALCoprocessorHost coprocessorHost
protected final AtomicBoolean closed
public DisabledWAL(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, List<WALActionsListener> listeners)
public void registerWALActionsListener(WALActionsListener listener)
WALregisterWALActionsListener in interface WALpublic boolean unregisterWALActionsListener(WALActionsListener listener)
WALunregisterWALActionsListener in interface WALpublic byte[][] rollWriter()
WALThe implementation is synchronized in order to make sure there's one rollWriter running at any given time.
rollWriter in interface WALRegionInfo.getEncodedName()public byte[][] rollWriter(boolean force)
WALThe implementation is synchronized in order to make sure there's one rollWriter running at any given time.
rollWriter in interface WALforce - If true, force creation of a new writer even if no entries have
been written to the current writerRegionInfo.getEncodedName()public void shutdown()
WALpublic void close()
WALpublic long append(RegionInfo info, WALKeyImpl key, WALEdit edits, boolean inMemstore) throws IOException
WALkey will
have the region edit/sequence id filled in.append in interface WALinfo - 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.IOExceptionpublic void updateStore(byte[] encodedRegionName, byte[] familyName, Long sequenceid, boolean onlyIfGreater)
WALupdateStore in interface WALpublic void sync(long txid)
WALpublic Long startCacheFlush(byte[] encodedRegionName, Map<byte[],Long> flushedFamilyNamesToSeq)
startCacheFlush in interface WALpublic Long startCacheFlush(byte[] encodedRegionName, Set<byte[]> flushedFamilyNames)
WALCurrently, it is expected that the update lock is held for the region; i.e. no concurrent appends while we set up cache flush.
startCacheFlush in interface WALflushedFamilyNames - 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.WAL.completeCacheFlush(byte[]),
WAL.abortCacheFlush(byte[])public void completeCacheFlush(byte[] encodedRegionName)
WALcompleteCacheFlush in interface WALencodedRegionName - Encoded region name.WAL.startCacheFlush(byte[], Set),
WAL.abortCacheFlush(byte[])public void abortCacheFlush(byte[] encodedRegionName)
WALabortCacheFlush in interface WALencodedRegionName - Encoded region name.public WALCoprocessorHost getCoprocessorHost()
getCoprocessorHost in interface WALpublic long getEarliestMemStoreSeqNum(byte[] encodedRegionName)
WALgetEarliestMemStoreSeqNum in interface WALencodedRegionName - The region to get the number for.public long getEarliestMemStoreSeqNum(byte[] encodedRegionName, byte[] familyName)
WALgetEarliestMemStoreSeqNum in interface WALencodedRegionName - The region to get the number for.familyName - The family to get the number for.public String toString()
WALpublic OptionalLong getLogFileSizeIfBeingWritten(org.apache.hadoop.fs.Path path)
getLogFileSizeIfBeingWritten in interface WALFileLengthProviderCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.