BaseShardMapper Class
- java.
lang. Object - com.
microsoft. azure. elasticdb. shard. mapper. BaseShardMapper
- com.
public class BaseShardMapper
Base class for keyed mappers.
Field Summary
Modifier and Type | Field and Description |
---|---|
final UUID | DEFAULT_OWNER |
Shard |
shardMap
Containing shard map. |
Shard |
shardMapManager
Reference to ShardMapManager. |
Constructor Summary
Constructor | Description |
---|---|
BaseShardMapper(ShardMapManager shardMapManager, ShardMap sm) |
Base shard mapper, which is just a holder of some fields. |
Method Summary
Field Details
DEFAULT_OWNER
protected static final UUID DEFAULT_OWNER= UUID.randomUUID()
shardMap
protected ShardMap shardMap
Containing shard map.
shardMapManager
protected ShardMapManager shardMapManager
Reference to ShardMapManager.
Constructor Details
BaseShardMapper
protected BaseShardMapper(ShardMapManager shardMapManager, ShardMap sm)
Base shard mapper, which is just a holder of some fields.
Parameters:
Method Details
add
protected final
Adds a mapping to shard map.
Parameters:
Returns:
ensureMappingBelongsToShardMap
protected final
Validates the input parameters and ensures that the mapping parameter belong to this shard map.
Parameters:
getLockOwnerForMapping
public final
Gets the lock owner of a mapping.
Parameters:
Returns:
getMappingsForRange
protected final
Gets all the mappings that exist within given range.
Parameters:
Returns:
getShardMap
protected final ShardMap getShardMap()
getShardMapManager
protected final ShardMapManager getShardMapManager()
lockOrUnlockMappings
public final
Locks or unlocks a given mapping or all mappings.
Parameters:
lookup
protected final
Looks up the key value and returns the corresponding mapping.
Parameters:
Returns:
openConnectionForKey
protected final
Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value.
Parameters:
Returns:
openConnectionForKey
protected final
Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value.
Parameters:
Returns:
openConnectionForKeyAsync
protected final
Parameters:
openConnectionForKeyAsync
protected final
Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value.
Parameters:
Returns:
remove
protected final
Removes a mapping from shard map.
Parameters:
setStatus
protected static static
Sets the status of a shard mapping
Parameters:
setStatus
protected static static
Sets the status of a shard mapping
Parameters:
update
protected final
Allows for update to a mapping with the updates provided in the update parameter.
Parameters:
Returns:
update
protected final
Allows for update to a mapping with the updates provided in the update parameter.
Parameters:
Returns:
Applies to
Azure SDK for Java