ListShardMap<KeyT> Class
- java.
lang. Object - Cloneable
- ShardMap
- com.
microsoft. azure. elasticdb. shard. map. ListShardMap<KeyT>
- com.
Type Parameters
- KeyT
public class ListShardMap extends ShardMap
Represents a shard map of points where points are of the specified key.
Constructor Summary
Constructor | Description |
---|---|
ListShardMap(ShardMapManager shardMapManager, StoreShardMap ssm) |
Constructs a new instance. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Shard |
clone()
Clones the specified shard map. |
Shard |
cloneCore()
Clones the current shard map instance. |
Point |
createPointMapping(KeyT point, Shard shard)
Creates and adds a point mapping to ShardMap. |
Point |
createPointMapping(PointMappingCreationInfo creationInfo)
Creates and adds a point mapping to ShardMap. |
void |
deleteMapping(PointMapping mapping)
Removes a point mapping. |
<V> IShard |
getMapper()
Gets the mapper. This method is used by OpenConnection/Lookup of V. |
Point |
getMappingForKey(KeyT key)
Looks up the key value and returns the corresponding mapping. Only the global shard map store is searched, not the local cache. This is equivalent to . |
Point |
getMappingForKey(KeyT key, LookupOptions lookupOptions)
Looks up the key value and returns the corresponding mapping. |
Mapping |
getMappingLockOwner(PointMapping mapping)
Gets the lock owner id of the specified mapping. |
List<Point |
getMappings()
Gets all the point mappings for the shard map. |
List<Point |
getMappings(LookupOptions lookupOptions)
Gets all the point mappings for the shard map. |
List<Point |
getMappings(Range range)
Gets all the mappings that exist within given range. |
List<Point |
getMappings(Range range, LookupOptions lookupOptions)
Gets all the mappings that exist within given range. |
List<Point |
getMappings(Range range, Shard shard)
Gets all the mappings that exist within given range and given shard. |
List<Point |
getMappings(Range range, Shard shard, LookupOptions lookupOptions)
Gets all the mappings that exist within given range and given shard. |
List<Point |
getMappings(Shard shard)
Gets all the mappings that exist for the given shard. |
List<Point |
getMappings(Shard shard, LookupOptions lookupOptions)
Gets all the mappings that exist for the given shard. |
void |
lockMapping(PointMapping mapping, MappingLockToken mappingLockToken)
Locks the mapping for the specified owner The state of a locked mapping can only be modified by the lock owner. |
Point |
markMappingOffline(PointMapping mapping)
Marks the specified mapping offline. |
Point |
markMappingOnline(PointMapping mapping)
Marks the specified mapping online. |
boolean |
tryGetMappingForKey(KeyT key, LookupOptions lookupOptions, ReferenceObjectHelper<PointMapping> pointMapping)
Tries to looks up the key value and place the corresponding mapping in pointMapping . |
boolean |
tryGetMappingForKey(KeyT key, ReferenceObjectHelper<PointMapping> pointMapping)
Tries to looks up the key value and place the corresponding mapping in pointMapping . Only the global shard map store is searched, not local cache. This is equivalent to . |
void |
unlockMapping(MappingLockToken mappingLockToken)
Unlocks all mappings in this map that belong to the given MappingLockToken. |
void |
unlockMapping(PointMapping mapping, MappingLockToken mappingLockToken)
Unlocks the specified mapping |
Point |
updateMapping(PointMapping currentMapping, PointMappingUpdate update)
Updates a PointMapping<KeyT> with the updates provided in the update parameter. |
Point |
updateMapping(PointMapping currentMapping, PointMappingUpdate update, MappingLockToken mappingLockToken)
Updates a point mapping with the changes provided in the update parameter. |
Inherited Members
Constructor Details
ListShardMap
public ListShardMap(ShardMapManager shardMapManager, StoreShardMap ssm)
Constructs a new instance.
Parameters:
Method Details
clone
public ShardMap clone()
Clones the specified shard map.
Returns:
cloneCore
protected ShardMap cloneCore()
Clones the current shard map instance.
Returns:
createPointMapping
public PointMapping createPointMapping(KeyT point, Shard shard)
Creates and adds a point mapping to ShardMap.
Parameters:
Returns:
createPointMapping
public PointMapping createPointMapping(PointMappingCreationInfo creationInfo)
Creates and adds a point mapping to ShardMap.
Parameters:
Returns:
deleteMapping
public void deleteMapping(PointMapping mapping)
Removes a point mapping.
Parameters:
getMapper
public
Gets the mapper. This method is used by OpenConnection/Lookup of V.
Returns:
getMappingForKey
public PointMapping getMappingForKey(KeyT key)
Looks up the key value and returns the corresponding mapping. Only the global shard map store is searched, not the local cache. This is equivalent to .
Parameters:
Returns:
getMappingForKey
public PointMapping getMappingForKey(KeyT key, LookupOptions lookupOptions)
Looks up the key value and returns the corresponding mapping.
Parameters:
Returns:
getMappingLockOwner
public MappingLockToken getMappingLockOwner(PointMapping mapping)
Gets the lock owner id of the specified mapping.
Parameters:
Returns:
getMappings
public List
Gets all the point mappings for the shard map.
Returns:
getMappings
public List
Gets all the point mappings for the shard map.
Parameters:
Returns:
getMappings
public List
Gets all the mappings that exist within given range.
Parameters:
Returns:
getMappings
public List
Gets all the mappings that exist within given range.
Parameters:
Returns:
getMappings
public List
Gets all the mappings that exist within given range and given shard.
Parameters:
Returns:
getMappings
public List
Gets all the mappings that exist within given range and given shard.
Parameters:
Returns:
getMappings
public List
Gets all the mappings that exist for the given shard.
Parameters:
Returns:
getMappings
public List
Gets all the mappings that exist for the given shard.
Parameters:
Returns:
lockMapping
public void lockMapping(PointMapping mapping, MappingLockToken mappingLockToken)
Locks the mapping for the specified owner The state of a locked mapping can only be modified by the lock owner.
Parameters:
markMappingOffline
public PointMapping markMappingOffline(PointMapping mapping)
Marks the specified mapping offline.
Parameters:
Returns:
markMappingOnline
public PointMapping markMappingOnline(PointMapping mapping)
Marks the specified mapping online.
Parameters:
Returns:
tryGetMappingForKey
public boolean tryGetMappingForKey(KeyT key, LookupOptions lookupOptions, ReferenceObjectHelper
Tries to looks up the key value and place the corresponding mapping in pointMapping .
Parameters:
Returns:
true
if mapping is found, false
otherwise.
tryGetMappingForKey
public boolean tryGetMappingForKey(KeyT key, ReferenceObjectHelper
Tries to looks up the key value and place the corresponding mapping in pointMapping . Only the global shard map store is searched, not local cache. This is equivalent to .
Parameters:
Returns:
true
if mapping is found, false
otherwise.
unlockMapping
public void unlockMapping(MappingLockToken mappingLockToken)
Unlocks all mappings in this map that belong to the given MappingLockToken.
Parameters:
unlockMapping
public void unlockMapping(PointMapping mapping, MappingLockToken mappingLockToken)
Unlocks the specified mapping
Parameters:
updateMapping
public PointMapping updateMapping(PointMapping currentMapping, PointMappingUpdate update)
Updates a PointMapping<KeyT> with the updates provided in the update parameter.
Parameters:
Returns:
updateMapping
public PointMapping updateMapping(PointMapping currentMapping, PointMappingUpdate update, MappingLockToken mappingLockToken)
Updates a point mapping with the changes provided in the update parameter.
Parameters:
Returns:
Applies to
Azure SDK for Java