@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 |
protected long |
logSeqNum |
static long |
NO_SEQUENCE_ID
Used to represent when a particular wal key doesn't know/care about the sequence ordering.
|
protected TableName |
tablename |
protected static WALKey.Version |
VERSION |
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) |
long |
estimatedSerializedSizeOf() |
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
|
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) |
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 |
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.
|
@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
@InterfaceAudience.Private protected long writeTime
@InterfaceAudience.Private protected List<UUID> clusterIds
@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()
public void setOrigLogSeqNum(long seqId)
seqId
- public long getOrigLogSeqNum()
public long getSequenceId() throws IOException
getSequenceId
in interface SequenceId
IOException
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>
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
public long estimatedSerializedSizeOf()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.