Policy (cloudsim 3.1-SNAPSHOT API)

org.cloudbus.cloudsim.workflow

## Class Policy

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.cloudbus.cloudsim.workflow.Policy

- All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler
  Direct Known Subclasses:
    BaselinePolicy, DvfsPolicy, DvfsPolicy_2, TestPolicy

      public abstract class Policy
      extends org.xml.sax.helpers.DefaultHandler

  This class implements the abstract policy for provisioning and scheduling of a DAG in an IaaS data center. This method performs common tasks such as parsing the XML file describing the DAG, printing the schedule, and returning provisioning and scheduling decisions to the Workflow Engine. The abstract method must implement the logic for filling the data structures related to provisioning and scheduling decisions.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `modedvfs`
    `protected boolean` | `optimizeScheduling`
    `protected int` | `ownerId`
    `protected VMOffers` | `vmOffers`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Policy()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `doScheduling(long availableExecTime, VMOffers vmOffers)` Fills the provisioning and scheduling data structures that are supplied to the Workflow Engine.
    `void` | `endDocument()`
    `Hashtable<Integer,HashSet<Integer>>` | `getDataRequiredLocation()` Determines the VMs where each dataItem will be required.
    `ArrayList<ProvisionedVm>` | `getProvisioning()` Returns the list of required VMs (number, characteristics, start and end times)
    `Hashtable<Integer,ArrayList<Task>>` | `getScheduling()` Determines the ordering of Tasks execution inside each VM.
    `void` | `printScheduling(long scheduleTime)`
    `void` | `processDagFile(String dagFile, int ownerId, long availableExecTime, long baseMIPS, VMOffers vmOffers)` Reads the file specified as input, and processes the corresponding DAG, generating internal representation of provisioning and scheduling decision.
    `void` | `startDocument()`
    `void` | `startElement(String uri, String localName, String qName, Attributes attributes)`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `characters, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ownerId

          protected int ownerId

    - #### vmOffers

          protected VMOffers vmOffers

    - #### optimizeScheduling

          protected boolean optimizeScheduling

    - #### modedvfs

          protected String modedvfs

  - ### Constructor Detail

    - #### Policy

          public Policy()

  - ### Method Detail

    - #### doScheduling

          public abstract void doScheduling(long availableExecTime,
                          VMOffers vmOffers)

      Fills the provisioning and scheduling data structures that are supplied to the Workflow Engine.
      Parameters:
        `availableExecTime` - time before the deadline
        `vmOffers` - the VMOffers object that encapsulates information on available IaaS instances

    - #### processDagFile

          public void processDagFile(String dagFile,
                            int ownerId,
                            long availableExecTime,
                            long baseMIPS,
                            VMOffers vmOffers)

      Reads the file specified as input, and processes the corresponding DAG, generating internal representation of provisioning and scheduling decision. WorkflowEngine queries for such an information to process the DAG.
      Parameters:
        `dagFile` - Name of the DAG file.

    - #### getDataRequiredLocation

          public Hashtable<Integer,HashSet<Integer>> getDataRequiredLocation()

      Determines the VMs where each dataItem will be required.
      Returns:
        A hashtable containing each registered dataItem and the list of VMs ids where they are required.

    - #### getScheduling

          public Hashtable<Integer,ArrayList<Task>> getScheduling()

      Determines the ordering of Tasks execution inside each VM.
      Returns:
        A hashtable containing each VM and the list of Tasks, in execution order, in such VM.

    - #### getProvisioning

          public ArrayList<ProvisionedVm> getProvisioning()

      Returns the list of required VMs (number, characteristics, start and end times)

    - #### printScheduling

          public void printScheduling(long scheduleTime)

    - #### startDocument

          public void startDocument()

      Specified by:
        `startDocument` in interface `ContentHandler`
      Overrides:
        `startDocument` in class `org.xml.sax.helpers.DefaultHandler`

    - #### startElement

          public void startElement(String uri,
                          String localName,
                          String qName,
                          Attributes attributes)

      Specified by:
        `startElement` in interface `ContentHandler`
      Overrides:
        `startElement` in class `org.xml.sax.helpers.DefaultHandler`

    - #### endDocument

          public void endDocument()

      Specified by:
        `endDocument` in interface `ContentHandler`
      Overrides:
        `endDocument` in class `org.xml.sax.helpers.DefaultHandler`

Copyright © 2013 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.