@InterfaceAudience.Private public class WALKey extends Object implements SequenceId, Comparable<WALKey>
Some Transactional edits (START, COMMIT, ABORT) will not have an associated row.
Modifier and Type | Field and Description |
---|---|
static List<UUID> |
EMPTY_UUIDS |
static long |
NO_SEQUENCE_ID
Used to represent when a particular wal key doesn't know/care about the sequence ordering.
|
Constructor and Description |
---|
WALKey() |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now) |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now,
List<UUID> clusterIds,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc)
Create the log key for writing to somewhere.
|
WALKey(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.
|
WALKey(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.
|
WALKey(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.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long nonceGroup,
long nonce,
MultiVersionConcurrencyControl mvcc)
Create the log key for writing to somewhere.
|
WALKey(byte[] encodedRegionName,
TableName tablename,
long logSeqNum,
long now,
UUID clusterId) |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now,
MultiVersionConcurrencyControl mvcc) |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now,
MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> replicationScope) |
WALKey(byte[] encodedRegionName,
TableName tablename,
long now,
NavigableMap<byte[],Integer> replicationScope) |
WALKey(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.WALEdit.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 WALKey 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(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALEdit walEdit,
WALCellCodec.ByteStringUncompressor uncompressor) |
void |
serializeReplicationScope(boolean serialize) |
void |
setCompressionContext(CompressionContext compressionContext) |
void |
setOrigLogSeqNum(long sequenceId)
Used to set original sequenceId for WALKey during WAL replay
|
protected void |
setSequenceId(long sequenceId) |
void |
setWriteEntry(MultiVersionConcurrencyControl.WriteEntry writeEntry) |
String |
toString() |
Map<String,Object> |
toStringMap()
Produces a string map for this key.
|
public static final long NO_SEQUENCE_ID
public WALKey()
public WALKey(NavigableMap<byte[],Integer> replicationScope)
public WALKey(byte[] encodedRegionName, TableName tablename, long logSeqNum, long now, UUID clusterId)
public WALKey(byte[] encodedRegionName, TableName tablename, long now)
public WALKey(byte[] encodedRegionName, TableName tablename, long now, NavigableMap<byte[],Integer> replicationScope)
public WALKey(byte[] encodedRegionName, TableName tablename, long now, MultiVersionConcurrencyControl mvcc, NavigableMap<byte[],Integer> replicationScope)
public WALKey(byte[] encodedRegionName, TableName tablename, long now, MultiVersionConcurrencyControl mvcc)
public WALKey(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 WALKeyreplicationScope
- the non-default replication scope
associated with the region's column familiespublic WALKey(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 WALKey(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 WALKey(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 WALKey(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
- @InterfaceAudience.Private public MultiVersionConcurrencyControl getMvcc()
@InterfaceAudience.Private public MultiVersionConcurrencyControl.WriteEntry getWriteEntry() throws InterruptedIOException
MultiVersionConcurrencyControl.complete(MultiVersionConcurrencyControl.WriteEntry)
or MultiVersionConcurrencyControl.complete(MultiVersionConcurrencyControl.WriteEntry)
InterruptedIOException
setWriteEntry(MultiVersionConcurrencyControl.WriteEntry)
@InterfaceAudience.Private 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()
public TableName getTablename()
@Deprecated public long getLogSeqNum()
getSequenceId()
public void setOrigLogSeqNum(long sequenceId)
public long getOrigLogSeqNum()
public long getSequenceId()
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()
public NavigableMap<byte[],Integer> getReplicationScopes()
public long getNonceGroup()
public long getNonce()
public void serializeReplicationScope(boolean serialize)
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 org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALEdit.Builder getBuilder(WALCellCodec.ByteStringCompressor compressor) throws IOException
IOException
public void readFieldsFromPb(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALEdit walEdit, WALCellCodec.ByteStringUncompressor uncompressor) throws IOException
IOException
public long estimatedSerializedSizeOf()
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.