IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.deployment
Interface MapSet


public interface MapSet

Represents a set of BackingMaps within an ObjectGrid. These maps are grouped within the MapSet for the purpose of placing them across the same set of containers. The MapSet allows for customization of many placement behaviors.

Since:
WAS XD 6.1 FIX3

Field Summary
static byte PLACEMENT_STRATEGY_FIXED_PARTITIONS
          Represents a placement strategy where there is a fixed number of partitions that are balanced across the available set of containers.
static byte PLACEMENT_STRATEGY_PER_CONTAINER
          Represents a placement strategy where each container gets a fixed number of primary shards and the replicas are then balanced across the other containers.
 
Method Summary
 void addMap(BackingMapConfiguration backingMapConfig)
          Add a BackingMapConfiguration to this MapSet.
 void addShardMapping(ShardMapping shardMapping)
          Add a ShardMapping to this MapSet.
 BackingMapConfiguration getMap(String mapName)
          Get a BackinMapConfiguration that has been added to this MapSet.
 Collection getMaps()
          Get a Collection of BackingMapConfiguration objects that have been added to this MapSet
 int getMaxAsyncReplicas()
          Get the maximum number of asynchronous replicas for each partition in the MapSet.
 int getMaxSyncReplicas()
          Get the maximum number of synchronous replicas for each partition in the MapSet.
 int getMinSyncReplicas()
          Get the minimum number of synchronous replicas for each partition in the MapSet.
 String getName()
          Get the name of this MapSet
 int getNumberOfPartitions()
          Get the number of partitions of this MapSet.
 int getNumInitialContainers()
          Get the initial number of containers.
 byte getPlacementStrategy()
          Get the placement strategy employed by this MapSet.
 List getShardMappings()
          Get a List of ShardMappings that have been added to this MapSet.
 boolean isAutoReplaceLostShards()
          Get the replace lost shards setting.
 boolean isDevelopmentMode()
          Get the development mode setting.
 boolean isReplicaReadEnabled()
          Get the replica read enabled setting.
 BackingMapConfiguration removeMap(String mapName)
          Remove a BackingMapConfiguration from this MapSet
 void setAutoReplaceLostShards(boolean autoReplaceLostShards)
          Setting this to true instructs the placement service to automatically attempt to replace any shards that were lost as the result of container loss.
 void setDevelopmentMode(boolean developmentMode)
          When development mode is disabled, each shard from a single partition will be placed onto a container running on a different machine.
 void setMaxAsyncReplicas(int maxAsyncReplicas)
          Set the maximum number of asynchronous replicas for each partition in the MapSet.
 void setMaxSyncReplicas(int maxSyncReplicas)
          Set the maximum number of synchronous replicas for each partition in the MapSet.
 void setMinSyncReplicas(int minSyncReplicas)
          Set the minimum number of synchronous replicas for each partition in the MapSet.
 void setName(String mapSetName)
          Set the name of this MapSet
 void setNumberOfPartitions(int numberOfPartitions)
          Set the number of partitions for this MapSet.
 void setNumInitialContainers(int numInitialContainers)
          Set the number of containers that must be available to host this MapSet before initial placement will occur.
 void setPlacementStrategy(byte strategy)
          Set the placement strategy that this MapSet should employ.
 void setReplicaReadEnabled(boolean replicaReadEnabled)
          Enable or disable reading data from replicas.
 

Field Detail

PLACEMENT_STRATEGY_FIXED_PARTITIONS

static final byte PLACEMENT_STRATEGY_FIXED_PARTITIONS
Represents a placement strategy where there is a fixed number of partitions that are balanced across the available set of containers. This strategy can be used in either server core or client/server mode. This is the default placement strategy.

See Also:
Constant Field Values

PLACEMENT_STRATEGY_PER_CONTAINER

static final byte PLACEMENT_STRATEGY_PER_CONTAINER
Represents a placement strategy where each container gets a fixed number of primary shards and the replicas are then balanced across the other containers. This strategy can be used only in server core mode as clients can not be made to route in this mode. The numInitialContainers attribute is ignored when this placement type is used.

See Also:
Constant Field Values
Method Detail

setName

void setName(String mapSetName)
Set the name of this MapSet

Parameters:
mapSetName - the name of the MapSet

getName

String getName()
Get the name of this MapSet

Returns:
the name of the MapSet

addMap

void addMap(BackingMapConfiguration backingMapConfig)
Add a BackingMapConfiguration to this MapSet. A MapSet must contain one or more BackingMapConfiguration objects.

Parameters:
backingMapConfig - the BackingMapConfiguration to add.
Throws:
ObjectGridRuntimeException - if the BackingMapConfiguration is not found in the containing ObjectGridDeployment object.

removeMap

BackingMapConfiguration removeMap(String mapName)
Remove a BackingMapConfiguration from this MapSet

Parameters:
mapName - name of the map to remove
Returns:
the BackingMapConfiguration that was removed. Null is returned if no BackingMapConfiguration was found with a name that matches the mapName.

getMap

BackingMapConfiguration getMap(String mapName)
Get a BackinMapConfiguration that has been added to this MapSet.

Parameters:
mapName - - name of the BackingMapConfiguration to retrieve.
Returns:
the BackingMapConfiguration with the mapName specified

getMaps

Collection getMaps()
Get a Collection of BackingMapConfiguration objects that have been added to this MapSet

Returns:
a Collection of BackingMapConfiguration objects

getMaxAsyncReplicas

int getMaxAsyncReplicas()
Get the maximum number of asynchronous replicas for each partition in the MapSet.

Returns:
the maximum number of asynchronous replicas for each partition.
See Also:
setMaxAsyncReplicas(int)

setMaxAsyncReplicas

void setMaxAsyncReplicas(int maxAsyncReplicas)
Set the maximum number of asynchronous replicas for each partition in the MapSet. This number must be greater than or equal to 0.

Parameters:
maxAsyncReplicas - the maximum number of asynchronous replicas for each partition
See Also:
getMaxAsyncReplicas()

getMaxSyncReplicas

int getMaxSyncReplicas()
Get the maximum number of synchronous replicas for each partition in the MapSet.

Returns:
the maximum number of synchronous replicas for each partition
See Also:
setMaxSyncReplicas(int)

setMaxSyncReplicas

void setMaxSyncReplicas(int maxSyncReplicas)
Set the maximum number of synchronous replicas for each partition in the MapSet. This number must be greater than or equal to 0.

Parameters:
maxSyncReplicas - the maximum number of synchronous replicas for each partition.

getMinSyncReplicas

int getMinSyncReplicas()
Get the minimum number of synchronous replicas for each partition in the MapSet.

Returns:
the minimum number of synchronous replicas for each partition
See Also:
setMinSyncReplicas(int)

setMinSyncReplicas

void setMinSyncReplicas(int minSyncReplicas)
Set the minimum number of synchronous replicas for each partition in the MapSet. This number must be greater than or equal to 0.

Placement of this MapSet will not occur until there are containers available to support each partition's primary as well as the number of minimum synchronous replicas specified.

Parameters:
minSyncReplicas - - the minimum number of synchronous replicas for each partition

getNumberOfPartitions

int getNumberOfPartitions()
Get the number of partitions of this MapSet. Each map within this MapSet will be divided into this many partitions.

Returns:
the number of partitions
See Also:
setNumberOfPartitions(int)

setNumberOfPartitions

void setNumberOfPartitions(int numberOfPartitions)
Set the number of partitions for this MapSet. This number must be greater than or equal to 1.

Parameters:
numberOfPartitions - - each map within this MapSet will be divided into this number of partitions

getPlacementStrategy

byte getPlacementStrategy()
Get the placement strategy employed by this MapSet.

Returns:
The placement strategy employed by this MapSet.
See Also:
PLACEMENT_STRATEGY_FIXED_PARTITIONS, PLACEMENT_STRATEGY_PER_CONTAINER

setPlacementStrategy

void setPlacementStrategy(byte strategy)
Set the placement strategy that this MapSet should employ.

Parameters:
strategy - The strategy that this MapSet should employ for placement.
See Also:
PLACEMENT_STRATEGY_FIXED_PARTITIONS, PLACEMENT_STRATEGY_PER_CONTAINER

setReplicaReadEnabled

void setReplicaReadEnabled(boolean replicaReadEnabled)
Enable or disable reading data from replicas.

Parameters:
replicaReadEnabled - set to true to enable reading from replica. Set to false to force all reads to occur on the primary.

isReplicaReadEnabled

boolean isReplicaReadEnabled()
Get the replica read enabled setting.

Returns:
true if reading from replicas is enabled, false if all reads are routed to the primary.
See Also:
setReplicaReadEnabled(boolean)

setNumInitialContainers

void setNumInitialContainers(int numInitialContainers)
Set the number of containers that must be available to host this MapSet before initial placement will occur. Before placement is triggered the available containers must also be able to support the minimum number of synchronous replicas.

This number must be greater than or equal to 1. The numInitialContainers is ignored if placement strategy is set to PLACEMENT_STRATEGY_PER_CONTAINER.

Parameters:
numInitialContainers - the number of containers (1 or more) that must be available.
See Also:
setMinSyncReplicas(int), setPlacementStrategy(byte)

getNumInitialContainers

int getNumInitialContainers()
Get the initial number of containers.

Returns:
the number of containers that must be available to host this MapSet before initial placement occurs.
See Also:
setNumInitialContainers(int)

setAutoReplaceLostShards

void setAutoReplaceLostShards(boolean autoReplaceLostShards)
Setting this to true instructs the placement service to automatically attempt to replace any shards that were lost as the result of container loss.

Setting this to false will cause lost shard to remain unplaced.

By default, lost shards will be automatically replaced.

Parameters:
autoReplaceLostShards - set to false to prevent lost shards from automatically being replaced

isAutoReplaceLostShards

boolean isAutoReplaceLostShards()
Get the replace lost shards setting.

Returns:
true if lost shards will automatically be replaced upon the loss of a container
See Also:
setAutoReplaceLostShards(boolean)

setDevelopmentMode

void setDevelopmentMode(boolean developmentMode)
When development mode is disabled, each shard from a single partition will be placed onto a container running on a different machine. Enabling development mode allows shards from the same partition to be placed onto containers running on the same machine.

Parameters:
developmentMode -

isDevelopmentMode

boolean isDevelopmentMode()
Get the development mode setting.

Returns:
true if development mode is enabled
See Also:
setDevelopmentMode(boolean)

getShardMappings

List getShardMappings()
Get a List of ShardMappings that have been added to this MapSet.

Returns:
a List of ShardMappings
See Also:
addShardMapping(ShardMapping)

addShardMapping

void addShardMapping(ShardMapping shardMapping)
Add a ShardMapping to this MapSet. Only 1 primary ShardMapping can be added.

ShardMappings are not required. If ShardMappings are used, there must be one for each shard in the partition. One for the primary shard, a ShardMapping for each synchronous replica up to the number of maximum synchronous replicas, and a ShardMapping for each asynchronous replica up to the number of maximum asynchronous replicas.

The order in which the ShardMappings are added is significant. Within each replica type (synchronous, asynchronous), the ShardMapping's position in the List, relative to the same ShardType, will determine which shard the ShardMapping applies to. For example, the first ShardMapping added for a synchronous replica shard type will determine the placement behavior of the first synchronous replica.

Parameters:
shardMapping - the ShardMapping to add.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.