org.apache.sysml.api

Class DMLScript



  • public class DMLScript
    extends Object
    • Field Detail

      • STATISTICS

        public static boolean STATISTICS
      • FINEGRAINED_STATISTICS

        public static boolean FINEGRAINED_STATISTICS
      • STATISTICS_COUNT

        public static int STATISTICS_COUNT
      • STATISTICS_MAX_WRAP_LEN

        public static int STATISTICS_MAX_WRAP_LEN
      • ENABLE_DEBUG_MODE

        public static boolean ENABLE_DEBUG_MODE
      • EXPLAIN

        public static org.apache.sysml.utils.Explain.ExplainType EXPLAIN
      • DML_FILE_PATH_ANTLR_PARSER

        public static String DML_FILE_PATH_ANTLR_PARSER
      • SCRIPT_TYPE

        public static ScriptType SCRIPT_TYPE
        Global variable indicating the script type (DML or PYDML). Can be used for DML/PYDML-specific tasks, such as outputting booleans in the correct case (TRUE/FALSE for DML and True/False for PYDML).
      • USE_ACCELERATOR

        public static boolean USE_ACCELERATOR
      • FORCE_ACCELERATOR

        public static boolean FORCE_ACCELERATOR
      • _suppressPrint2Stdout

        public static boolean _suppressPrint2Stdout
      • USE_LOCAL_SPARK_CONFIG

        public static boolean USE_LOCAL_SPARK_CONFIG
      • _activeAM

        public static boolean _activeAM
      • VALIDATOR_IGNORE_ISSUES

        public static boolean VALIDATOR_IGNORE_ISSUES
        If true, allow DMLProgram to be generated while not halting due to validation errors/warnings
      • _uuid

        public static String _uuid
    • Constructor Detail

      • DMLScript

        public DMLScript()
    • Method Detail

      • getUUID

        public static String getUUID()
      • setUUID

        public static void setUUID(String uuid)
        Used to set master UUID on all nodes (in parfor remote_mr, where DMLScript passed) in order to simplify cleanup of scratch_space and local working dirs.
        Parameters:
        uuid - master UUID to set on all nodes
      • suppressPrint2Stdout

        public static boolean suppressPrint2Stdout()
      • setActiveAM

        public static void setActiveAM()
      • isActiveAM

        public static boolean isActiveAM()
      • parseCLArguments

        public static DMLScript.DMLOptions parseCLArguments(String[] args,
                                                            org.apache.commons.cli.Options options)
                                                     throws org.apache.commons.cli.ParseException
        Parses command line arguments to create a DMLScript.DMLOptions instance with the correct options
        Parameters:
        args - arguments from the command line
        options - an Options instance containing the options that need to be parsed
        Returns:
        an instance of Options that contain the correct Options.
        Throws:
        org.apache.commons.cli.ParseException - if there is an incorrect option specified in the CLI
      • createCLIOptions

        public static org.apache.commons.cli.Options createCLIOptions()
        Creates an Options instance for the command line parameters As of SystemML 0.13, Apache Commons CLI 1.2 is transitively in the classpath However the most recent version of Apache Commons CLI is 1.4 Creating CLI options is done using Static methods. This obviously makes it thread unsafe. Instead of OptionBuilder, CLI 1.4 uses Option.Builder which has non-static methods.
        Returns:
        an appropriate instance of Options
      • executeScript

        public static boolean executeScript(org.apache.hadoop.conf.Configuration conf,
                                            String[] args)
                                     throws DMLException
        Single entry point for all public invocation alternatives (e.g., main, executeScript, JaqlUdf etc)
        Parameters:
        conf - Hadoop configuration
        args - arguments
        Returns:
        true if success, false otherwise
        Throws:
        DMLException - if DMLException occurs
        org.apache.sysml.parser.ParseException - if ParseException occurs
      • readDMLScript

        protected static String readDMLScript(boolean isFile,
                                              String scriptOrFilename)
                                       throws IOException,
                                              org.apache.sysml.parser.LanguageException
        Reads the DML/PyDML script into a String
        Parameters:
        isFile - Whether the string argument is a path to a file or the script itself
        scriptOrFilename - script or filename
        Returns:
        a string representation of the script
        Throws:
        IOException - if error
        org.apache.sysml.parser.LanguageException - if error
      • cleanupHadoopExecution

        public static void cleanupHadoopExecution(org.apache.sysml.conf.DMLConfig config)
                                           throws IOException,
                                                  org.apache.sysml.parser.ParseException
        Throws:
        IOException
        org.apache.sysml.parser.ParseException

Copyright © 2017 The Apache Software Foundation. All rights reserved.