@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_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
|
void |
clearReplicationScope() |
int |
compareTo(WALKey o) |
boolean |
equals(Object obj) |
long |
estimatedSerializedSizeOf() |
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) |
void |
readFieldsFromPb(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, wait
getTablename, toStringMap
public static final WALKeyImpl EMPTY_WALKEYIMPL
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)
@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
public void clearReplicationScope()
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>
public WALProtos.WALKey.Builder getBuilder(WALCellCodec.ByteStringCompressor compressor) throws IOException
IOException
public void readFieldsFromPb(WALProtos.WALKey walKey, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException
IOException
public long estimatedSerializedSizeOf()
estimatedSerializedSizeOf
in interface WALKey
Copyright © 2007–2019 Cloudera. All rights reserved.