@InterfaceAudience.LimitedPrivate(value="Replication") public class WALKey extends Object implements SequenceId, Comparable<WALKey>
Some Transactional edits (START, COMMIT, ABORT) will not have an associated row. Note that protected members marked @InterfaceAudience.Private are only protected to support the legacy HLogKey class, which is in a different package.
Modifier and Type | Class and Description |
---|---|
protected static class |
WALKey.Version |
Modifier and Type | Field and Description |
---|---|
protected List<UUID> |
clusterIds |
protected CompressionContext |
compressionContext |
static List<UUID> |
EMPTY_UUIDS |
protected byte[] |
encodedRegionName |
private static org.apache.commons.logging.Log |
LOG |
protected long |
logSeqNum |
private MultiVersionConcurrencyControl |
mvcc |
static long |
NO_SEQUENCE_ID
Used to represent when a particular wal key doesn't know/care about the sequence ordering.
|
private long |
nonce |
private long |
nonceGroup |
private long |
origLogSeqNum |
private static String |
PREFIX_CLUSTER_KEY |
private NavigableMap<byte[],Integer> |
scopes |
private CountDownLatch |
seqNumAssignedLatch |
protected TableName |
tablename |
protected static WALKey.Version |
VERSION |
private MultiVersionConcurrencyControl.WriteEntry |
writeEntry |
protected long |
writeTime |
Constructor and Description |
---|
WALKey() |
WALKey(byte[] encodedRegionName,
TableName tablename) |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now) |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc)
Create the log key for writing to somewhere.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc)
Create the log key for writing to somewhere.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc)
Create the log key for writing to somewhere.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
UUID clusterId) |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now,
MultiVersionConcurrencyControl mvcc) |
Modifier and Type | Method and Description |
---|---|
void |
addClusterId(UUID clusterId)
Marks that the cluster with the given clusterId has consumed the change
|
int |
compareTo(WALKey o) |
boolean |
equals(Object obj) |
org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALKey.Builder |
getBuilder(WALCellCodec.ByteStringCompressor compressor) |
List<UUID> |
getClusterIds() |
byte[] |
getEncodedRegionName() |
long |
getLogSeqNum() |
MultiVersionConcurrencyControl |
getMvcc() |
long |
getNonce() |
long |
getNonceGroup() |
UUID |
getOriginatingClusterId() |
long |
getOrigLogSeqNum()
Return a positive long if current WALKey is created from a replay edit
|
NavigableMap<byte[],Integer> |
getScopes() |
long |
getSequenceId()
Wait for sequence number to be assigned & return the assigned value
|
long |
getSequenceId(long maxWaitForSeqId)
Wait for sequence number to be assigned & return the assigned value.
|
TableName |
getTablename() |
MultiVersionConcurrencyControl.WriteEntry |
getWriteEntry()
Will block until a write entry has been assigned by they WAL subsystem.
|
long |
getWriteTime() |
int |
hashCode() |
protected void |
init(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc) |
(package private) void |
internEncodedRegionName(byte[] encodedRegionName)
Drop this instance's region name byte array and instead
hold a reference to the provided region name.
|
(package private) void |
internTableName(TableName tablename)
Drop this instance's tablename byte array and instead
hold a reference to the provided tablename.
|
void |
readFieldsFromPb(org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALKey walKey,
WALCellCodec.ByteStringUncompressor uncompressor) |
void |
readOlderScopes(NavigableMap<byte[],Integer> scopes) |
void |
setCompressionContext(CompressionContext compressionContext) |
void |
setLogSeqNum(long sequence)
Allow that the log sequence id to be set post-construction
Only public for org.apache.hadoop.hbase.regionserver.wal.FSWALEntry
|
void |
setOrigLogSeqNum(long seqId)
Used to set original seq Id for WALKey during wal replay
|
void |
setScopes(NavigableMap<byte[],Integer> scopes) |
void |
setWriteEntry(MultiVersionConcurrencyControl.WriteEntry writeEntry) |
String |
toString() |
Map<String,Object> |
toStringMap()
Produces a string map for this key.
|
private static final org.apache.commons.logging.Log LOG
private static final String PREFIX_CLUSTER_KEY
@InterfaceAudience.Private protected static final WALKey.Version VERSION
public static final long NO_SEQUENCE_ID
@InterfaceAudience.Private protected byte[] encodedRegionName
@InterfaceAudience.Private protected TableName tablename
@InterfaceAudience.Private protected long logSeqNum
private long origLogSeqNum
private CountDownLatch seqNumAssignedLatch
@InterfaceAudience.Private protected long writeTime
@InterfaceAudience.Private protected List<UUID> clusterIds
private NavigableMap<byte[],Integer> scopes
private long nonceGroup
private long nonce
private MultiVersionConcurrencyControl mvcc
private MultiVersionConcurrencyControl.WriteEntry writeEntry
@InterfaceAudience.Private protected CompressionContext compressionContext
public WALKey()
public WALKey(byte[] encodedRegionName, TableName tablename, long logSeqNum, long now, UUID clusterId)
public WALKey(byte[] encodedRegionName, TableName tablename)
public WALKey(byte[] encodedRegionName, TableName tablename, long now)
public WALKey(byte[] encodedRegionName, TableName tablename, long now, MultiVersionConcurrencyControl mvcc)
public WALKey(byte[] encodedRegionName, TableName tablename, long logSeqNum, long now, List<UUID> clusterIds, long nonceGroup, long nonce, MultiVersionConcurrencyControl mvcc)
Used by log splitting and snapshots.
encodedRegionName
- Encoded name of the region as returned by
HRegionInfo#getEncodedNameAsBytes()
.tablename
- - name of tablelogSeqNum
- - log sequence numbernow
- Time at which this edit was written.clusterIds
- the clusters that have consumed the change(used in Replication)public WALKey(byte[] encodedRegionName, TableName tablename, long now, List<UUID> clusterIds, long nonceGroup, long nonce, MultiVersionConcurrencyControl mvcc)
encodedRegionName
- Encoded name of the region as returned by
HRegionInfo#getEncodedNameAsBytes()
.tablename
- now
- Time at which this edit was written.clusterIds
- the clusters that have consumed the change(used in Replication)nonceGroup
- nonce
- mvcc
- mvcc control used to generate sequence numbers and control read/write pointspublic WALKey(byte[] encodedRegionName, TableName tablename, long logSeqNum, long nonceGroup, long nonce, MultiVersionConcurrencyControl mvcc)
encodedRegionName
- Encoded name of the region as returned by
HRegionInfo#getEncodedNameAsBytes()
.tablename
- logSeqNum
- nonceGroup
- nonce
- @InterfaceAudience.Private public MultiVersionConcurrencyControl getMvcc()
@InterfaceAudience.Private public MultiVersionConcurrencyControl.WriteEntry getWriteEntry() throws InterruptedIOException
InterruptedIOException
setWriteEntry(org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl.WriteEntry)
@InterfaceAudience.Private public void setWriteEntry(MultiVersionConcurrencyControl.WriteEntry writeEntry)
@InterfaceAudience.Private protected void init(byte[] encodedRegionName, TableName tablename, long logSeqNum, long now, List<UUID> clusterIds, long nonceGroup, long nonce, MultiVersionConcurrencyControl mvcc)
public void setCompressionContext(CompressionContext compressionContext)
compressionContext
- Compression context to usepublic byte[] getEncodedRegionName()
public TableName getTablename()
public long getLogSeqNum()
@InterfaceAudience.Private public void setLogSeqNum(long sequence)
sequence
- public void setOrigLogSeqNum(long seqId)
seqId
- public long getOrigLogSeqNum()
public long getSequenceId() throws IOException
getSequenceId
in interface SequenceId
IOException
public long getSequenceId(long maxWaitForSeqId) throws IOException
maxWaitForSeqId
- maximum time to wait in milliseconds for sequenceidIOException
public long getWriteTime()
public NavigableMap<byte[],Integer> getScopes()
public long getNonceGroup()
public long getNonce()
public void setScopes(NavigableMap<byte[],Integer> scopes)
public void readOlderScopes(NavigableMap<byte[],Integer> scopes)
public void addClusterId(UUID clusterId)
public List<UUID> getClusterIds()
public UUID getOriginatingClusterId()
public Map<String,Object> toStringMap()
public int compareTo(WALKey o)
compareTo
in interface Comparable<WALKey>
void internTableName(TableName tablename)
void internEncodedRegionName(byte[] encodedRegionName)
public org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALKey.Builder getBuilder(WALCellCodec.ByteStringCompressor compressor) throws IOException
IOException
public void readFieldsFromPb(org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALKey walKey, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.