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 | Description |
---|---|
List |
List shard mapper, which managers point mappings. |
Modifier and Type | Method and Description |
---|---|
Point |
add(Point Adds a point mapping. |
UUID |
get Gets the lock owner of a mapping. |
List<Point |
get Gets all the mappings that exist within given range. |
void |
lock Locks or unlocks a given mapping or all mappings. |
Point |
lookup(Object key, Lookup Looks up the key value and returns the corresponding mapping. |
Point |
mark Marks the given mapping offline. |
Point |
mark Marks the given mapping offline. |
Point |
mark Marks the given mapping online. |
Point |
mark Marks the given mapping online. |
Connection |
open Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value. |
Connection |
open Given a key value, obtains a SqlConnection to the shard in the mapping that contains the key value. |
Callable<Connection> |
open Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value. |
Callable<Connection> |
open Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value. |
void |
remove(Point Removes a point mapping. |
void |
remove(Point Removes a point mapping. |
boolean |
try Tries to looks up the key value and returns the corresponding mapping. |
Point |
update(Point Allows for update to a point mapping with the updates provided in the update parameter. |
Point |
update(Point Allows for update to a point mapping with the updates provided in the update parameter. |
ListShardMapper
public ListShardMapper(ShardMapManager shardMapManager, ShardMap sm)
List shard mapper, which managers point mappings.
Parameters:
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:
Azure SDK for Java geri bildirimi
Azure SDK for Java, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: