@InterfaceAudience.LimitedPrivate(value="Replication") public class WALKeyImpl extends Object implements WALKey
Some Transactional edits (START, COMMIT, ABORT) will not have an associated row.
Modifier and Type | Field and Description |
---|---|
private List<UUID> |
clusterIds
The first element in the list is the cluster id on which the change has originated
|
private CompressionContext |
compressionContext |
static WALKeyImpl |
EMPTY_WALKEYIMPL |
private byte[] |
encodedRegionName |
private MultiVersionConcurrencyControl |
mvcc |
private long |
nonce |
private long |
nonceGroup |
private long |
origLogSeqNum
Used during WAL replay; the sequenceId of the edit when it came into the system.
|
private NavigableMap<byte[],Integer> |
replicationScope |
private long |
sequenceId
SequenceId for this edit.
|
private TableName |
tablename |
private MultiVersionConcurrencyControl.WriteEntry |
writeEntry
Set in a way visible to multiple threads; e.g.
|
private long |
writeTime
Time at which this edit was written.
|
EMPTY_UUIDS
NO_SEQUENCE_ID
Constructor and Description |
---|
WALKeyImpl() |
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long now) |
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc)
Create the log key for writing to somewhere.
|
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScope)
Create the log key for writing to somewhere.
|
WALKeyImpl(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.
|
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScope)
Create the log key for writing to somewhere.
|
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc)
Create the log key for writing to somewhere.
|
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
UUID clusterId) |
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long now,
MultiVersionConcurrencyControl mvcc) |
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long now,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScope) |
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long now,
NavigableMap<byte[],Integer> replicationScope) |
WALKeyImpl(NavigableMap<byte[],Integer> replicationScope) |
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.shaded.protobuf.generated.WALProtos.WALKey.Builder |
getBuilder(WALCellCodec.ByteStringCompressor compressor) |
List<UUID> |
getClusterIds() |
byte[] |
getEncodedRegionName() |
long |
getLogSeqNum()
Deprecated.
Use
getSequenceId() |
MultiVersionConcurrencyControl |
getMvcc() |
long |
getNonce() |
long |
getNonceGroup() |
UUID |
getOriginatingClusterId() |
long |
getOrigLogSeqNum()
Return a positive long if current WALKeyImpl is created from a replay edit; a replay edit is an
edit that came in when replaying WALs of a crashed server.
|
NavigableMap<byte[],Integer> |
getReplicationScopes() |
long |
getSequenceId()
SequenceId is only available post WAL-assign.
|
TableName |
getTableName() |
MultiVersionConcurrencyControl.WriteEntry |
getWriteEntry()
Use it to complete mvcc transaction.
|
long |
getWriteTime() |
int |
hashCode() |
protected void |
init(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScope) |
(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.shaded.protobuf.generated.WALProtos.WALKey walKey,
WALCellCodec.ByteStringUncompressor uncompressor) |
void |
serializeReplicationScope(boolean serialize) |
void |
setCompressionContext(CompressionContext compressionContext) |
void |
setOrigLogSeqNum(long sequenceId)
Used to set original sequenceId for WALKeyImpl during WAL replay
|
private void |
setReplicationScope(NavigableMap<byte[],Integer> replicationScope) |
protected void |
setSequenceId(long sequenceId) |
void |
setWriteEntry(MultiVersionConcurrencyControl.WriteEntry writeEntry) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toStringMap
public static final WALKeyImpl EMPTY_WALKEYIMPL
private byte[] encodedRegionName
private long sequenceId
private long origLogSeqNum
private long writeTime
private List<UUID> clusterIds
private NavigableMap<byte[],Integer> replicationScope
private long nonceGroup
private long nonce
private MultiVersionConcurrencyControl mvcc
private MultiVersionConcurrencyControl.WriteEntry writeEntry
private CompressionContext compressionContext
public WALKeyImpl()
public WALKeyImpl(NavigableMap<byte[],Integer> replicationScope)
public WALKeyImpl(byte[] encodedRegionName, TableName tablename, long logSeqNum, long now, UUID clusterId)
public WALKeyImpl(byte[] encodedRegionName, TableName tablename, long now)
public WALKeyImpl(byte[] encodedRegionName, TableName tablename, long now, NavigableMap<byte[],Integer> replicationScope)
public WALKeyImpl(byte[] encodedRegionName, TableName tablename, long now, MultiVersionConcurrencyControl mvcc, NavigableMap<byte[],Integer> replicationScope)
public WALKeyImpl(byte[] encodedRegionName, TableName tablename, long now, MultiVersionConcurrencyControl mvcc)
public WALKeyImpl(byte[] encodedRegionName, TableName tablename, long logSeqNum, long now, List<UUID> clusterIds, long nonceGroup, long nonce, MultiVersionConcurrencyControl mvcc, NavigableMap<byte[],Integer> replicationScope)
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)nonceGroup
- the nonceGroupnonce
- the noncemvcc
- the mvcc associate the WALKeyImplreplicationScope
- the non-default replication scope
associated with the region's column familiespublic WALKeyImpl(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 WALKeyImpl(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
- the tablenamenow
- 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 WALKeyImpl(byte[] encodedRegionName, TableName tablename, long now, List<UUID> clusterIds, long nonceGroup, long nonce, MultiVersionConcurrencyControl mvcc, NavigableMap<byte[],Integer> replicationScope)
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
- the nonceGroupnonce
- the noncemvcc
- mvcc control used to generate sequence numbers and control read/write pointsreplicationScope
- the non-default replication scope of the column familiespublic WALKeyImpl(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
- public MultiVersionConcurrencyControl getMvcc()
public MultiVersionConcurrencyControl.WriteEntry getWriteEntry()
MultiVersionConcurrencyControl.complete(MultiVersionConcurrencyControl.WriteEntry)
or MultiVersionConcurrencyControl.complete(MultiVersionConcurrencyControl.WriteEntry)
setWriteEntry(MultiVersionConcurrencyControl.WriteEntry)
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, NavigableMap<byte[],Integer> replicationScope)
@InterfaceAudience.Private protected void setSequenceId(long sequenceId)
public void setCompressionContext(CompressionContext compressionContext)
compressionContext
- Compression context to usepublic byte[] getEncodedRegionName()
getEncodedRegionName
in interface WALKey
public TableName getTableName()
getTableName
in interface WALKey
@Deprecated public long getLogSeqNum()
getSequenceId()
public void setOrigLogSeqNum(long sequenceId)
public long getOrigLogSeqNum()
getOrigLogSeqNum
in interface WALKey
public long getSequenceId()
SequenceId.NO_SEQUENCE_ID
. See the comment on FSHLog#append and #getWriteNumber in this
method for more on when this sequenceId comes available.getSequenceId
in interface SequenceId
public long getWriteTime()
getWriteTime
in interface WALKey
public NavigableMap<byte[],Integer> getReplicationScopes()
public long getNonceGroup()
getNonceGroup
in interface WALKey
private void setReplicationScope(NavigableMap<byte[],Integer> replicationScope)
public void serializeReplicationScope(boolean serialize)
public void addClusterId(UUID clusterId)
public List<UUID> getClusterIds()
public UUID getOriginatingClusterId()
getOriginatingClusterId
in interface WALKey
public int compareTo(WALKey o)
compareTo
in interface Comparable<WALKey>
void internTableName(TableName tablename)
void internEncodedRegionName(byte[] encodedRegionName)
public org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALKey.Builder getBuilder(WALCellCodec.ByteStringCompressor compressor) throws IOException
IOException
public void readFieldsFromPb(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALKey walKey, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException
IOException
public long estimatedSerializedSizeOf()
estimatedSerializedSizeOf
in interface WALKey
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.