@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 |
protected byte[] |
encodedRegionName |
static Log |
LOG |
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)
Create the log key for writing to somewhere.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce)
Create the log key for writing to somewhere.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long nonceGroup,
long nonce)
Create the log key for writing to somewhere.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
UUID clusterId) |
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) |
WALProtos.WALKey.Builder |
getBuilder(WALCellCodec.ByteStringCompressor compressor) |
List<UUID> |
getClusterIds() |
byte[] |
getEncodedRegionName() |
long |
getLogSeqNum() |
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() |
long |
getSequenceId(long maxWaitForSeqId)
Wait for sequence number to be assigned & return the assigned value.
|
TableName |
getTablename() |
long |
getWriteTime() |
int |
hashCode() |
protected void |
init(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce) |
void |
readFieldsFromPb(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 and release all waiters on assigned
sequence number.
|
void |
setOrigLogSeqNum(long seqId)
Used to set original seq Id for WALKey during wal replay
|
void |
setScopes(NavigableMap<byte[],Integer> scopes) |
String |
toString() |
Map<String,Object> |
toStringMap()
Produces a string map for this key.
|
public static final Log LOG
@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 logSeqNum, long now, List<UUID> clusterIds, long nonceGroup, long nonce)
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)
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
- public WALKey(byte[] encodedRegionName, TableName tablename, long logSeqNum, long nonceGroup, long nonce)
encodedRegionName
- Encoded name of the region as returned by
HRegionInfo#getEncodedNameAsBytes()
.tablename
- logSeqNum
- nonceGroup
- nonce
- @InterfaceAudience.Private protected void init(byte[] encodedRegionName, TableName tablename, long logSeqNum, long now, List<UUID> clusterIds, long nonceGroup, long nonce)
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)
FSWALEntry
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 sequenceidInterruptedException
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 WALProtos.WALKey.Builder getBuilder(WALCellCodec.ByteStringCompressor compressor) throws IOException
IOException
public void readFieldsFromPb(WALProtos.WALKey walKey, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException
IOException