Shard Class

Definition

Representation of a single shard. Shards are basically locators for data sources i.e. ShardLocations that have been registered with a shard map. Shards are used in mapping as targets of mappings (see PointMapping and RangeMapping).

public class Shard implements IShardProvider<ShardLocation>
Inheritance
java.lang.Object
Shard

Constructors

Shard(ShardMapManager shardMapManager, ShardMap shardMap, ShardCreationInfo creationInfo)

Constructs a Shard given shard creation arguments.

Shard(ShardMapManager shardMapManager, ShardMap shardMap, StoreShard storeShard)

Internal constructor that uses storage representation.

Methods

clone()

Clones the instance.

equals(Object obj)

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

equals(Shard other)

Performs equality comparison with given Shard.

getId()

Identity of the shard. Each shard should have a unique one.

getLocation()

Gets Location of the shard.

getShardInfo()

Shard for the ShardProvider object.

getShardMap()
getShardMapId()

Identify of the ShardMap this shard belongs to.

getShardMapManager()
getStatus()

Gets the status of the shard which can be either online or offline. Connections can only be opened using Shard.OpenConnection(string, ConnectionOptions) on the shard map when the shard is online. Setting the shard status to offline prevents connections when the shard is undergoing maintenance operations.

getStoreShard()
getValue()

Value corresponding to the Shard. Represents traits of the Shard object provided by the ShardInfo property.

getVersion()

Shard version.

hashCode()

Calculates the hash code for this instance.

openConnection(String connectionString)

Opens a regular SqlConnection to the specified shard, with Validate.

openConnection(String connectionString, ConnectionOptions options)

Opens a regular SqlConnection to the specified shard.

openConnectionAsync(String connectionString)

Asynchronously opens a regular SqlConnection to the specified shard, with Validate.

openConnectionAsync(String connectionString, ConnectionOptions options)

Asynchronously a regular SqlConnection to the specified shard.

setShardMap(ShardMap value)
setShardMapManager(ShardMapManager value)
setStoreShard(StoreShard value)
toString()

Converts the object to its string representation.

validate(StoreShardMap shardMap, Connection conn)

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

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.

Applies to