Package org.apache.sysds.api

# Class PythonDMLScript

java.lang.Object
org.apache.sysds.api.PythonDMLScript

public class PythonDMLScript extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`PythonDMLScript.ExitHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`String`
`baseDir`
`HashMap<Integer,BufferedInputStream>`
`fromPython`
`static py4j.GatewayServer`
`GwS`
`HashMap<Integer,BufferedOutputStream>`
`toPython`

## Method Summary

Modifier and Type
Method
Description
`void`
`closePipes()`
`Connection`
`getConnection()`
`static void`
`main(String[] args)`
Entry point for Python API.
`void`
`openPipes(String path, int num)`
`static void`
`resetExitHandler()`
`static void`
`setDMLGateWayListenerLoggerLevel(org.apache.log4j.Level l)`
`static void`
`setExitHandler(PythonDMLScript.ExitHandler handler)`
`void`
`startReadingColFromPipe(int id, FrameBlock fb, int rows, int totalBytes, int col, Types.ValueType type, boolean any)`
`MatrixBlock`
`startReadingMbFromPipe(int id, int rlen, int clen, Types.ValueType type)`
`MatrixBlock`
`startReadingMbFromPipes(int[] blockSizes, int rlen, int clen, Types.ValueType type)`
`void`
`startWritingColToPipe(int id, FrameBlock fb, int col)`
`void`
`startWritingMbToPipe(int id, MatrixBlock mb)`

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

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

## Field Details

### GwS

public static py4j.GatewayServer GwS

### fromPython

public HashMap<Integer,BufferedInputStream> fromPython

### toPython

public HashMap<Integer,BufferedOutputStream> toPython

### baseDir

public String baseDir

## Method Details

### main

public static void main(String[] args) throws Exception
Entry point for Python API.

Parameters:
  `args` - Command line arguments.
Throws:
  `Exception` - Throws exceptions if there is issues in startup or while running.

### setDMLGateWayListenerLoggerLevel

public static void setDMLGateWayListenerLoggerLevel(org.apache.log4j.Level l)

### getConnection

public Connection getConnection()

### openPipes

public void openPipes(String path, int num) throws IOException

Throws:
  `IOException`

### startReadingMbFromPipe

public MatrixBlock startReadingMbFromPipe(int id, int rlen, int clen, Types.ValueType type) throws IOException

Throws:
  `IOException`

### startReadingMbFromPipes

public MatrixBlock startReadingMbFromPipes(int[] blockSizes, int rlen, int clen, Types.ValueType type) throws ExecutionException, InterruptedException

Throws:
  `ExecutionException`
  `InterruptedException`

### startWritingMbToPipe

public void startWritingMbToPipe(int id, MatrixBlock mb) throws IOException

Throws:
  `IOException`

### startReadingColFromPipe

public void startReadingColFromPipe(int id, FrameBlock fb, int rows, int totalBytes, int col, Types.ValueType type, boolean any) throws IOException

Throws:
  `IOException`

### startWritingColToPipe

public void startWritingColToPipe(int id, FrameBlock fb, int col) throws IOException

Throws:
  `IOException`

### closePipes

public void closePipes() throws IOException

Throws:
  `IOException`

### setExitHandler

public static void setExitHandler(PythonDMLScript.ExitHandler handler)

### resetExitHandler

public static void resetExitHandler()