@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
|
static WALKeyImpl |
EMPTY_WALKEYIMPL |
private byte[] |
encodedRegionName |
private Map<String,byte[]> |
extendedAttributes |
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 now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScope,
Map<String,byte[]> extendedAttributes) |
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,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScope,
Map<String,byte[]> extendedAttributes) |
WALKeyImpl(byte[] encodedRegionName,
TableName tablename,
long now,
NavigableMap<byte[],Integer> replicationScope) |
WALKeyImpl(NavigableMap<byte[],Integer> replicationScope) |
WALKeyImpl(WALKeyImpl key,
Map<String,byte[]> extendedAttributes)
Copy constructor that takes in an existing WALKeyImpl plus some extended attributes.
|
WALKeyImpl(WALKey key,
List<UUID> clusterIds,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScopes,
Map<String,byte[]> extendedAttributes)
Copy constructor that takes in an existing WALKey, the extra WALKeyImpl fields that the parent
interface is missing, plus some extended attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
addClusterId(UUID clusterId)
Marks that the cluster with the given clusterId has consumed the change
|
void |
addExtendedAttribute(String attributeKey,
byte[] attributeValue)
Add a named String value to this WALKey to be persisted into the WAL
|
void |
clearReplicationScope() |
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()
Returns the set of cluster Ids that have consumed the change
|
byte[] |
getEncodedRegionName()
Returns encoded region name
|
byte[] |
getExtendedAttribute(String attributeKey)
Return a named String value injected into the WALKey during processing, such as by a
coprocessor
|
Map<String,byte[]> |
getExtendedAttributes()
Returns a map of all extended attributes injected into this WAL key.
|
long |
getLogSeqNum()
Deprecated.
Use
getSequenceId() |
MultiVersionConcurrencyControl |
getMvcc() |
long |
getNonce()
Returns The nonce
|
long |
getNonceGroup()
Returns The nonce group
|
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()
Returns table name
|
MultiVersionConcurrencyControl.WriteEntry |
getWriteEntry()
Use it to complete mvcc transaction.
|
long |
getWriteTime()
Returns the write time
|
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,
Map<String,byte[]> extendedAttributes) |
(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 |
setCompressionContext(CompressionContext compressionContext)
Deprecated.
deparcated since hbase 2.1.0
|
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 Map<String,byte[]> extendedAttributes
public WALKeyImpl()
public WALKeyImpl(NavigableMap<byte[],Integer> replicationScope)
@InterfaceAudience.Private 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, NavigableMap<byte[],Integer> replicationScope, Map<String,byte[]> extendedAttributes)
public WALKeyImpl(byte[] encodedRegionName, TableName tablename, long now, MultiVersionConcurrencyControl mvcc)
public WALKeyImpl(WALKeyImpl key, Map<String,byte[]> extendedAttributes)
key
- Key to be copied into this new keyextendedAttributes
- Extra attributes to copy into the new keypublic WALKeyImpl(WALKey key, List<UUID> clusterIds, MultiVersionConcurrencyControl mvcc, NavigableMap<byte[],Integer> replicationScopes, Map<String,byte[]> extendedAttributes)
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) nn
* @param 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()
. n * @param 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()
. nnnnpublic WALKeyImpl(byte[] encodedRegionName, TableName tablename, long now, List<UUID> clusterIds, long nonceGroup, long nonce, MultiVersionConcurrencyControl mvcc, NavigableMap<byte[],Integer> replicationScope, Map<String,byte[]> extendedAttributes)
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, Map<String,byte[]> extendedAttributes)
@InterfaceAudience.Private protected void setSequenceId(long sequenceId)
@Deprecated 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 clearReplicationScope()
public void addClusterId(UUID clusterId)
public List<UUID> getClusterIds()
public UUID getOriginatingClusterId()
getOriginatingClusterId
in interface WALKey
public void addExtendedAttribute(String attributeKey, byte[] attributeValue)
WALKey
addExtendedAttribute
in interface WALKey
attributeKey
- Name of the attributeattributeValue
- Value of the attributepublic byte[] getExtendedAttribute(String attributeKey)
WALKey
getExtendedAttribute
in interface WALKey
attributeKey
- The key of a key / value pairpublic Map<String,byte[]> getExtendedAttributes()
WALKey
getExtendedAttributes
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–2020 The Apache Software Foundation. All rights reserved.