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

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.policy.PassivePolicy
All Implemented Interfaces:
Policy
Direct Known Subclasses:
AssignmentByQueueMonitorPolicy, DynamicConfigPolicy, ResonanceGroupPolicy

public class PassivePolicy
extends java.lang.Object
implements Policy

Decides how to split the job without triggering any resource redistribution. The passive policy doesn't trigger any file copy: it just collects information and does the best it can.

The policy will use copy selectors and file assignments to build the division. Refer to the documentation of those pieces for the details.

Overview of what the policy does
The policy basically solves all the queries, thus creating a big list of files. Then, according to which machines the file reside, the files are divided into different processes. At that point a new process is created.

How to configure the policy

There are few things how have to set in the policy to configure it. First of all, the queue names:

You will also need to configure the minTimeLimitQueue, which sets the limit for the length of the jobs on the short queues. Both nfsQueue and localQueue are short queues, meaning that if any job longer than the time set, will go to the longQueue, regardless of their input.

The last thing you will need to set, is whether rootd is available on the cluster. This will allow the policy to assign a job files that are on different local disks. This helps to satisfy the requirements, such as minFilesPerProcess when using files on local disk.

An optional setting is the clusterName, which will be assigned to all the jobs being created by this policy.

Version:
$Revision: 1.52 $ $Date: 2006/11/21 00:41:32 $
Author:
Gabriele Carcassi & Pavel Jakl & Levente Hajdu

Field Summary
 java.util.List genericQueueList
           
 java.util.List localQueueList
           
static org.apache.log4j.Logger log
           
protected  java.lang.String longQueue
           
 
Constructor Summary
PassivePolicy()
           
 
Method Summary
 void addQueue(Queue queue)
           
static void assignQueue(Queue queue, Job job)
          This member associates the job to the queue.
 void assignQueues(Request request, java.util.List jobs)
           
 java.util.List assignTargetMachine(Request request)
          Processes a job requests, splitting into multiple processes and assigning the target machines.
 void ClearAllQueues()
           
 boolean getBypassQueueTests()
           
 java.lang.String getClusterName()
          Getter for property clusterName.
 java.lang.String getLocalQueue()
           
 java.lang.String getLongQueue()
           
 int getMinTimeLimitQueue()
           
 java.lang.String getNfsQueue()
           
static int getXrootdPort()
           
static java.lang.String getXrootdRedirectorName()
           
static boolean isRootdAvailable()
          Tells the policy that rootd is available on the cluster.
static boolean isXrootdAvailable()
           
 java.lang.String QueueInfo(java.util.List localQueueList, java.util.List genericQueueList)
           
 java.lang.String resize(java.lang.String string, int size)
           
 void setBypassQueueTests(boolean bypassQueueTests)
           
 void setClusterName(java.lang.String clusterName)
          Sets the name of the cluster that will be assigned to all the jobs.
 void setLocalQueue(java.lang.String localQueue)
          Changes the name of the local queue.
 void setLongQueue(java.lang.String longQueue)
          Changes the name of the long queue.
 void setMinTimeLimitQueue(int minTimeLimit)
          Sets the maximum duration of a job that will be sent to the short queue.
 void setNfsQueue(java.lang.String nfsQueue)
          Changes the name of the NFS queue.
static void setRootdAvailable(boolean rootdAvailable)
           
static void setXrootdAvailable(boolean xrootdAvailable)
           
static void setXrootdPort(int xrootdPort)
           
static void setXrootdRedirectorName(java.lang.String xrootdRedirectorName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.apache.log4j.Logger log

longQueue

protected java.lang.String longQueue

localQueueList

public java.util.List localQueueList

genericQueueList

public java.util.List genericQueueList
Constructor Detail

PassivePolicy

public PassivePolicy()
Method Detail

assignQueue

public static void assignQueue(Queue queue,
                               Job job)
This member associates the job to the queue. In order to set the association the following classes have to be set: job.setQueueObj(queue); job.setAccessMethod() job.setAccessPoint();


assignQueues

public void assignQueues(Request request,
                         java.util.List jobs)

assignTargetMachine

public java.util.List assignTargetMachine(Request request)
Processes a job requests, splitting into multiple processes and assigning the target machines.

The step followed here are:

Most of these actions are done in a separate private method. Refer to those for more information.

Specified by:
assignTargetMachine in interface Policy
Parameters:
request - the job to be processed

setNfsQueue

public void setNfsQueue(java.lang.String nfsQueue)
Changes the name of the NFS queue. The NFS queue is used for all those jobs that aren't assigned any file on local disk and whose length is less than minTimeLimitQueue.


getNfsQueue

public java.lang.String getNfsQueue()

setLocalQueue

public void setLocalQueue(java.lang.String localQueue)
Changes the name of the local queue. The local queue is used for all those jobs that are assigned at least one file on local disk and whose length is less than minTimeLimitQueue.


getLocalQueue

public java.lang.String getLocalQueue()

setLongQueue

public void setLongQueue(java.lang.String longQueue)
Changes the name of the long queue. A job is assigned to the long queue when the minFilePerProcess and filesPerHour do not allow a job length smaller than minTimeLimitQueue.


getLongQueue

public java.lang.String getLongQueue()

setMinTimeLimitQueue

public void setMinTimeLimitQueue(int minTimeLimit)
Sets the maximum duration of a job that will be sent to the short queue. This is also the minimum duration of a job on the long queue. Both the localQueue and the nfsQueue are considered short queues.


getMinTimeLimitQueue

public int getMinTimeLimitQueue()

isRootdAvailable

public static boolean isRootdAvailable()
Tells the policy that rootd is available on the cluster. Having rootd available in the cluster means that, if the filelistSyntax of the job is rootd, the job will be able to access local disk files from every node. This enables the policy to assign to a single job files from different local disks, which will make it easier to satisfy request requirement, such as minFilesPerProcess.


setRootdAvailable

public static void setRootdAvailable(boolean rootdAvailable)

isXrootdAvailable

public static boolean isXrootdAvailable()

setXrootdAvailable

public static void setXrootdAvailable(boolean xrootdAvailable)

getXrootdPort

public static int getXrootdPort()

setXrootdPort

public static void setXrootdPort(int xrootdPort)

getXrootdRedirectorName

public static java.lang.String getXrootdRedirectorName()

setXrootdRedirectorName

public static void setXrootdRedirectorName(java.lang.String xrootdRedirectorName)

getClusterName

public java.lang.String getClusterName()
Getter for property clusterName.

Returns:
Value of property clusterName.

setClusterName

public void setClusterName(java.lang.String clusterName)
Sets the name of the cluster that will be assigned to all the jobs. This parameter allows to create a single CompositeDispatcher with all the diffferent clusters. By changing this parameter in the policy, you will then control on which cluster jobs will be dispatched, without having to reconfigure the dispatchers.


ClearAllQueues

public void ClearAllQueues()

resize

public java.lang.String resize(java.lang.String string,
                               int size)

QueueInfo

public java.lang.String QueueInfo(java.util.List localQueueList,
                                  java.util.List genericQueueList)

addQueue

public void addQueue(Queue queue)

setBypassQueueTests

public void setBypassQueueTests(boolean bypassQueueTests)

getBypassQueueTests

public boolean getBypassQueueTests()


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