你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
MappingLockToken Class
- java.
lang. Object - com.
microsoft. azure. elasticdb. shard. base. MappingLockToken
- com.
public class MappingLockToken
Public type that represents the owner of a lock held on a mapping. This class is immutable.
Field Summary
Modifier and Type | Field and Description |
---|---|
final Mapping |
ForceUnlock
Token that can be used to force an unlock on any locked mapping. |
final Mapping |
NoLock
Token representing the default state where the mapping isn't locked. |
Constructor Summary
Constructor | Description |
---|---|
MappingLockToken(UUID lockOwnerId) |
Instantiates an instance of MappingLockToken with the given lock owner id. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Mapping |
create()
Creates an instance of MappingLockToken. |
boolean |
equals(MappingLockToken other)
Compares two instances of MappingLockToken to see if they have the same owner. |
boolean |
equals(Object obj)
Determines whether the specified object is equal to the current object. |
UUID | getLockOwnerId() |
int |
hashCode()
Calculates the hash code for this instance. |
boolean |
opEquality(MappingLockToken leftMappingLockToken, MappingLockToken rightMappingLockToken)
Equality operator. |
boolean |
opInequality(MappingLockToken leftMappingLockToken, MappingLockToken rightMappingLockToken)
Inequality operator. |
void | setLockOwnerId(UUID value) |
Field Details
ForceUnlock
public static final MappingLockToken ForceUnlock= new MappingLockToken(UUID.fromString("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"))
Token that can be used to force an unlock on any locked mapping.
NoLock
public static final MappingLockToken NoLock= new MappingLockToken(new UUID(0L, 0L))
Token representing the default state where the mapping isn't locked.
Constructor Details
MappingLockToken
public MappingLockToken(UUID lockOwnerId)
Instantiates an instance of MappingLockToken with the given lock owner id.
Parameters:
Method Details
create
public static MappingLockToken create()
Creates an instance of MappingLockToken.
Returns:
equals
public boolean equals(MappingLockToken other)
Compares two instances of MappingLockToken to see if they have the same owner.
Parameters:
Returns:
equals
public boolean equals(Object obj)
Determines whether the specified object is equal to the current object.
Parameters:
Returns:
getLockOwnerId
public UUID getLockOwnerId()
hashCode
public int hashCode()
Calculates the hash code for this instance.
Returns:
opEquality
public static boolean opEquality(MappingLockToken leftMappingLockToken, MappingLockToken rightMappingLockToken)
Equality operator.
Parameters:
Returns:
opInequality
public static boolean opInequality(MappingLockToken leftMappingLockToken, MappingLockToken rightMappingLockToken)
Inequality operator.
Parameters:
Returns:
setLockOwnerId
public void setLockOwnerId(UUID value)
Parameters: