IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.deployment
Interface ZoneRule


public interface ZoneRule

Defines placement rules with respect to zones. The ZoneRule defines placement behavior for the shards that are associated with it via ShardMappings.

Since:
WAS XD 6.1 FIX3
See Also:
ShardMapping

Method Summary
 void addZone(String zoneName)
          Add a zone to this ZoneRule
 String getName()
          Get the name of this ZoneRule
 Set getZones()
          Get the zones that are part of this ZoneRule.
 boolean isExclusivePlacement()
          If exclusive placement is enabled, then each ShardMapping that uses this ZoneRule will have its shard placed into a different one of the zones defined for this ZoneRule.
 void setExclusivePlacement(boolean exclusivePlacement)
          Enable or disable exclusive placement within this ZoneRule.
 void setZones(Set zones)
          Set the zones for this Zone Rule.
 

Method Detail

getName

String getName()
Get the name of this ZoneRule

Returns:
the name of this ZoneRule

getZones

Set getZones()
Get the zones that are part of this ZoneRule. Shards that use this ZoneRule are eligible to be placed within these zones.

Returns:
a Set of zones

addZone

void addZone(String zoneName)
Add a zone to this ZoneRule

Parameters:
zoneName - name of the zone to be added

setZones

void setZones(Set zones)
Set the zones for this Zone Rule. Shards that use this ZoneRule are eligible to be placed within these zones.

Parameters:
zones - the zones to set for this rule.

isExclusivePlacement

boolean isExclusivePlacement()
If exclusive placement is enabled, then each ShardMapping that uses this ZoneRule will have its shard placed into a different one of the zones defined for this ZoneRule.

If exclusive placement is disabled, placement behavior is inclusive. Inclusive placement requires that the shards for each ShardMapping that use this ZoneRule are placed into the same zone.

Returns:
true if the shards are to be placed in different zones, false if shards are to be placed in the same zone (inclusively).
See Also:
setExclusivePlacement(boolean)

setExclusivePlacement

void setExclusivePlacement(boolean exclusivePlacement)
Enable or disable exclusive placement within this ZoneRule. If exclusive placement is enabled, then each ShardMapping that uses this ZoneRule will have its shard placed into a different one of the zones defined for this ZoneRule.

Consider this example. The primary and a synchronous replica ShardMapping both use the same ZoneRule with exclusive placement enabled. The ZoneRule applies to zone1 and zone2. Since exclusive placement is enabled, the primary and the synchronous replica must be placed in different zones for each partition . If a partition's primary is placed in zone1, the synchronous replica must be placed in zone2.

If exclusive placement is disabled, placement behavior is inclusive. Inclusive placement requires that the shards for each ShardMapping that use this ZoneRule are placed into the same zone.

Consider this example. A synchronous and an asynchronous ShardMapping both use the same ZoneRule with exclusive placement disabled. The ZoneRule applies to zone1 and zone2. Since placement is inclusive, the synchronous and the asynchronous replica must be placed into the same zone for each partition. If a partition's synchronous replica is placed into zone1, the asynchronous replica must also be placed in zone1. Exclusive placement is enabled by default.

Parameters:
exclusivePlacement - - if set to true, place all shards in different zones.
See Also:
isExclusivePlacement()

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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