gov.bnl.star.offline.scheduler.Dispatchers
Class RegXResourceStrategy

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.Dispatchers.RegXResourceStrategy
All Implemented Interfaces:
AbstractResourceStrategy, java.io.Serializable

public class RegXResourceStrategy
extends java.lang.Object
implements AbstractResourceStrategy, java.io.Serializable

Used to build resource requirement strings defined by regular expressions to be used in dispatch commands.

Author:
Levente Hajdu
See Also:
Serialized Form

Constructor Summary
RegXResourceStrategy()
          Creates a new instance of StandardExpressionResourceStrategy
 
Method Summary
 void addResourceMustMatch(java.lang.String mustMatch)
           
 void addResourceMustNotMatch(java.lang.String mustNotMatch)
           
 java.lang.String calcUsage(int unitsUsed)
          Retunes the amount of resources consumed according to the calculation resourcesConsumed=base+(fileFactor*nItemsMatched); This is however limited by the value of "max".
 int getBase()
          Retunes the parameter base in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.
 java.lang.String getDelimiterCharacter()
          Returns the character that is used as the delimiter, this is most usaly the "," and this is the default if not set.
 int getFileFactor()
          Retunes the parameter fileFactor in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.
 int getMax()
          Sets returns the max value that a resource can consume.
 java.util.List getMustMatchList()
           
 java.util.List getMustNotMatchList()
           
 java.lang.String getRegXResourceNameReplacement()
           
 java.lang.String getRegXResourceNameSelection()
           
 java.lang.String prepareResourceUsageSwitch(Job job)
          This function returns a string that represents the resource usage of the job, in such a format that it can be passed to the batch system.
 void setBase(int base)
          Sets the parameter base in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.
 void setDelimiterCharacter(java.lang.String delimiterCharacter)
          Sets the character that is used as the delimiter, this is most usaly the "," and this is the default if not set.
 void setFileFactor(int fileFactor)
          Sets the parameter fileFactor in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.
 void setMax(int max)
          returns the max value that a resource can consume.
 void setMustMatchList(java.util.List mustMatchList)
           
 void setMustNotMatchList(java.util.List mustNotMatchList)
           
 void setRegXResourceNameReplacement(java.lang.String regXResourceNameReplacement)
           
 void setRegXResourceNameSelection(java.lang.String regXResourceNameSelection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegXResourceStrategy

public RegXResourceStrategy()
Creates a new instance of StandardExpressionResourceStrategy

Method Detail

getBase

public int getBase()
Retunes the parameter base in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.


setBase

public void setBase(int base)
Sets the parameter base in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.


getFileFactor

public int getFileFactor()
Retunes the parameter fileFactor in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.


setFileFactor

public void setFileFactor(int fileFactor)
Sets the parameter fileFactor in the formula resourcesConsumed=base+(fileFactor*nItemsMatched) which is used to calculate the resources consumed.


getMax

public int getMax()
Sets returns the max value that a resource can consume. If the resources consumed pass this limit, the number returned will be the limmit.


setMax

public void setMax(int max)
returns the max value that a resource can consume. If the resources consumed pass this limit, the number returned will be the limmit.


calcUsage

public java.lang.String calcUsage(int unitsUsed)
Retunes the amount of resources consumed according to the calculation resourcesConsumed=base+(fileFactor*nItemsMatched); This is however limited by the value of "max".


getRegXResourceNameSelection

public java.lang.String getRegXResourceNameSelection()

setRegXResourceNameSelection

public void setRegXResourceNameSelection(java.lang.String regXResourceNameSelection)

getRegXResourceNameReplacement

public java.lang.String getRegXResourceNameReplacement()

setRegXResourceNameReplacement

public void setRegXResourceNameReplacement(java.lang.String regXResourceNameReplacement)

getDelimiterCharacter

public java.lang.String getDelimiterCharacter()
Returns the character that is used as the delimiter, this is most usaly the "," and this is the default if not set.

Specified by:
getDelimiterCharacter in interface AbstractResourceStrategy

setDelimiterCharacter

public void setDelimiterCharacter(java.lang.String delimiterCharacter)
Sets the character that is used as the delimiter, this is most usaly the "," and this is the default if not set.

Specified by:
setDelimiterCharacter in interface AbstractResourceStrategy

addResourceMustMatch

public void addResourceMustMatch(java.lang.String mustMatch)

getMustMatchList

public java.util.List getMustMatchList()

setMustMatchList

public void setMustMatchList(java.util.List mustMatchList)

addResourceMustNotMatch

public void addResourceMustNotMatch(java.lang.String mustNotMatch)

getMustNotMatchList

public java.util.List getMustNotMatchList()

setMustNotMatchList

public void setMustNotMatchList(java.util.List mustNotMatchList)

prepareResourceUsageSwitch

public java.lang.String prepareResourceUsageSwitch(Job job)
This function returns a string that represents the resource usage of the job, in such a format that it can be passed to the batch system.

Specified by:
prepareResourceUsageSwitch in interface AbstractResourceStrategy
Parameters:
job - The job from which the resource usage string will be generated.


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