org.apache.sysds.utils

## Class MLContextProxy

- java.lang.Object
- - org.apache.sysds.utils.MLContextProxy

-     public class MLContextProxy
      extends Object

  The purpose of this proxy is to shield systemds internals from direct access to MLContext which would try to load spark libraries and hence fail if these are not available. This indirection is much more efficient than catching NoClassDefFoundErrors for every access to MLContext (e.g., on each recompile).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MLContextProxy()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MLContext` | `getActiveMLContext()`
    `static MLContext` | `getActiveMLContextForAPI()`
    `static boolean` | `isActive()`
    `static void` | `setActive(boolean flag)`
    `static void` | `setAppropriateVarsForRead(Expression source, String targetname)`

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

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

- - ### Constructor Detail

    - #### MLContextProxy

          public MLContextProxy()

  - ### Method Detail

    - #### setActive

          public static void setActive(boolean flag)

    - #### isActive

          public static boolean isActive()

    - #### setAppropriateVarsForRead

          public static void setAppropriateVarsForRead(Expression source,
                                                       String targetname)

    - #### getActiveMLContext

          public static MLContext getActiveMLContext()

    - #### getActiveMLContextForAPI

          public static MLContext getActiveMLContextForAPI()

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