org.apache.uima.ducc.rm.scheduler
Class ResourceClass

java.lang.Object
  extended by org.apache.uima.ducc.rm.scheduler.ResourceClass
All Implemented Interfaces:
SchedConstants

public class ResourceClass
extends Object
implements SchedConstants

This represents a priority class.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.uima.ducc.rm.scheduler.SchedConstants
SchedConstants.EvictionPolicy, SchedConstants.Policy
 
Field Summary
 
Fields inherited from interface org.apache.uima.ducc.rm.scheduler.SchedConstants
COMPONENT_NAME, DEFAULT_INIT_STABILITY_COUNT, DEFAULT_INSTANCES, DEFAULT_MAX_INSTANCES, DEFAULT_MAX_PROCESSES, DEFAULT_NODE_METRICS_RATE, DEFAULT_PRIORITY, DEFAULT_PROCESSES, DEFAULT_SCHEDULING_RATE, DEFAULT_SCHEDULING_RATIO, DEFAULT_SHARE_WEIGHT, DEFAULT_STABILITY_COUNT
 
Constructor Summary
ResourceClass(org.apache.uima.ducc.common.utils.DuccProperties props)
           
 
Method Summary
 int calculateCap(int order, int basis)
           
 void clearShares()
           
 boolean enforceMemory()
           
 int getAbsoluteCap()
           
 Comparator<org.apache.uima.ducc.rm.scheduler.IEntity> getApportionmentSorter()
           
static String getDashes()
           
 int getEffectiveWeight(int order)
          Return my share weight, if I have any jobs of the given order or less.
 int[] getGivenByOrder()
           
static String getHeader()
           
 int getInitializationCap()
           
 int getMaxMachines()
           
 int getMaxProcesses()
           
 int getMinShares()
           
 String getName()
          public String getId() { return id; }
 double getPercentCap()
           
 SchedConstants.Policy getPolicy()
           
 long getPredictionFudge()
           
 int getPriority()
           
 int getPureFairShare()
           
 int getShareWeight()
           
 long getTimestamp()
           
 int getTrueCap()
           
 int[] getWantedByOrder()
           
 int hashCode()
           
 boolean hasSharesGiven()
          int[] getSharesByOrder(int asize) { int[] answer = new int[asize]; for ( int i = 0; i < asize; i++ ) { if ( nSharesByOrder.containsKey(i) ) { answer[i] = nSharesByOrder.get(i); } else { answer[i] = 0; } } return answer; }
 void initWantedByOrder(ResourceClass unused)
           
 boolean isExpandByDoubling()
           
 boolean isUsePrediction()
           
 void markSubpoolCounted()
           
 void setExpandByDoubling(boolean ebd)
           
 void setGivenByOrder(int[] gbo)
           
 void setInitializationCap(int c)
           
 void setPureFairShare(int pfs)
           
 void setTrueCap(int cap)
           
 String toString()
           
 String toStringWithHeader()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceClass

public ResourceClass(org.apache.uima.ducc.common.utils.DuccProperties props)
Method Detail

getTimestamp

public long getTimestamp()

setPureFairShare

public void setPureFairShare(int pfs)

getPureFairShare

public int getPureFairShare()

isExpandByDoubling

public boolean isExpandByDoubling()

setExpandByDoubling

public void setExpandByDoubling(boolean ebd)

getInitializationCap

public int getInitializationCap()

setInitializationCap

public void setInitializationCap(int c)

isUsePrediction

public boolean isUsePrediction()

getPredictionFudge

public long getPredictionFudge()

enforceMemory

public boolean enforceMemory()

getPolicy

public SchedConstants.Policy getPolicy()

setTrueCap

public void setTrueCap(int cap)

getTrueCap

public int getTrueCap()

getPercentCap

public double getPercentCap()

getAbsoluteCap

public int getAbsoluteCap()

getMaxProcesses

public int getMaxProcesses()

getMinShares

public int getMinShares()

getMaxMachines

public int getMaxMachines()

getName

public String getName()
public String getId() { return id; }


getShareWeight

public int getShareWeight()

getEffectiveWeight

public int getEffectiveWeight(int order)
Return my share weight, if I have any jobs of the given order or less. If not, return 0;


getPriority

public int getPriority()

clearShares

public void clearShares()

markSubpoolCounted

public void markSubpoolCounted()

initWantedByOrder

public void initWantedByOrder(ResourceClass unused)

getWantedByOrder

public int[] getWantedByOrder()

getGivenByOrder

public int[] getGivenByOrder()

setGivenByOrder

public void setGivenByOrder(int[] gbo)

calculateCap

public int calculateCap(int order,
                        int basis)

hasSharesGiven

public boolean hasSharesGiven()
int[] getSharesByOrder(int asize) { int[] answer = new int[asize]; for ( int i = 0; i < asize; i++ ) { if ( nSharesByOrder.containsKey(i) ) { answer[i] = nSharesByOrder.get(i); } else { answer[i] = 0; } } return answer; }


getDashes

public static String getDashes()

getHeader

public static String getHeader()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toStringWithHeader

public String toStringWithHeader()

getApportionmentSorter

public Comparator<org.apache.uima.ducc.rm.scheduler.IEntity> getApportionmentSorter()


Copyright © 2012–2014 The Apache Software Foundation. All rights reserved.