Partilhar via


RangeMapping Class

public class RangeMapping implements IShardProvider,IMappingInfoProvider

Represents a mapping between a range of key values and a Shard.

Constructor Summary

Constructor Description
RangeMapping(ShardMapManager shardMapManager, RangeMappingCreationInfo creationInfo)

Constructs a range mapping given mapping creation arguments.

RangeMapping(ShardMapManager shardMapManager, ShardMap shardMap, StoreMapping mapping)

Internal constructor used for deserialization from store representation of the mapping object.

Method Summary

Modifier and Type Method and Description
RangeMapping clone()

Clones the instance which implements the interface.

boolean equals(Object obj)

Determines whether the specified object is equal to the current object.

UUID getId()

Identity of the mapping.

MappingKind getKind()

Type of the mapping.

ShardRange getRange()
Shard getShard()

Gets Shard that contains the range of values.

Shard getShardInfo()

Shard that contains the range of values.

UUID getShardMapId()

Identify of the ShardMap this shard belongs to.

ShardMapManager getShardMapManager()

ShardMapManager for the object.

MappingStatus getStatus()

Gets the MappingStatus of the mapping.

StoreMapping getStoreMapping()

Storage representation of the mapping.

String getTypeName()

Mapping type, useful for diagnostics.

Range getValue()
int hashCode()

Calculates the hash code for this instance.

void setRange(ShardRange value)
void setShardMapManager(ShardMapManager value)
String toString()

Converts the object to its string representation.

void validate(StoreShardMap shardMap, Connection conn)

Performs validation that the local representation is as up-to-date as the representation on the backing data store.

Callable validateAsync(StoreShardMap shardMap, Connection conn)

Asynchronously performs validation that the local representation is as up-to-date as the representation on the backing data store.

Constructor Details

RangeMapping

public RangeMapping(ShardMapManager shardMapManager, RangeMappingCreationInfo creationInfo)

Constructs a range mapping given mapping creation arguments.

Parameters:

shardMapManager - Owning ShardMapManager.
creationInfo - Mapping creation information.

RangeMapping

public RangeMapping(ShardMapManager shardMapManager, ShardMap shardMap, StoreMapping mapping)

Internal constructor used for deserialization from store representation of the mapping object.

Parameters:

shardMapManager - Owning ShardMapManager.
shardMap - Owning shard map.
mapping - Storage representation of the mapping.

Method Details

clone

public RangeMapping clone()

Clones the instance which implements the interface.

Returns:

clone of the instance.

equals

public boolean equals(Object obj)

Determines whether the specified object is equal to the current object.

Parameters:

obj - The object to compare with the current object.

Returns:

True if the specified object is equal to the current object; otherwise, false.

getId

public UUID getId()

Identity of the mapping.

getKind

public MappingKind getKind()

Type of the mapping.

Overrides:

RangeMapping.getKind()

getRange

public ShardRange getRange()

getShard

public Shard getShard()

Gets Shard that contains the range of values.

getShardInfo

public Shard getShardInfo()

Shard that contains the range of values.

getShardMapId

public UUID getShardMapId()

Identify of the ShardMap this shard belongs to.

Overrides:

RangeMapping.getShardMapId()

getShardMapManager

public ShardMapManager getShardMapManager()

ShardMapManager for the object.

Overrides:

RangeMapping.getShardMapManager()

getStatus

public MappingStatus getStatus()

Gets the MappingStatus of the mapping.

getStoreMapping

public StoreMapping getStoreMapping()

Storage representation of the mapping.

Overrides:

RangeMapping.getStoreMapping()

getTypeName

public String getTypeName()

Mapping type, useful for diagnostics.

Overrides:

RangeMapping.getTypeName()

getValue

public Range getValue()

hashCode

public int hashCode()

Calculates the hash code for this instance.

Returns:

Hash code for the object.

setRange

public void setRange(ShardRange value)

Parameters:

value

setShardMapManager

public void setShardMapManager(ShardMapManager value)

Parameters:

value

toString

public String toString()

Converts the object to its string representation.

Returns:

String representation of the object.

validate

public void validate(StoreShardMap shardMap, Connection conn)

Performs validation that the local representation is as up-to-date as the representation on the backing data store.

Parameters:

shardMap - Shard map to which the shard provider belongs.
conn - Connection used for validation.

validateAsync

public Callable validateAsync(StoreShardMap shardMap, Connection conn)

Asynchronously performs validation that the local representation is as up-to-date as the representation on the backing data store.

Parameters:

shardMap - Shard map to which the shard provider belongs.
conn - Connection used for validation.

Returns:

A task to await validation completion

Applies to