jgroup.core.arm
Interface DistributionScheme

All Superinterfaces:
MergingListener

public interface DistributionScheme
extends MergingListener

The DistributionScheme interface provides a standard for implementing various distribution schemes that simplify interaction with the ReplicationManager.

Since:
Jgroup 1.2
Author:
Hein Meling

Method Summary
 HostSet assignReplicas(AppConfig app)
          Assign the host location for the specified application.
 HostSet collocateReplicas(AppConfig app, AppConfig collocateWithApp)
           
 Host reassignReplica(AppConfig app, Host host)
          Reassign the application replica running on the specified host.
 HostSet removeReplicas(AppConfig app)
          Remove replica assignments for the specified application.
 void viewChangeEvent(View view)
          Update the distribution scheme according to the specified view for the given application.
 
Methods inherited from interface jgroup.core.MergingListener
getState, putState
 

Method Detail

assignReplicas

HostSet assignReplicas(AppConfig app)
                       throws RedundancyException,
                              GroupExistsException
Assign the host location for the specified application. The AppConfig object also contains the required redundancy.

Parameters:
app - An AppConfig object specifying the class parameters and redundancy requirements, and group identifier.
Returns:
A HostSet specifying the locations where the replicas should be created.
Throws:
RedundancyException - Is raised if the specified redundancy could not be satisfied.
GroupExistsException - Raised if the specified application group already exists (has been assigned to some hostset).

removeReplicas

HostSet removeReplicas(AppConfig app)
                       throws UnknownGroupException
Remove replica assignments for the specified application.

Parameters:
app - An AppConfig object specifying the class parameters and redundancy requirements, and group identifier.
Returns:
A HostSet specifying the locations where the replicas was located prior to the remove.
Throws:
UnknownGroupException

collocateReplicas

HostSet collocateReplicas(AppConfig app,
                          AppConfig collocateWithApp)
                          throws GroupExistsException,
                                 RedundancyException,
                                 UnknownGroupException
Throws:
GroupExistsException
RedundancyException
UnknownGroupException

reassignReplica

Host reassignReplica(AppConfig app,
                     Host host)
                     throws UnknownGroupException,
                            RedundancyException
Reassign the application replica running on the specified host.

Parameters:
app - The application group to which the replica belongs.
host - The host from which to remove the replica.
Returns:
The host on which a new replica should be created.
Throws:
UnknownGroupException - The given application group is unknown.
RedundancyException - Raised if the system could not reassign the replica to any host in the system.

viewChangeEvent

void viewChangeEvent(View view)
Update the distribution scheme according to the specified view for the given application.

Note that the method behavior should be idempotent.



Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.