GemFire 6.6

com.gemstone.gemfire.cache.partition
Class PartitionManager

java.lang.Object
  extended by com.gemstone.gemfire.cache.partition.PartitionManager

public final class PartitionManager
extends Object

An utility class to manage partitions (aka buckets) on a Partitioned Region without requiring data (e.g. keys). Note : Please contact support@gemstone.com before using these APIs

Since:
6.5

Method Summary
static boolean createPrimaryBucket(Region<?,?> region, int bucketId, boolean destroyExistingRemote, boolean destroyExistingLocal)
          This method creates primary bucket in the following way: If the partitioned region does not have a primary bucket for the bucketId, it creates a primary bucket on the member and returns true.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createPrimaryBucket

public static boolean createPrimaryBucket(Region<?,?> region,
                                          int bucketId,
                                          boolean destroyExistingRemote,
                                          boolean destroyExistingLocal)
This method creates primary bucket in the following way:

If the partitioned region does not have a primary bucket for the bucketId, it creates a primary bucket on the member and returns true.

If the partitioned region does have a primary bucket for the bucketId on the member :
a) If destroyExistingLocal passed is true, it destroys the existing bucket, and then creates a new primary bucket and returns true.
b) If destroyExistingLocal passed is false, it creates a bucket instance and returns false.

If the partitioned region does have a primary bucket for the bucketId on remote members :
a) If destroyExistingRemote passed is true, it destroys the existing bucket on remote member, and then creates a new primary bucket on this member and returns true.
b) If destroyExistingRemote passed is false, it throws IllegalStateException.

Parameters:
region - the partitioned region on which to create the bucket
bucketId - the identifier of the bucket to create
destroyExistingRemote - whether to destroy the remote bucket if exist
destroyExistingLocal - whether to destroy the local bucket if exist
Returns:
true when the bucket has been created otherwise false
Throws:
IllegalArgumentException - if the provided region is not a partitioned region
IllegalArgumentException - if the provided bucketId is less than zero or greater than or equal to the partitioned region's total number of buckets
IllegalStateException - if the partitioned region have the primary bucket for the bucket id on a remote member and destroyExistingRemote parameter provided is false

GemFire 6.6

Copyright © 1997-2011 VMware, Inc. All rights reserved.