@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 |
|---|---|
static WALKeyImpl |
EMPTY_WALKEYIMPL |
EMPTY_UUIDSNO_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) |
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
|
protected void |
setSequenceId(long sequenceId) |
void |
setWriteEntry(MultiVersionConcurrencyControl.WriteEntry writeEntry) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waittoStringMappublic static final WALKeyImpl EMPTY_WALKEYIMPL
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)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().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().public 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 WALKeypublic TableName getTableName()
getTableName in interface WALKey@Deprecated public long getLogSeqNum()
getSequenceId()public void setOrigLogSeqNum(long sequenceId)
public long getOrigLogSeqNum()
getOrigLogSeqNum in interface WALKeypublic 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 SequenceIdpublic long getWriteTime()
getWriteTime in interface WALKeypublic NavigableMap<byte[],Integer> getReplicationScopes()
public long getNonceGroup()
getNonceGroup in interface WALKeypublic void clearReplicationScope()
public void addClusterId(UUID clusterId)
public List<UUID> getClusterIds()
public UUID getOriginatingClusterId()
getOriginatingClusterId in interface WALKeypublic void addExtendedAttribute(String attributeKey, byte[] attributeValue)
WALKeyaddExtendedAttribute in interface WALKeyattributeKey - Name of the attributeattributeValue - Value of the attributepublic byte[] getExtendedAttribute(String attributeKey)
WALKeygetExtendedAttribute in interface WALKeyattributeKey - The key of a key / value pairpublic Map<String,byte[]> getExtendedAttributes()
WALKeygetExtendedAttributes in interface WALKeypublic int compareTo(WALKey o)
compareTo in interface Comparable<WALKey>public org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALKey.Builder getBuilder(WALCellCodec.ByteStringCompressor compressor) throws IOException
IOExceptionpublic void readFieldsFromPb(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALKey walKey, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException
IOExceptionpublic long estimatedSerializedSizeOf()
estimatedSerializedSizeOf in interface WALKeyCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.