Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.net.partition
Interface PartitionAssignmentStrategy

All Known Implementing Classes:
MirroringAssignmentStrategy, SimpleAssignmentStrategy

public interface PartitionAssignmentStrategy

A PartitionAssignmentStrategy is a pluggable strategy used by a PartitionedService to manage partition distribution.

The PartitionAssignmentStrategy is initialized when a PartitionedService member becomes the distribution coordinator. The service will periodically ask the strategy to analyze the distribution, and to make distribution recommendations to the DistributionManager. Strategies may be stateful (e.g. some strategies may formulate recommendations based on trends over accumulated statistics).

Since:
Coherence 3.7
Author:
rhl 2010.10.22

Method Summary
 long analyzeDistribution()
          Analyze the distribution and return the desired time interval before the next distribution analysis.
 java.lang.String getDescription()
          Return a human-readable description of the state of the partition assignment.
 void init(DistributionManager manager)
          Initialize the PartitionAssignmentStrategy and bind it to the specified DistributionManager.

 

Method Detail

init

void init(DistributionManager manager)
Initialize the PartitionAssignmentStrategy and bind it to the specified DistributionManager.
Parameters:
manager - the DistributionManager that this strategy is bound to

analyzeDistribution

long analyzeDistribution()
Analyze the distribution and return the desired time interval before the next distribution analysis. This method may or may not make distribution suggestions through the distribution manager. The strategy can influence (but not guarantee) the frequency with which it is analyzed by returning the desired interval before the next call, or -1 if the strategy has no preference and will rely on the PartitionedService to decide.

As a result of failover, partitions may become 'endangered', meaning that the necessary number of backups do not exist. Failure to suggest a distribution recovery plan for those partitions may result in the partition remaining in the endangered state. Additionally, ownership-enabled service members that are in the process of shutting down will wait until all owned partitions are transferred out. Failure to suggest a distribution plan may delay the exit of these leaving members.

The statistics and ownership information exposed by the DistributionManager will not mutate for the duration of this method call.

Returns:
the time interval before the next desired analysis, or -1

getDescription

java.lang.String getDescription()
Return a human-readable description of the state of the partition assignment.
Returns:
a human-readable description

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.