Class ResourceCompiler


  • public class ResourceCompiler
    extends Object
    This class does full or partial program recompilation based on given runtime program. It uses the methods provided by hops.recompile.Recompiler). It keeps a state of the current recompilation phase in order to decide when to do full recompilation and when not.
    • Constructor Detail

      • ResourceCompiler

        public ResourceCompiler()
    • Method Detail

      • doFullRecompilation

        public static Program doFullRecompilation​(Program program)
        Recompiling a given program for resource optimization. This method should always be called after setting the target resources to InfrastructureAnalyzer and SparkExecutionContext
        Parameters:
        program - program to be recompiled
        Returns:
        the recompiled program as a new Program instance
      • setSingleNodeResourceConfigs

        public static void setSingleNodeResourceConfigs​(long nodeMemory,
                                                        int nodeCores)
        Sets resource configurations for executions in single-node mode including the hardware configurations for the node running the CP.
        Parameters:
        nodeMemory - memory budget for the node running CP
        nodeCores - number of CPU cores for the node running CP
      • setSparkClusterResourceConfigs

        public static void setSparkClusterResourceConfigs​(long driverMemory,
                                                          int driverCores,
                                                          int numExecutors,
                                                          long executorMemory,
                                                          int executorCores)
        Sets resource configurations for executions in hybrid mode including the hardware configurations for the node running the CP and the worker nodes running Spark executors
        Parameters:
        driverMemory - memory budget for the node running CP
        driverCores - number of CPU cores for the node running CP
        numExecutors - number of nodes in cluster
        executorMemory - memory budget for the nodes running executors
        executorCores - number of CPU cores for the nodes running executors