All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.rcsb.mmtf.spark.EntryPoint Maven / Gradle / Ivy

Go to download

MMTF Spark is a series of libraries and functions for using MMTF with Spark.

There is a newer version: 0.0.8
Show newest version
package org.rcsb.mmtf.spark;

import py4j.GatewayServer;
import py4j.Py4JNetworkException;


/**
 * An entry point using Python to access Spark functions.
 * @author Anthony Bradley
 *
 */
public class EntryPoint {

	private SparkUtils sparkUtils;

	/**
	 * Constructor initialises the {@link SparkUtils} class.
	 */
	public EntryPoint() {
		// FIXME - can we get this to work as a Static class.
		sparkUtils = new SparkUtils();
	}

	/**
	 * Ability to get the SparkUtils.
	 * @return an instance of SparkUtils for Python to be used.
	 */
	public SparkUtils getSparkUtils() {
		return sparkUtils;
	}

	/**
	 * Function to set up the gateway server and get it going.
	 * @param args the input arguments
	 */
	public static void main(String[] args) {
		GatewayServer gatewayServer = new GatewayServer(new EntryPoint());
		try{
			gatewayServer.start();
		}
		catch (Py4JNetworkException e){
			System.out.println("Gateway Server Already Started");
			return;
		}
		System.out.println("Gateway Server Started");
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy