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.
|
private long |
append(RegionInfo info,
WALKeyImpl key,
WALEdit edits,
boolean inMemstore) |
long |
appendData(RegionInfo info,
WALKeyImpl key,
WALEdit edits)
Append a set of data edits to the WAL.
|
long |
appendMarker(RegionInfo info,
WALKeyImpl key,
WALEdit edits)
Append an operational 'meta' event marker edit to the WAL.
|
void |
close()
Caller no longer needs any edits from this WAL.
|
void |
completeCacheFlush(byte[] encodedRegionName,
long maxFlushedSeqId)
Complete the cache flush.
|
WALCoprocessorHost |
getCoprocessorHost()
Returns Coprocessor host.
|
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
|
Map<byte[],List<byte[]>> |
rollWriter()
Roll the log writer.
|
Map<byte[],List<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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTimestamp, sync, sync
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)
WAL
registerWALActionsListener
in interface WAL
public boolean unregisterWALActionsListener(WALActionsListener listener)
WAL
unregisterWALActionsListener
in interface WAL
public Map<byte[],List<byte[]>> rollWriter()
WAL
rollWriter
in interface WAL
RegionInfo.getEncodedName()
public Map<byte[],List<byte[]>> rollWriter(boolean force)
WAL
rollWriter
in interface WAL
RegionInfo.getEncodedName()
public void shutdown()
WAL
public void close()
WAL
public long appendData(RegionInfo info, WALKeyImpl key, WALEdit edits) throws IOException
WAL
key
will have the region edit/sequence id filled in.appendData
in interface WAL
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.key
will have the region edit/sequence id
in it.IOException
WAL.appendMarker(RegionInfo, WALKeyImpl, WALEdit)
public long appendMarker(RegionInfo info, WALKeyImpl key, WALEdit edits) throws IOException
WAL
WAL.appendData(RegionInfo, WALKeyImpl, WALEdit)
is that a marker will not have transitioned
through the memstore.
The WAL is not flushed/sync'd after this transaction completes BUT on return this edit must
have its region edit/sequence id assigned else it messes up our unification of mvcc and
sequenceid. On return key
will have the region edit/sequence id filled in.appendMarker
in interface WAL
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.key
will have the region edit/sequence id
in it.IOException
WAL.appendData(RegionInfo, WALKeyImpl, WALEdit)
private long append(RegionInfo info, WALKeyImpl key, WALEdit edits, boolean inMemstore) throws IOException
IOException
public void updateStore(byte[] encodedRegionName, byte[] familyName, Long sequenceid, boolean onlyIfGreater)
WAL
updateStore
in interface WAL
public void sync(long txid)
WAL
public Long startCacheFlush(byte[] encodedRegionName, Map<byte[],Long> flushedFamilyNamesToSeq)
startCacheFlush
in interface WAL
public Long startCacheFlush(byte[] encodedRegionName, Set<byte[]> flushedFamilyNames)
WAL
Currently, 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 WAL
flushedFamilyNames
- 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[], long)
,
WAL.abortCacheFlush(byte[])
public void completeCacheFlush(byte[] encodedRegionName, long maxFlushedSeqId)
WAL
completeCacheFlush
in interface WAL
encodedRegionName
- Encoded region name.maxFlushedSeqId
- The maxFlushedSeqId for this flush. There is no edit in memory that is
less that this sequence id.WAL.startCacheFlush(byte[], Set)
,
WAL.abortCacheFlush(byte[])
public void abortCacheFlush(byte[] encodedRegionName)
WAL
abortCacheFlush
in interface WAL
encodedRegionName
- Encoded region name.public WALCoprocessorHost getCoprocessorHost()
WAL
getCoprocessorHost
in interface WAL
public long getEarliestMemStoreSeqNum(byte[] encodedRegionName)
WAL
getEarliestMemStoreSeqNum
in interface WAL
encodedRegionName
- The region to get the number for.public long getEarliestMemStoreSeqNum(byte[] encodedRegionName, byte[] familyName)
WAL
getEarliestMemStoreSeqNum
in interface WAL
encodedRegionName
- The region to get the number for.familyName
- The family to get the number for.public String toString()
WAL
public OptionalLong getLogFileSizeIfBeingWritten(org.apache.hadoop.fs.Path path)
getLogFileSizeIfBeingWritten
in interface WALFileLengthProvider
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.