Difference between revisions of "Statistical Algorithms Importer: Java Project"

From Gcube Wiki
Jump to: navigation, search
(Example Code)
Line 3: Line 3:
 
|}
 
|}
 
   
 
   
:This page explains how to create a Java project using the Statistical Algorithms Importer (SAI) portlet.
+
This page explains how to create a Java project using the Statistical Algorithms Importer (SAI) portlet with two approaches.
 +
 
 +
Two approaches are possible: '''Black-box''' and '''White-box''' integration. The next sections explain how they work and which cases these two ways address.
 +
 
 +
=Black Box Integration=
 +
 
 
[[Image:StatisticalAlgorithmsImporter_JavaBlackBox0.png|thumb|center|250px|Java Project, SAI]]
 
[[Image:StatisticalAlgorithmsImporter_JavaBlackBox0.png|thumb|center|250px|Java Project, SAI]]
 +
 +
This is the preferred way for developers who want their processes distributed based on the load of requests. Each process request will run on one dedicated machine. Black box processed usually do not use the e-Infrastructure resources but live on their own.
  
 
==Project Configuration==
 
==Project Configuration==
Line 57: Line 64:
 
  {{Reflist}} -->
 
  {{Reflist}} -->
  
 +
=White Box Integration=
 +
This is the preferred way for developers who want their processes to fully exploit the e-Infrastructure resources, for example to implement Cloud computing using the e-Infrastructure computational resources. This integration modality allows also to fully reuse the Java data mining frameworks integrated by DataMiner, i.e. [https://www.knime.com/ Knime], [https://rapidminer.com/ RapidMiner], [https://www.cs.waikato.ac.nz/ml/weka/ Weka], [https://wiki.gcube-system.org/gcube/Statistical_Manager_Algorithms gCube EcologicalEngine].
  
 +
[https://gcube.wiki.gcube-system.org/gcube/How-to_Implement_Algorithms_for_DataMiner Step-by-step guide to integrate Java processes as white boxes]
 
<!--
 
<!--
 
[[Template:Statistical Algorithms Importer]]  
 
[[Template:Statistical Algorithms Importer]]  

Revision as of 16:41, 24 November 2017

This page explains how to create a Java project using the Statistical Algorithms Importer (SAI) portlet with two approaches.

Two approaches are possible: Black-box and White-box integration. The next sections explain how they work and which cases these two ways address.

Black Box Integration

Java Project, SAI

This is the preferred way for developers who want their processes distributed based on the load of requests. Each process request will run on one dedicated machine. Black box processed usually do not use the e-Infrastructure resources but live on their own.

Project Configuration

Define project's metadata
Java Info, SAI
Add input and output parameters and click on "Set Code" to indicate the main file to execute (i.e. the .jar file)
Java I/O, SAI
Add information about the running environment (e.g. Java version etc.)
Java Interpreter, SAI
After the software creation phase a Main.R file and a Taget folder are created
Java Create, SAI

Example Code

Java code in sample:
/**
 * 
 * @author Giancarlo Panichi
 * 
 *
 */
import java.io.File;
import java.io.FileWriter;
 
public class SimpleProducer
{
  public static void main(String[] args)
  {
    try
    {
      FileWriter fw = new FileWriter(new File("program.txt"));
      fw.write("Check: " + args[0]);
      fw.close();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}

Example Download

File:JavaBlackBox.zip


White Box Integration

This is the preferred way for developers who want their processes to fully exploit the e-Infrastructure resources, for example to implement Cloud computing using the e-Infrastructure computational resources. This integration modality allows also to fully reuse the Java data mining frameworks integrated by DataMiner, i.e. Knime, RapidMiner, Weka, gCube EcologicalEngine.

Step-by-step guide to integrate Java processes as white boxes