ListShardMapper Class
- java.
lang. Object - BaseShardMapper
- com.
microsoft. azure. elasticdb. shard. mapper. ListShardMapper
- com.
public class ListShardMapper extends BaseShardMapper implements IShardMapper<PointMapping, Object>
Mapper from single keys (points) to their corresponding shards.
Constructor Summary
Constructor | Description |
---|---|
ListShardMapper(ShardMapManager shardMapManager, ShardMap sm) |
List shard mapper, which managers point mappings. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Point |
add(PointMapping mapping)
Adds a point mapping. |
UUID |
getLockOwnerForMapping(PointMapping mapping)
Gets the lock owner of a mapping. |
List<Point |
getMappingsForRange(Range range, Shard shard, LookupOptions lookupOptions)
Gets all the mappings that exist within given range. |
void |
lockOrUnlockMappings(PointMapping mapping, UUID lockOwnerId, LockOwnerIdOpType lockOwnerIdOpType)
Locks or unlocks a given mapping or all mappings. |
Point |
lookup(Object key, LookupOptions lookupOptions)
Looks up the key value and returns the corresponding mapping. |
Point |
markMappingOffline(PointMapping mapping)
Marks the given mapping offline. |
Point |
markMappingOffline(PointMapping mapping, UUID lockOwnerId)
Marks the given mapping offline. |
Point |
markMappingOnline(PointMapping mapping)
Marks the given mapping online. |
Point |
markMappingOnline(PointMapping mapping, UUID lockOwnerId)
Marks the given mapping online. |
Connection |
openConnectionForKey(Object key, String connectionString)
Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value. |
Connection |
openConnectionForKey(Object key, String connectionString, ConnectionOptions options)
Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value. |
Callable<Connection> |
openConnectionForKeyAsync(Object key, String connectionString)
Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value. |
Callable<Connection> |
openConnectionForKeyAsync(Object key, String connectionString, ConnectionOptions options)
Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value. |
void |
remove(PointMapping mapping)
Removes a point mapping. |
void |
remove(PointMapping mapping, UUID lockOwnerId)
Removes a point mapping. |
boolean |
tryLookup(Object key, LookupOptions lookupOptions, ReferenceObjectHelper<PointMapping> mapping)
Tries to looks up the key value and returns the corresponding mapping. |
Point |
update(PointMapping currentMapping, PointMappingUpdate update)
Allows for update to a point mapping with the updates provided in the update parameter. |
Point |
update(PointMapping currentMapping, PointMappingUpdate update, UUID lockOwnerId)
Allows for update to a point mapping with the updates provided in the update parameter. |
Inherited Members
Constructor Details
ListShardMapper
public ListShardMapper(ShardMapManager shardMapManager, ShardMap sm)
List shard mapper, which managers point mappings.
Parameters:
Method Details
add
public PointMapping add(PointMapping mapping)
Adds a point mapping.
Parameters:
Returns:
getLockOwnerForMapping
public UUID getLockOwnerForMapping(PointMapping mapping)
Gets the lock owner of a mapping.
Parameters:
Returns:
getMappingsForRange
public List
Gets all the mappings that exist within given range.
Parameters:
Returns:
lockOrUnlockMappings
public void lockOrUnlockMappings(PointMapping mapping, UUID lockOwnerId, LockOwnerIdOpType lockOwnerIdOpType)
Locks or unlocks a given mapping or all mappings.
Parameters:
lookup
public PointMapping lookup(Object key, LookupOptions lookupOptions)
Looks up the key value and returns the corresponding mapping.
Parameters:
Returns:
markMappingOffline
public PointMapping markMappingOffline(PointMapping mapping)
Marks the given mapping offline.
Parameters:
Returns:
markMappingOffline
public PointMapping markMappingOffline(PointMapping mapping, UUID lockOwnerId)
Marks the given mapping offline.
Parameters:
Returns:
markMappingOnline
public PointMapping markMappingOnline(PointMapping mapping)
Marks the given mapping online.
Parameters:
Returns:
markMappingOnline
public PointMapping markMappingOnline(PointMapping mapping, UUID lockOwnerId)
Marks the given mapping online.
Parameters:
Returns:
openConnectionForKey
public Connection openConnectionForKey(Object key, String connectionString)
Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value.
Parameters:
Returns:
openConnectionForKey
public Connection openConnectionForKey(Object key, String connectionString, ConnectionOptions options)
Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value.
Parameters:
Returns:
openConnectionForKeyAsync
public Callable
Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value.
Parameters:
Returns:
openConnectionForKeyAsync
public Callable
Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value.
Parameters:
Returns:
remove
public void remove(PointMapping mapping)
Removes a point mapping.
Parameters:
remove
public void remove(PointMapping mapping, UUID lockOwnerId)
Removes a point mapping.
Parameters:
tryLookup
public boolean tryLookup(Object key, LookupOptions lookupOptions, ReferenceObjectHelper
Tries to looks up the key value and returns the corresponding mapping.
Parameters:
Returns:
true
if mapping is found, false
otherwise.
update
public PointMapping update(PointMapping currentMapping, PointMappingUpdate update)
Allows for update to a point mapping with the updates provided in the update parameter.
Parameters:
Returns:
update
public PointMapping update(PointMapping currentMapping, PointMappingUpdate update, UUID lockOwnerId)
Allows for update to a point mapping with the updates provided in the update parameter.
Parameters:
Returns:
Applies to
Azure SDK for Java