gov.bnl.star.offline.scheduler.policy
Class ClusterAssignmentByPercentagePolicy

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.policy.ClusterAssignmentByPercentagePolicy
All Implemented Interfaces:
Policy

public class ClusterAssignmentByPercentagePolicy
extends java.lang.Object
implements Policy

This policy takes the assignment from another policy, and decides to which cluster to assign them according to the percentage. For each job, a random number is generated between 0 and 1. If the number is less than the percentage set, the job will be forwarded. The number of jobs forwarded, then, is not strictly the percentage set. It will be for large number.

Version:
$Revision: 1.4 $ $Date: 2006/11/21 00:41:32 $
Author:
Gabriele Carcassi

Constructor Summary
ClusterAssignmentByPercentagePolicy()
           
 
Method Summary
 java.util.List assignTargetMachine(Request request)
          Decides how and where to run the job according to its requirements.
 Policy getPolicy()
          Getter for property policy.
 java.lang.String getPrimaryCluster()
          Getter for property primaryCluster.
 java.lang.String getQueueToRedirect()
          Getter for property queueToRedirect.
 double getRedirectedPercentage()
          Getter for property redirectedPercentage.
 java.lang.String getSecondaryCluster()
          Getter for property secondaryCluster.
 void setPolicy(Policy policy)
          Setter for property policy.
 void setPrimaryCluster(java.lang.String primaryCluster)
          Setter for property primaryCluster.
 void setQueueToRedirect(java.lang.String queueToRedirect)
          Setter for property queueToRedirect.
 void setRedirectedPercentage(double redirectedPercentage)
          Setter for property redirectedPercentage.
 void setSecondaryCluster(java.lang.String secondaryCluster)
          Setter for property secondaryCluster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterAssignmentByPercentagePolicy

public ClusterAssignmentByPercentagePolicy()
Method Detail

assignTargetMachine

public java.util.List assignTargetMachine(Request request)
Description copied from interface: Policy
Decides how and where to run the job according to its requirements. The policy has to fill in the process list of the job description. This will be used by the dispatcher to execute the job. A policy, therefore, will receive a JobRequest with no processes, and it should return a JobRequest with all the necessary processes created and fully configured.

The Policy is allowed to query the farm status, use the catalog and trigger file movements. It can slice the job into more than one process, according to, for example, where the input files are located.

Specified by:
assignTargetMachine in interface Policy
Parameters:
request - the job description and its requirements

getPolicy

public Policy getPolicy()
Getter for property policy.

Returns:
Value of property policy.

setPolicy

public void setPolicy(Policy policy)
Setter for property policy.

Parameters:
policy - New value of property policy.

getPrimaryCluster

public java.lang.String getPrimaryCluster()
Getter for property primaryCluster.

Returns:
Value of property primaryCluster.

setPrimaryCluster

public void setPrimaryCluster(java.lang.String primaryCluster)
Setter for property primaryCluster.

Parameters:
primaryCluster - New value of property primaryCluster.

getSecondaryCluster

public java.lang.String getSecondaryCluster()
Getter for property secondaryCluster.

Returns:
Value of property secondaryCluster.

setSecondaryCluster

public void setSecondaryCluster(java.lang.String secondaryCluster)
Setter for property secondaryCluster.

Parameters:
secondaryCluster - New value of property secondaryCluster.

getQueueToRedirect

public java.lang.String getQueueToRedirect()
Getter for property queueToRedirect.

Returns:
Value of property queueToRedirect.

setQueueToRedirect

public void setQueueToRedirect(java.lang.String queueToRedirect)
Setter for property queueToRedirect.

Parameters:
queueToRedirect - New value of property queueToRedirect.

getRedirectedPercentage

public double getRedirectedPercentage()
Getter for property redirectedPercentage.

Returns:
Value of property redirectedPercentage.

setRedirectedPercentage

public void setRedirectedPercentage(double redirectedPercentage)
Setter for property redirectedPercentage.

Parameters:
redirectedPercentage - New value of property redirectedPercentage.


Copyright © 2002-2004 STAR collaboration - Brookhaven National Laboratory. All Rights Reserved.