Return-Path:
After installing these tools, make sure that the directories containing the executable files are in your PATH environment variable. Confirm by running the following commands and comparing with output that show in the table below: The build should create the application package file To run unit tests on Linux or OSX, simply run the usual maven command, for example: On Windows, an additional file, Set the If you prefer not to set the variable globally, you can set it on the command line or within
+your IDE. For example, on the command line, specify the maven
+property or set the environment variable separately: Within your IDE, set the environment variable and then run the desired
+unit test in the usual way. For example, with NetBeans you can add: at Properties ⇒ Actions ⇒ Run project ⇒ Set Properties. Similarly, in Eclipse (Mars) add it to the
+project properties at Properties ⇒ Run/Debug Settings ⇒ ApplicationTest
+⇒ Environment tab. If you want to see more substantial Apex demo applications and the associated source code, you can follow these simple steps to check out and build them.
-
echo %PATH%
to see the value of the PATH
variable and verify that the above directories for Java, git, and maven executables are present. JDK executables like java and javac, the directory might be something like C:\\Program Files\\Java\\jdk1.7.0\_80\\bin
; for git it might be C:\\Program Files\\Git\\bin
; and for maven it might be C:\\Users\\user\\Software\\apache-maven-3.3.3\\bin
. If not, you can change its value clicking on the button at Control Panel ⇨ Advanced System Settings ⇨ Advanced tab ⇨ Environment Variables.echo %PATH%
to see the value of the PATH
variable and verify that the above directories for Java, git, and maven executables are present. JDK executables like java and javac, the directory might be something like C:\Program Files\Java\jdk1.7.0\_80\bin
; for git it might be C:\Program Files\Git\bin
; and for maven it might be C:\Users\user\Software\apache-maven-3.3.3\bin
. If not, you can change its value clicking on the button at Control Panel ⇨ Advanced System Settings ⇨ Advanced tab ⇨ Environment Variables.echo $PATH
to see the value of the PATH
variable and verify that the above directories for Java, git, and maven executables are present. If not, make sure software is downloaded and installed, and optionally PATH reference is added and exported in a ~/.profile
or ~/.bash_profile
. For example to add maven located in /sfw/maven/apache-maven-3.3.3
to PATH add the line: export PATH=$PATH:/sfw/maven/apache-maven-3.3.3/bin
myapexapp/target/myapexapp-1.0-SNAPSHOT.apa
. This application package can then be used to launch example application via dtCli, or other visual management tools. When running, this application will generate a stream of random numbers and print them out, each prefixed by the string hello world:
.Running Unit Tests
+mvn test
.winutils.exe
, is required; download it from
+https://github.com/srccodes/hadoop-common-2.2.0-bin/archive/master.zip
+and unpack the archive to, say, C:\hadoop
; this file should be present under
+hadoop-common-2.2.0-bin-master\bin
within it.HADOOP_HOME
environment variable system-wide to
+c:\hadoop\hadoop-common-2.2.0-bin-master
as described at:
+https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true. You should now be able to run unit tests normally.hadoop.home.dir
:
+mvn -Dhadoop.home.dir=c:\hadoop\hadoop-common-2.2.0-bin-master test
+
+set HADOOP_HOME=c:\hadoop\hadoop-common-2.2.0-bin-master
+mvn test
+
+Env.HADOOP_HOME=c:/hadoop/hadoop-common-2.2.0-bin-master
+
Building Apex Demos
http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/8c7220af/docs/apex-3.3/application_development/index.html
----------------------------------------------------------------------
diff --git a/docs/apex-3.3/application_development/index.html b/docs/apex-3.3/application_development/index.html
index b7b3faa..802a2c7 100644
--- a/docs/apex-3.3/application_development/index.html
+++ b/docs/apex-3.3/application_development/index.html
@@ -109,6 +109,8 @@
Dtcli can run the application in local mode (i.e. outside a @@ -1240,8 +1239,49 @@ DAG in local mode within the IDE.
} -The platform also supports specification of a DAG via a property +
In addition to Java, you can also specify the DAG using JSON, provided the operators in the DAG are present in the dependency jars. Create src/main/resources/app directory under your app package project, and put your JSON files there. This is the specification of a JSON file that specifies an application.
+Create a json file under src/main/resources/app, For example myApplication.json
{
+ "description": "{application description}",
+ "operators": [
+ {
+ "name": "{operator name}",
+ "class": "{fully qualified class name of the operator}",
+ "properties": {
+ "{property key}": "{property value}",
+ ...
+ }
+ }, ...
+ ],
+ "streams": [
+ {
+ "name": "{stream name}",
+ "source": {
+ "operatorName": "{source operator name}",
+ "portName": "{source operator output port name}"
+ }
+ "sinks": [
+ {
+ "operatorName": "{sink operator name}",
+ "portName": "{sink operator input port name}"
+ }, ...
+ ]
+ }, ...
+ ]
+}
+
+
+
+description
field is the description of the application and is optional.operators
field is the list of operators the application has. You can specifiy the name, the Java class, and the properties of each operator here.streams
field is the list of streams that connects the operators together to form the DAG. Each stream consists of the stream name, the operator and port that it connects from, and the list of operators and ports that it connects to. Note that you can connect from one output port of an operator to multiple different input ports of different operators.In Apex Malhar, there is an example in the Pi Demo doing just that.
+The platform also supports specification of a DAG via a properties file. The aim here to make it easy for tools to create and run an application. This method of specification does not have the Java compiler support of compile time check, but since these applications @@ -1249,7 +1289,8 @@ would be created by software, they should be correct by construction. The syntax is derived from Hadoop properties and should be easy for folks who are used to creating software that integrated with Hadoop.
-Create an application (DAG): myApplication.properties
+Under the src/main/resources/app directory (create if it doesn't exist), create a properties file.
+For example myApplication.properties
# input operator that reads from a file
dt.operator.inputOp.classname=com.acme.SampleInputOperator
dt.operator.inputOp.fileName=somefile.txt
@@ -1263,7 +1304,7 @@ dt.stream.inputStream.sinks=outputOp.inputPort
Above snippet is intended to convey the basic idea of specifying -the DAG without using Java. Operators would come from a predefined +the DAG using properties file. Operators would come from a predefined library and referenced in the specification by class name and port names (obtained from the library providers documentation or runtime introspection by tools). For those interested in details, see later http://git-wip-us.apache.org/repos/asf/incubator-apex-site/blob/8c7220af/docs/apex-3.3/application_packages/index.html ---------------------------------------------------------------------- diff --git a/docs/apex-3.3/application_packages/index.html b/docs/apex-3.3/application_packages/index.html index cd0eea7..faae829 100644 --- a/docs/apex-3.3/application_packages/index.html +++ b/docs/apex-3.3/application_packages/index.html @@ -271,7 +271,7 @@ Apex installation.
Artifact ID: apex-app-archetype Version: 3.2.0-incubating (or any later version)Please refer to the Creating Apps on the basics on how to write an Apache Apex application. In your AppPackage project, you can add custom operators (refer to Operator Development Guide, project dependencies, default and required configuration properties, pre-set configurations and other metadata.
+Please refer to the [Application Developer Guide][application_development.md] on the basics on how to write an Apache Apex application. In your AppPackage project, you can add custom operators (refer to Operator Development Guide, project dependencies, default and required configuration properties, pre-set configurations and other metadata. Note that you can also specify the DAG using Java, JSON or properties files.
Under the project, you can add project dependencies in pom.xml, or do it through your IDE. Here’s the section that describes the dependencies in @@ -595,7 +595,7 @@ that file is only used for the unit test.
Apache Apex Application Package files are zip files. You can examine the content of any Application Package by using unzip -t on your Linux command line.
There are four top level directories in an Application Package: