ShardMap Class

Definition

Represents a collection of shards and mappings between keys and shards in the collection.

public class ShardMap
Inheritance
java.lang.Object
Cloneable
ShardMap

Constructors

ShardMap(ShardMapManager shardMapManager, StoreShardMap ssm)

Constructs an instance of ShardMap.

Fields

shardMapManager

Reference to ShardMapManager.

storeShardMap

Storage representation.

Methods

clone()

Clones the given shard map.

cloneCore()

Clones the current shard map instance.

createShard(ShardCreationInfo shardCreationArgs)

Creates a new shard and registers it with the shard map.

createShard(ShardLocation location)

Atomically adds a shard to ShardMap using the specified location.

deleteShard(Shard shard)

Removes a shard from ShardMap.

getApplicationNameSuffix()
getId()

Identity.

getKeyType()

Shard map key type.

getMapper()

Gets the mapper. This method is used by OpenConnection and Lookup of V.

getMapType()

Shard map type.

getName()

Shard map name.

getShard(ShardLocation location)

Obtains the shard for the specified location.

getShardMapManager()
getShards()

Gets all shards from the shard map.

getStoreShardMap()
openConnection(IShardProvider shardProvider, String connectionString)

Opens a connection to the given shard provider.

openConnection(IShardProvider shardProvider, String connectionString, ConnectionOptions options)

Opens a connection to the given shard provider.

openConnectionAsync(IShardProvider shardProvider, String connectionString)

Asynchronously opens a connection to the given shard provider.

openConnectionAsync(IShardProvider shardProvider, String connectionString, ConnectionOptions options)

Asynchronously opens a connection to the given shard provider. All exceptions are reported via the returned task.

openConnectionForKey(KeyT key, String connectionString)

Opens a regular SqlConnection to the shard to which the specified key value is mapped, with ConnectionOptions.Validate.

openConnectionForKey(KeyT key, String connectionString, ConnectionOptions options)

Opens a regular SqlConnection to the shard to which the specified key value is mapped.

openConnectionForKeyAsync(KeyT key, String connectionString)

Asynchronously opens a regular SqlConnection to the shard to which the specified key value is mapped, with ConnectionOptions.Validate.

openConnectionForKeyAsync(KeyT key, String connectionString, ConnectionOptions options)

Asynchronously opens a regular SqlConnection to the shard to which the specified key value is mapped.

toString()

Converts the object to its string representation.

tryGetShard(ShardLocation location, ReferenceObjectHelper<Shard> shard)

Tries to obtains the shard for the specified location.

updateShard(Shard currentShard, ShardUpdate update)

Updates a shard with the changes specified in the update parameter.

Applies to