You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by th...@apache.org on 2016/12/07 06:40:42 UTC

[13/13] apex-site git commit: from 82d6a98a7d7b5af51bc8302d0b0aa6ddf7ab5731

from 82d6a98a7d7b5af51bc8302d0b0aa6ddf7ab5731


Project: http://git-wip-us.apache.org/repos/asf/apex-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/apex-site/commit/2189ef54
Tree: http://git-wip-us.apache.org/repos/asf/apex-site/tree/2189ef54
Diff: http://git-wip-us.apache.org/repos/asf/apex-site/diff/2189ef54

Branch: refs/heads/asf-site
Commit: 2189ef544a29864e7dd15231a6b0fd179701096d
Parents: 0d1e657
Author: Thomas Weise <th...@apache.org>
Authored: Tue Dec 6 22:38:36 2016 -0800
Committer: Thomas Weise <th...@apache.org>
Committed: Tue Dec 6 22:38:36 2016 -0800

----------------------------------------------------------------------
 content/docs/apex-3.5/__init__.py               |    0
 content/docs/apex-3.5/__init__.pyc              |  Bin 0 -> 163 bytes
 content/docs/apex-3.5/apex_cli/index.html       |  481 ++++
 .../apex-3.5/apex_development_setup/index.html  |  379 +++
 .../apex-3.5/application_development/index.html | 2684 ++++++++++++++++++
 .../apex-3.5/application_packages/index.html    |  800 ++++++
 content/docs/apex-3.5/autometrics/index.html    |  406 +++
 content/docs/apex-3.5/base.html                 |  118 +
 content/docs/apex-3.5/breadcrumbs.html          |   25 +
 content/docs/apex-3.5/compatibility/index.html  |  294 ++
 content/docs/apex-3.5/css/highlight.css         |  124 +
 content/docs/apex-3.5/css/theme.css             |   12 +
 content/docs/apex-3.5/css/theme_extra.css       |  154 +
 .../development_best_practices/index.html       |  376 +++
 content/docs/apex-3.5/favicon.ico               |  Bin 0 -> 25597 bytes
 .../docs/apex-3.5/fonts/fontawesome-webfont.eot |  Bin 0 -> 37405 bytes
 .../docs/apex-3.5/fonts/fontawesome-webfont.svg |  399 +++
 .../docs/apex-3.5/fonts/fontawesome-webfont.ttf |  Bin 0 -> 79076 bytes
 .../apex-3.5/fonts/fontawesome-webfont.woff     |  Bin 0 -> 43572 bytes
 content/docs/apex-3.5/footer.html               |   23 +
 content/docs/apex-3.5/images/apex_logo.png      |  Bin 0 -> 35621 bytes
 .../ApplicationDeveloperGuide.html-image00.png  |  Bin 0 -> 30204 bytes
 .../ApplicationDeveloperGuide.html-image01.png  |  Bin 0 -> 44041 bytes
 .../ApplicationDeveloperGuide.html-image02.png  |  Bin 0 -> 21927 bytes
 .../ApplicationDeveloperGuide.html-image03.png  |  Bin 0 -> 66578 bytes
 .../ApplicationDeveloperGuide.html-image04.png  |  Bin 0 -> 47909 bytes
 .../ApplicationDeveloperGuide.html-image05.png  |  Bin 0 -> 40228 bytes
 .../ApplicationDeveloperGuide.html-image06.png  |  Bin 0 -> 37807 bytes
 .../ApplicationDeveloperGuide.html-image07.png  |  Bin 0 -> 38504 bytes
 .../ApplicationDeveloperGuide.html-image08.png  |  Bin 0 -> 29070 bytes
 .../ApplicationDeveloperGuide.html-image09.png  |  Bin 0 -> 47030 bytes
 .../docs/apex-3.5/images/operator/image00.png   |  Bin 0 -> 19541 bytes
 .../docs/apex-3.5/images/operator/image01.png   |  Bin 0 -> 25962 bytes
 .../docs/apex-3.5/images/operator/image02.png   |  Bin 0 -> 26407 bytes
 .../docs/apex-3.5/images/operator/image03.png   |  Bin 0 -> 9465 bytes
 .../docs/apex-3.5/images/operator/image04.png   |  Bin 0 -> 14620 bytes
 .../docs/apex-3.5/images/operator/image05.png   |  Bin 0 -> 6227 bytes
 .../docs/apex-3.5/images/security/image00.png   |  Bin 0 -> 31624 bytes
 .../docs/apex-3.5/images/security/image02.png   |  Bin 0 -> 18082 bytes
 .../docs/apex-3.5/images/security/image03.png   |  Bin 0 -> 18677 bytes
 content/docs/apex-3.5/img/favicon.ico           |  Bin 0 -> 1150 bytes
 content/docs/apex-3.5/index.html                |  243 ++
 content/docs/apex-3.5/js/highlight.pack.js      |    2 +
 content/docs/apex-3.5/js/jquery-2.1.1.min.js    |    4 +
 content/docs/apex-3.5/js/modernizr-2.8.3.min.js |    1 +
 content/docs/apex-3.5/js/theme.js               |   55 +
 content/docs/apex-3.5/main.html                 |   10 +
 .../docs/apex-3.5/mkdocs/js/lunr-0.5.7.min.js   |    7 +
 content/docs/apex-3.5/mkdocs/js/lunr.min.js     |    7 +
 content/docs/apex-3.5/mkdocs/js/mustache.min.js |    1 +
 content/docs/apex-3.5/mkdocs/js/require.js      |   36 +
 .../mkdocs/js/search-results-template.mustache  |    4 +
 content/docs/apex-3.5/mkdocs/js/search.js       |   88 +
 content/docs/apex-3.5/mkdocs/js/text.js         |  390 +++
 content/docs/apex-3.5/mkdocs/search_index.json  | 1124 ++++++++
 .../apex-3.5/operator_development/index.html    |  666 +++++
 content/docs/apex-3.5/search.html               |  214 ++
 content/docs/apex-3.5/searchbox.html            |    5 +
 content/docs/apex-3.5/security/index.html       |  428 +++
 content/docs/apex-3.5/sitemap.xml               |   76 +
 content/docs/apex-3.5/toc.html                  |   23 +
 content/docs/apex-3.5/versions.html             |   15 +
 62 files changed, 9674 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/apex-site/blob/2189ef54/content/docs/apex-3.5/__init__.py
----------------------------------------------------------------------
diff --git a/content/docs/apex-3.5/__init__.py b/content/docs/apex-3.5/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/apex-site/blob/2189ef54/content/docs/apex-3.5/__init__.pyc
----------------------------------------------------------------------
diff --git a/content/docs/apex-3.5/__init__.pyc b/content/docs/apex-3.5/__init__.pyc
new file mode 100644
index 0000000..5d767d8
Binary files /dev/null and b/content/docs/apex-3.5/__init__.pyc differ

http://git-wip-us.apache.org/repos/asf/apex-site/blob/2189ef54/content/docs/apex-3.5/apex_cli/index.html
----------------------------------------------------------------------
diff --git a/content/docs/apex-3.5/apex_cli/index.html b/content/docs/apex-3.5/apex_cli/index.html
new file mode 100644
index 0000000..1b0f18a
--- /dev/null
+++ b/content/docs/apex-3.5/apex_cli/index.html
@@ -0,0 +1,481 @@
+<!DOCTYPE html>
+<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  
+  
+  
+  <title>Apex CLI - Apache Apex Documentation</title>
+  
+
+  <link rel="shortcut icon" href="../favicon.ico">
+  
+
+  
+  <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
+
+  <link rel="stylesheet" href="../css/theme.css" type="text/css" />
+  <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
+  <link rel="stylesheet" href="../css/highlight.css">
+
+  
+  <script>
+    // Current page data
+    var mkdocs_page_name = "Apex CLI";
+    var mkdocs_page_input_path = "apex_cli.md";
+    var mkdocs_page_url = "/apex_cli/";
+  </script>
+  
+  <script src="../js/jquery-2.1.1.min.js"></script>
+  <script src="../js/modernizr-2.8.3.min.js"></script>
+  <script type="text/javascript" src="../js/highlight.pack.js"></script>
+  <script src="../js/theme.js"></script> 
+
+  
+</head>
+
+<body class="wy-body-for-nav" role="document">
+
+  <div class="wy-grid-for-nav">
+
+    
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
+      <div class="wy-side-nav-search">
+        <a href=".." class="icon icon-home"> Apache Apex Documentation</a>
+        <div role="search">
+  <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
+    <input type="text" name="q" placeholder="Search docs" />
+  </form>
+</div>
+      </div>
+
+      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
+        <ul class="current">
+          
+            <li>
+    <li class="toctree-l1 ">
+        <a class="" href="..">Apache Apex</a>
+        
+    </li>
+<li>
+          
+            <li>
+    <ul class="subnav">
+    <li><span>Development</span></li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../apex_development_setup/">Development Setup</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../application_development/">Applications</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../application_packages/">Packages</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../operator_development/">Operators</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../autometrics/">AutoMetric API</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../development_best_practices/">Best Practices</a>
+        
+    </li>
+
+        
+    </ul>
+<li>
+          
+            <li>
+    <ul class="subnav">
+    <li><span>Operations</span></li>
+
+        
+            
+    <li class="toctree-l1 current">
+        <a class="current" href="./">Apex CLI</a>
+        
+            <ul>
+            
+                <li class="toctree-l3"><a href="#apache-apex-command-line-interface">Apache Apex Command Line Interface</a></li>
+                
+                    <li><a class="toctree-l4" href="#apex-cli-commands">Apex CLI Commands</a></li>
+                
+                    <li><a class="toctree-l4" href="#examples">Examples</a></li>
+                
+            
+            </ul>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../security/">Security</a>
+        
+    </li>
+
+        
+    </ul>
+<li>
+          
+            <li>
+    <li class="toctree-l1 ">
+        <a class="" href="../compatibility/">Compatibility</a>
+        
+    </li>
+<li>
+          
+        </ul>
+      </div>
+      &nbsp;
+    </nav>
+
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+      
+      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
+        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
+        <a href="..">Apache Apex Documentation</a>
+      </nav>
+
+      
+      <div class="wy-nav-content">
+        <div class="rst-content">
+          <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs">
+    <li><a href="..">Docs</a> &raquo;</li>
+    
+      
+        
+          <li>Operations &raquo;</li>
+        
+      
+    
+    <li>Apex CLI</li>
+    <li class="wy-breadcrumbs-aside">
+      
+    </li>
+  </ul>
+  <hr/>
+</div>
+          <div role="main">
+            <div class="section">
+              
+                <h1 id="apache-apex-command-line-interface">Apache Apex Command Line Interface</h1>
+<p>Apex CLI, the Apache Apex command line interface, can be used to launch, monitor, and manage Apache Apex applications.  It provides a developer friendly way of interacting with Apache Apex platform.  Another advantage of Apex CLI is to provide scope, by connecting and executing commands in a context of specific application.  Apex CLI enables easy integration with existing enterprise toolset for automated application monitoring and management.  Currently the following high level tasks are supported.</p>
+<ul>
+<li>Launch or kill applications</li>
+<li>View system metrics including load, throughput, latency, etc.</li>
+<li>Start or stop tuple recording</li>
+<li>Read operator, stream, port properties and attributes</li>
+<li>Write to operator properties</li>
+<li>Dynamically change the application logical plan</li>
+<li>Create custom macros</li>
+</ul>
+<h2 id="apex-cli-commands">Apex CLI Commands</h2>
+<p>Apex CLI can be launched by running following command</p>
+<pre><code>apex
+</code></pre>
+<p>Help on all commands is available via \u201chelp\u201d command in the CLI</p>
+<h3 id="global-commands">Global Commands</h3>
+<pre><code>GLOBAL COMMANDS EXCEPT WHEN CHANGING LOGICAL PLAN:
+
+alias alias-name command
+    Create a command alias
+
+begin-macro name
+    Begin Macro Definition ($1...$9 to access parameters and type 'end' to end the definition)
+
+connect app-id
+    Connect to an app
+
+dump-properties-file out-file jar-file class-name
+    Dump the properties file of an app class
+
+echo [arg ...]
+    Echo the arguments
+
+exit
+    Exit the CLI
+
+get-app-info app-id
+    Get the information of an app
+
+get-app-package-info app-package-file
+    Get info on the app package file
+
+get-app-package-operator-properties app-package-file operator-class
+    Get operator properties within the given app package
+
+get-app-package-operators [options] app-package-file [search-term]
+    Get operators within the given app package
+    Options:
+            -parent    Specify the parent class for the operators
+
+get-config-parameter [parameter-name]
+    Get the configuration parameter
+
+get-jar-operator-classes [options] jar-files-comma-separated [search-term]
+    List operators in a jar list
+    Options:
+            -parent    Specify the parent class for the operators
+
+get-jar-operator-properties jar-files-comma-separated operator-class-name
+    List properties in specified operator
+
+help [command]
+    Show help
+
+kill-app app-id/app-name [app-id/app-name ...]
+    Kill an app
+
+  launch [options] jar-file/json-file/properties-file/app-package-file [matching-app-name]
+    Launch an app
+    Options:
+            -apconf &lt;app package configuration file&gt;        Specify an application
+                                                            configuration file
+                                                            within the app
+                                                            package if launching
+                                                            an app package.
+            -archives &lt;comma separated list of archives&gt;    Specify comma
+                                                            separated archives
+                                                            to be unarchived on
+                                                            the compute machines.
+            -conf &lt;configuration file&gt;                      Specify an
+                                                            application
+                                                            configuration file.
+            -D &lt;property=value&gt;                             Use value for given
+                                                            property.
+            -exactMatch                                     Only consider
+                                                            applications with
+                                                            exact app name
+            -files &lt;comma separated list of files&gt;          Specify comma
+                                                            separated files to
+                                                            be copied on the
+                                                            compute machines.
+            -ignorepom                                      Do not run maven to
+                                                            find the dependency
+            -libjars &lt;comma separated list of libjars&gt;      Specify comma
+                                                            separated jar files
+                                                            or other resource
+                                                            files to include in
+                                                            the classpath.
+            -local                                          Run application in
+                                                            local mode.
+            -originalAppId &lt;application id&gt;                 Specify original
+                                                            application
+                                                            identifier for restart.
+            -queue &lt;queue name&gt;                             Specify the queue to
+                                                            launch the application
+
+list-application-attributes
+    Lists the application attributes
+list-apps [pattern]
+    List applications
+list-operator-attributes
+    Lists the operator attributes
+list-port-attributes
+    Lists the port attributes
+set-pager on/off
+    Set the pager program for output
+show-logical-plan [options] jar-file/app-package-file [class-name]
+    List apps in a jar or show logical plan of an app class
+    Options:
+            -exactMatch                                Only consider exact match
+                                                       for app name
+            -ignorepom                                 Do not run maven to find
+                                                       the dependency
+            -libjars &lt;comma separated list of jars&gt;    Specify comma separated
+                                                       jar/resource files to
+                                                       include in the classpath.
+shutdown-app app-id [app-id ...]
+    Shutdown an app
+source file
+    Execute the commands in a file
+</code></pre>
+
+<h3 id="commands-after-connecting-to-an-application">Commands after connecting to an application</h3>
+<pre><code>COMMANDS WHEN CONNECTED TO AN APP (via connect &lt;appid&gt;) EXCEPT WHEN CHANGING LOGICAL PLAN:
+
+begin-logical-plan-change
+    Begin Logical Plan Change
+dump-properties-file out-file [jar-file] [class-name]
+    Dump the properties file of an app class
+get-app-attributes [attribute-name]
+    Get attributes of the connected app
+get-app-info [app-id]
+    Get the information of an app
+get-operator-attributes operator-name [attribute-name]
+    Get attributes of an operator
+get-operator-properties operator-name [property-name]
+    Get properties of a logical operator
+get-physical-operator-properties [options] operator-id
+    Get properties of a physical operator
+    Options:
+            -propertyName &lt;property name&gt;    The name of the property whose
+                                             value needs to be retrieved
+            -waitTime &lt;wait time&gt;            How long to wait to get the result
+get-port-attributes operator-name port-name [attribute-name]
+    Get attributes of a port
+get-recording-info [operator-id] [start-time]
+    Get tuple recording info
+kill-app [&lt;app-id/app-name&gt; ...]
+    Kill an app
+kill-container container-id [container-id ...]
+    Kill a container
+list-containers
+    List containers
+list-operators [pattern]
+    List operators
+set-operator-property operator-name property-name property-value
+    Set a property of an operator
+set-physical-operator-property operator-id property-name property-value
+    Set a property of an operator
+show-logical-plan [options] [jar-file/app-package-file] [class-name]
+    Show logical plan of an app class
+    Options:
+            -exactMatch                                Only consider exact match
+                                                       for app name
+            -ignorepom                                 Do not run maven to find
+                                                       the dependency
+            -libjars &lt;comma separated list of jars&gt;    Specify comma separated
+                                                       jar/resource files to
+                                                       include in the classpath.
+show-physical-plan
+    Show physical plan
+shutdown-app [app-id ...]
+    Shutdown an app
+start-recording operator-id [port-name] [num-windows]
+    Start recording
+stop-recording operator-id [port-name]
+    Stop recording
+wait timeout
+    Wait for completion of current application
+</code></pre>
+
+<h3 id="commands-when-changing-the-logical-plan">Commands when changing the logical plan</h3>
+<pre><code>COMMANDS WHEN CHANGING LOGICAL PLAN (via begin-logical-plan-change):
+
+abort
+    Abort the plan change
+add-stream-sink stream-name to-operator-name to-port-name
+    Add a sink to an existing stream
+create-operator operator-name class-name
+    Create an operator
+create-stream stream-name from-operator-name from-port-name to-operator-name to-port-name
+    Create a stream
+help [command]
+    Show help
+remove-operator operator-name
+    Remove an operator
+remove-stream stream-name
+    Remove a stream
+set-operator-attribute operator-name attr-name attr-value
+    Set an attribute of an operator
+set-operator-property operator-name property-name property-value
+    Set a property of an operator
+set-port-attribute operator-name port-name attr-name attr-value
+    Set an attribute of a port
+set-stream-attribute stream-name attr-name attr-value
+    Set an attribute of a stream
+show-queue
+    Show the queue of the plan change
+submit
+    Submit the plan change
+</code></pre>
+
+<h2 id="examples">Examples</h2>
+<p>An example of defining a custom macro.  The macro updates a running application by inserting a new operator.  It takes three parameters and executes a logical plan changes.</p>
+<pre><code>apex&gt; begin-macro add-console-output
+macro&gt; begin-logical-plan-change
+macro&gt; create-operator $1 com.datatorrent.lib.io.ConsoleOutputOperator
+macro&gt; create-stream stream_$1 $2 $3 $1 in
+macro&gt; submit
+</code></pre>
+
+<p>Then execute the <code>add-console-output</code> macro like this</p>
+<pre><code>apex&gt; add-console-output xyz opername portname
+</code></pre>
+
+<p>This macro then expands to run the following command</p>
+<pre><code>begin-logical-plan-change
+create-operator xyz com.datatorrent.lib.io.ConsoleOutputOperator
+create-stream stream_xyz opername portname xyz in
+submit
+</code></pre>
+
+<p><em>Note</em>:  To perform runtime logical plan changes, like ability to add new operators,
+they must be part of the jar files that were deployed at application launch time.</p>
+              
+            </div>
+          </div>
+          <footer>
+  
+    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
+      
+        <a href="../security/" class="btn btn-neutral float-right" title="Security">Next <span class="icon icon-circle-arrow-right"></span></a>
+      
+      
+        <a href="../development_best_practices/" class="btn btn-neutral" title="Best Practices"><span class="icon icon-circle-arrow-left"></span> Previous</a>
+      
+    </div>
+  
+
+  <hr/>
+
+  <div role="contentinfo">
+    <!-- Copyright etc -->
+    
+  </div>
+
+  Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
+</footer>
+	  
+        </div>
+      </div>
+
+    </section>
+
+  </div>
+
+<div class="rst-versions" role="note" style="cursor: pointer">
+    <span class="rst-current-version" data-toggle="rst-current-version">
+      
+      
+        <span><a href="../development_best_practices/" style="color: #fcfcfc;">&laquo; Previous</a></span>
+      
+      
+        <span style="margin-left: 15px"><a href="../security/" style="color: #fcfcfc">Next &raquo;</a></span>
+      
+    </span>
+</div>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/apex-site/blob/2189ef54/content/docs/apex-3.5/apex_development_setup/index.html
----------------------------------------------------------------------
diff --git a/content/docs/apex-3.5/apex_development_setup/index.html b/content/docs/apex-3.5/apex_development_setup/index.html
new file mode 100644
index 0000000..1af03d1
--- /dev/null
+++ b/content/docs/apex-3.5/apex_development_setup/index.html
@@ -0,0 +1,379 @@
+<!DOCTYPE html>
+<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  
+  
+  
+  <title>Development Setup - Apache Apex Documentation</title>
+  
+
+  <link rel="shortcut icon" href="../favicon.ico">
+  
+
+  
+  <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
+
+  <link rel="stylesheet" href="../css/theme.css" type="text/css" />
+  <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
+  <link rel="stylesheet" href="../css/highlight.css">
+
+  
+  <script>
+    // Current page data
+    var mkdocs_page_name = "Development Setup";
+    var mkdocs_page_input_path = "apex_development_setup.md";
+    var mkdocs_page_url = "/apex_development_setup/";
+  </script>
+  
+  <script src="../js/jquery-2.1.1.min.js"></script>
+  <script src="../js/modernizr-2.8.3.min.js"></script>
+  <script type="text/javascript" src="../js/highlight.pack.js"></script>
+  <script src="../js/theme.js"></script> 
+
+  
+</head>
+
+<body class="wy-body-for-nav" role="document">
+
+  <div class="wy-grid-for-nav">
+
+    
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
+      <div class="wy-side-nav-search">
+        <a href=".." class="icon icon-home"> Apache Apex Documentation</a>
+        <div role="search">
+  <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
+    <input type="text" name="q" placeholder="Search docs" />
+  </form>
+</div>
+      </div>
+
+      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
+        <ul class="current">
+          
+            <li>
+    <li class="toctree-l1 ">
+        <a class="" href="..">Apache Apex</a>
+        
+    </li>
+<li>
+          
+            <li>
+    <ul class="subnav">
+    <li><span>Development</span></li>
+
+        
+            
+    <li class="toctree-l1 current">
+        <a class="current" href="./">Development Setup</a>
+        
+            <ul>
+            
+                <li class="toctree-l3"><a href="#apache-apex-development-environment-setup">Apache Apex Development Environment Setup</a></li>
+                
+                    <li><a class="toctree-l4" href="#development-tools">Development Tools</a></li>
+                
+                    <li><a class="toctree-l4" href="#creating-new-apex-project">Creating New Apex Project</a></li>
+                
+                    <li><a class="toctree-l4" href="#running-unit-tests">Running Unit Tests</a></li>
+                
+                    <li><a class="toctree-l4" href="#building-apex-demos">Building Apex Demos</a></li>
+                
+                    <li><a class="toctree-l4" href="#sandbox">Sandbox</a></li>
+                
+            
+            </ul>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../application_development/">Applications</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../application_packages/">Packages</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../operator_development/">Operators</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../autometrics/">AutoMetric API</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../development_best_practices/">Best Practices</a>
+        
+    </li>
+
+        
+    </ul>
+<li>
+          
+            <li>
+    <ul class="subnav">
+    <li><span>Operations</span></li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../apex_cli/">Apex CLI</a>
+        
+    </li>
+
+        
+            
+    <li class="toctree-l1 ">
+        <a class="" href="../security/">Security</a>
+        
+    </li>
+
+        
+    </ul>
+<li>
+          
+            <li>
+    <li class="toctree-l1 ">
+        <a class="" href="../compatibility/">Compatibility</a>
+        
+    </li>
+<li>
+          
+        </ul>
+      </div>
+      &nbsp;
+    </nav>
+
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+      
+      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
+        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
+        <a href="..">Apache Apex Documentation</a>
+      </nav>
+
+      
+      <div class="wy-nav-content">
+        <div class="rst-content">
+          <div role="navigation" aria-label="breadcrumbs navigation">
+  <ul class="wy-breadcrumbs">
+    <li><a href="..">Docs</a> &raquo;</li>
+    
+      
+        
+          <li>Development &raquo;</li>
+        
+      
+    
+    <li>Development Setup</li>
+    <li class="wy-breadcrumbs-aside">
+      
+    </li>
+  </ul>
+  <hr/>
+</div>
+          <div role="main">
+            <div class="section">
+              
+                <h1 id="apache-apex-development-environment-setup">Apache Apex Development Environment Setup</h1>
+<p>This document discusses the steps needed for setting up a development environment for creating applications that run on the Apache Apex platform.</p>
+<h2 id="development-tools">Development Tools</h2>
+<p>There are a few tools that will be helpful when developing Apache Apex applications, including:</p>
+<ol>
+<li>
+<p><strong>git</strong> - A revision control system (version 1.7.1 or later). There are multiple git clients available for Windows (<a href="http://git-scm.com/download/win">http://git-scm.com/download/win</a> for example), so download and install a client of your choice.</p>
+</li>
+<li>
+<p><strong>java JDK</strong> (not JRE) - Includes the Java Runtime Environment as well as the Java compiler and a variety of tools (version 1.7.0_79 or later). Can be downloaded from the Oracle website.</p>
+</li>
+<li>
+<p><strong>maven</strong> - Apache Maven is a build system for Java projects (version 3.0.5 or later). It can be downloaded from <a href="https://maven.apache.org/download.cgi">https://maven.apache.org/download.cgi</a>.</p>
+</li>
+<li>
+<p><strong>IDE</strong> (Optional) - If you prefer to use an IDE (Integrated Development Environment) such as <em>NetBeans</em>, <em>Eclipse</em> or <em>IntelliJ</em>, install that as well.</p>
+</li>
+</ol>
+<p>After installing these tools, make sure that the directories containing the executable files are in your PATH environment variable.</p>
+<ul>
+<li><strong>Windows</strong> - Open a console window and enter the command <code>echo %PATH%</code> to see the value of the <code>PATH</code> variable and verify that the above directories for Java, git, and maven executables are present.  JDK executables like <em>java</em> and <em>javac</em>, the directory might be something like <code>C:\Program Files\Java\jdk1.7.0\_80\bin</code>; for <em>git</em> it might be <code>C:\Program Files\Git\bin</code>; and for maven it might be <code>C:\Users\user\Software\apache-maven-3.3.3\bin</code>.  If not, you can change its value clicking on the button at <em>Control Panel</em> &#x21e8; <em>Advanced System Settings</em> &#x21e8; <em>Advanced tab</em> &#x21e8; <em>Environment Variables</em>.</li>
+<li><strong>Linux and Mac</strong> - Open a console/terminal window and enter the command <code>echo $PATH</code> to see the value of the <code>PATH</code> 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 <code>~/.profile</code> or <code>~/.bash_profile</code>.  For example to add maven located in <code>/sfw/maven/apache-maven-3.3.3</code> to PATH add the line: <code>export PATH=$PATH:/sfw/maven/apache-maven-3.3.3/bin</code></li>
+</ul>
+<p>Confirm by running the following commands and comparing with output that show in the table below:</p>
+<table>
+<colgroup>
+<col width="30%" />
+<col width="70%" />
+</colgroup>
+<tbody>
+<tr class="odd">
+<td align="left"><p>Command</p></td>
+<td align="left"><p>Output</p></td>
+</tr>
+<tr class="even">
+<td align="left"><p><tt>javac -version</tt></p></td>
+<td align="left"><p>javac 1.7.0_80</p></td>
+</tr>
+<tr class="odd">
+<td align="left"><p><tt>java -version</tt></p></td>
+<td align="left"><p>java version &quot;1.7.0_80&quot;</p>
+<p>Java(TM) SE Runtime Environment (build 1.7.0_80-b15)</p>
+<p>Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)</p></td>
+</tr>
+<tr class="even">
+<td align="left"><p><tt>git --version</tt></p></td>
+<td align="left"><p>git version 2.6.1.windows.1</p></td>
+</tr>
+<tr class="odd">
+<td align="left"><p><tt>mvn --version</tt></p></td>
+<td align="left"><p>Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T06:57:37-05:00)</p>
+<p>...</p>
+</td>
+</tr>
+</tbody>
+</table>
+
+<h2 id="creating-new-apex-project">Creating New Apex Project</h2>
+<p>After development tools are configured, you can now use the maven archetype to create a basic Apache Apex project.  <strong>Note:</strong> When executing the commands below, replace <code>3.4.0</code> by <a href="http://apex.apache.org/downloads.html">latest available version</a> of Apache Apex.</p>
+<ul>
+<li>
+<p><strong>Windows</strong> - Create a new Windows command file called <code>newapp.cmd</code> by copying the lines below, and execute it.  When you run this file, the properties will be displayed and you will be prompted with <code>Y: :</code>; just press <strong>Enter</strong> to complete the project generation.  The caret (^) at the end of some lines indicates that a continuation line follows. </p>
+<pre><code>@echo off
+@rem Script for creating a new application
+setlocal
+mvn archetype:generate ^
+ -DarchetypeGroupId=org.apache.apex ^
+ -DarchetypeArtifactId=apex-app-archetype -DarchetypeVersion=3.4.0 ^
+ -DgroupId=com.example -Dpackage=com.example.myapexapp -DartifactId=myapexapp ^
+ -Dversion=1.0-SNAPSHOT
+endlocal
+</code></pre>
+</li>
+<li>
+<p><strong>Linux</strong> - Execute the lines below in a terminal window.  New project will be created in the curent working directory.  The backslash (\) at the end of the lines indicates continuation.</p>
+<pre><code>mvn archetype:generate \
+ -DarchetypeGroupId=org.apache.apex \
+ -DarchetypeArtifactId=apex-app-archetype -DarchetypeVersion=3.4.0 \
+ -DgroupId=com.example -Dpackage=com.example.myapexapp -DartifactId=myapexapp \
+ -Dversion=1.0-SNAPSHOT
+</code></pre>
+</li>
+</ul>
+<p>When the run completes successfully, you should see a new directory named <code>myapexapp</code> containing a maven project for building a basic Apache Apex application. It includes 3 source files:<strong>Application.java</strong>,  <strong>RandomNumberGenerator.java</strong> and <strong>ApplicationTest.java</strong>. You can now build the application by stepping into the new directory and running the maven package command:</p>
+<pre><code>cd myapexapp
+mvn clean package -DskipTests
+</code></pre>
+<p>The build should create the application package file <code>myapexapp/target/myapexapp-1.0-SNAPSHOT.apa</code>. This application package can then be used to launch example application via <strong>apex</strong> CLI, 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 <code>hello world:</code>.</p>
+<h2 id="running-unit-tests">Running Unit Tests</h2>
+<p>To run unit tests on Linux or OSX, simply run the usual maven command, for example: <code>mvn test</code>.</p>
+<p>On Windows, an additional file, <code>winutils.exe</code>, is required; download it from
+<a href="https://github.com/srccodes/hadoop-common-2.2.0-bin/archive/master.zip">https://github.com/srccodes/hadoop-common-2.2.0-bin/archive/master.zip</a>
+and unpack the archive to, say, <code>C:\hadoop</code>; this file should be present under
+<code>hadoop-common-2.2.0-bin-master\bin</code> within it.</p>
+<p>Set the <code>HADOOP_HOME</code> environment variable system-wide to
+<code>c:\hadoop\hadoop-common-2.2.0-bin-master</code> as described at:
+<a href="https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true">https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true</a>. You should now be able to run unit tests normally.</p>
+<p>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 <code>hadoop.home.dir</code>:</p>
+<pre><code>mvn -Dhadoop.home.dir=c:\hadoop\hadoop-common-2.2.0-bin-master test
+</code></pre>
+<p>or set the environment variable separately:</p>
+<pre><code>set HADOOP_HOME=c:\hadoop\hadoop-common-2.2.0-bin-master
+mvn test
+</code></pre>
+<p>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:</p>
+<pre><code>Env.HADOOP_HOME=c:/hadoop/hadoop-common-2.2.0-bin-master
+</code></pre>
+<p>at <em>Properties &#8658; Actions &#8658; Run project &#8658; Set Properties</em>.</p>
+<p>Similarly, in Eclipse (Mars) add it to the
+project properties at <em>Properties &#8658; Run/Debug Settings &#8658; ApplicationTest
+&#8658; Environment</em> tab.</p>
+<h2 id="building-apex-demos">Building Apex Demos</h2>
+<p>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.</p>
+<ol>
+<li>
+<p>Check out the source code repositories:</p>
+<pre><code>git clone https://github.com/apache/apex-core
+git clone https://github.com/apache/apex-malhar
+</code></pre>
+</li>
+<li>
+<p>Switch to the appropriate release branch and build each repository:</p>
+<pre><code>cd apex-core
+mvn clean install -DskipTests
+
+cd apex-malhar
+mvn clean install -DskipTests
+</code></pre>
+</li>
+</ol>
+<p>The <code>install</code> argument to the <code>mvn</code> command installs resources from each project to your local maven repository (typically <code>.m2/repository</code> under your home directory), and <strong>not</strong> to the system directories, so Administrator privileges are not required. The  <code>-DskipTests</code> argument skips running unit tests since they take a long time. If this is a first-time installation, it might take several minutes to complete because maven will download a number of associated plugins.</p>
+<p>After the build completes, you should see the demo application package files in the target directory under each demo subdirectory in <code>apex-malhar/demos</code>.</p>
+<h2 id="sandbox">Sandbox</h2>
+<p>To jump start development with an Apache Hadoop single node cluster, <a href="https://www.datatorrent.com/download">DataTorrent Sandbox</a> powered by VirtualBox is available on Windows, Linux, or Mac platforms.  The sandbox is configured by default to run with 6GB RAM; if your development machine has 16GB or more, you can increase the sandbox RAM to 8GB or more using the VirtualBox console.  This will yield better performance and support larger applications.  The advantage of developing in the sandbox is that most of the tools (e.g. <em>jdk</em>, <em>git</em>, <em>maven</em>), Hadoop YARN and HDFS, and a distribution of Apache Apex and DataTorrent RTS are pre-installed.  The disadvantage is that the sandbox is a memory-limited environment, and requires settings changes and restarts to adjust memory available for development and testing.</p>
+              
+            </div>
+          </div>
+          <footer>
+  
+    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
+      
+        <a href="../application_development/" class="btn btn-neutral float-right" title="Applications">Next <span class="icon icon-circle-arrow-right"></span></a>
+      
+      
+        <a href=".." class="btn btn-neutral" title="Apache Apex"><span class="icon icon-circle-arrow-left"></span> Previous</a>
+      
+    </div>
+  
+
+  <hr/>
+
+  <div role="contentinfo">
+    <!-- Copyright etc -->
+    
+  </div>
+
+  Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
+</footer>
+	  
+        </div>
+      </div>
+
+    </section>
+
+  </div>
+
+<div class="rst-versions" role="note" style="cursor: pointer">
+    <span class="rst-current-version" data-toggle="rst-current-version">
+      
+      
+        <span><a href=".." style="color: #fcfcfc;">&laquo; Previous</a></span>
+      
+      
+        <span style="margin-left: 15px"><a href="../application_development/" style="color: #fcfcfc">Next &raquo;</a></span>
+      
+    </span>
+</div>
+
+</body>
+</html>