be.ac.ua.broker.input.tasks.generation.wm2
Class ComputeInstanceMapper

java.lang.Object
  extended by be.ac.ua.broker.input.tasks.generation.wm2.ComputeInstanceMapper

public class ComputeInstanceMapper
extends java.lang.Object

This class is used to read the mapping from Amazon EC2 supported instance type to the associated number of compute units. This number is used to create a workload load for every task hour of a workload model two task according to the ratios provided by these ECUs.

Author:
Vermeersch Kurt

Field Summary
protected  java.util.Map<java.lang.String,java.lang.Double> fContents
          Mapping from instance type to a number of compute units associated with the instance by EC2
 
Constructor Summary
ComputeInstanceMapper(java.lang.String inputComputeInstanceCSV)
          Constructor for ComputeInstanceMapper
 
Method Summary
 java.lang.Double getNumberOfComputeUnits(java.lang.String instance)
          Getter for the number of compute units associated by EC2 with a given instance type
 void parse()
          Parse the given CSV file and store its contents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fContents

protected java.util.Map<java.lang.String,java.lang.Double> fContents
Mapping from instance type to a number of compute units associated with the instance by EC2

Constructor Detail

ComputeInstanceMapper

public ComputeInstanceMapper(java.lang.String inputComputeInstanceCSV)
Constructor for ComputeInstanceMapper

Parameters:
inputComputeInstanceCSV - the location of the CSV file describing the number of EC2 compute units associated with every instance type supported
Method Detail

parse

public void parse()
Parse the given CSV file and store its contents


getNumberOfComputeUnits

public java.lang.Double getNumberOfComputeUnits(java.lang.String instance)
                                         throws InstanceNotAvailableException,
                                                InvalidInputException
Getter for the number of compute units associated by EC2 with a given instance type

Parameters:
instance - the instance type to get the associated number of compute units for
Returns:
the number of compute units associated by EC2 with a given instance type
Throws:
InstanceNotAvailableException
InvalidInputException