Enum Class MachineEventType

java.lang.Object
java.lang.Enum<MachineEventType>
org.cloudsimplus.traces.google.MachineEventType
All Implemented Interfaces:
Serializable, Comparable<MachineEventType>, Constable

public enum MachineEventType extends Enum<MachineEventType>
Defines the type of an event (a line) in the trace file that represents the operation to be performed with the Host. Each enum instance is a possible value for the MachineEventField.EVENT_TYPE field.

This enum defines a some methods to move the processing logic of each event type to the enum value associated to it. Since the enum includes the process(GoogleMachineEventsTraceReader) abstract method, if a new enum value is added, we just need to implement the method for that value. Using such approach we avoid spreading if chains to check which event type a trace line is to call the corresponding process method.

Since:
CloudSim Plus 4.0.0
Author:
Manoel Campos da Silva Filho
  • Enum Constant Details

    • ADD

      public static final MachineEventType ADD
      0: A Host became available to the cluster - all machines in the trace will have an ADD event.
    • REMOVE

      public static final MachineEventType REMOVE
      1: A Host was removed from the cluster. Removals can occur due to failures or maintenance.
    • UPDATE

      public static final MachineEventType UPDATE
      2: A Host available to the cluster had its available resources changed.
  • Method Details

    • values

      public static MachineEventType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MachineEventType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public static MachineEventType getValue(int ordinal)
      Gets an enum instance from its ordinal value.
      Parameters:
      ordinal - the ordinal value to get the enum instance from
      Returns:
      the enum instance
    • process

      protected abstract boolean process(GoogleMachineEventsTraceReader reader)
      Executes an operation with the Hosts according to the Event Type. Each enum value must implement this method to include its own processing logic.
      Parameters:
      reader - the trace file reader
      Returns:
      true if trace line for the event type was processed, false otherwise