Class MetricUtils


  • public final class MetricUtils
    extends java.lang.Object
    Utility class for metrics. TODO #372: This class should later be refactored into a separate metric package.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Optional<java.lang.reflect.Method> getMethodFor​(java.lang.Class<? extends ExecutionProperty> clazz, java.lang.String name, java.lang.Class<?>... valueTypes)
      Utility method to getting an optional method called 'name' for the class.
      static ExecutionProperty<? extends java.io.Serializable> keyAndValueToEP​(java.lang.Integer epKeyIndex, java.lang.Double split, java.lang.Double tweak)
      Receives the pair of execution property and value classes, and returns the optimized value of the EP.
      static java.lang.Boolean loadMetaData()
      Load the BiMaps (lightweight) Metadata from the DB.
      static java.lang.Boolean metaDataLoaded()  
      static Pair<java.lang.String,​java.lang.String> stringifyIRDAGProperties​(IRDAG irdag)
      Stringify execution properties of an IR DAG.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SQLITE_DB_NAME

        public static final java.lang.String SQLITE_DB_NAME
      • POSTGRESQL_METADATA_DB_NAME

        public static final java.lang.String POSTGRESQL_METADATA_DB_NAME
        See Also:
        Constant Field Values
    • Method Detail

      • loadMetaData

        public static java.lang.Boolean loadMetaData()
        Load the BiMaps (lightweight) Metadata from the DB.
        Returns:
        Whether or not the metadata has been successfully loaded from the DB.
      • metaDataLoaded

        public static java.lang.Boolean metaDataLoaded()
      • stringifyIRDAGProperties

        public static Pair<java.lang.String,​java.lang.String> stringifyIRDAGProperties​(IRDAG irdag)
        Stringify execution properties of an IR DAG.
        Parameters:
        irdag - IR DAG to observe.
        Returns:
        the pair of stringified execution properties. Left is for vertices, right is for edges.
      • getMethodFor

        public static java.util.Optional<java.lang.reflect.Method> getMethodFor​(java.lang.Class<? extends ExecutionProperty> clazz,
                                                                                java.lang.String name,
                                                                                java.lang.Class<?>... valueTypes)
        Utility method to getting an optional method called 'name' for the class.
        Parameters:
        clazz - class to get the method of.
        name - the name of the method.
        valueTypes - the value types of the method.
        Returns:
        optional of the method. It returns Optional.empty() if the method could not be found.
      • keyAndValueToEP

        public static ExecutionProperty<? extends java.io.Serializable> keyAndValueToEP​(java.lang.Integer epKeyIndex,
                                                                                        java.lang.Double split,
                                                                                        java.lang.Double tweak)
        Receives the pair of execution property and value classes, and returns the optimized value of the EP.
        Parameters:
        epKeyIndex - the EP Key index to retrieve the new EP from.
        split - the split point.
        tweak - the direction in which to tweak the execution property value.
        Returns:
        The execution property constructed from the key index and the split value.