You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@twill.apache.org by ch...@apache.org on 2014/12/16 20:44:19 UTC

[6/6] incubator-twill git commit: Merge branch 'master' into site

Merge branch 'master' into site

Conflicts:
	src/site/markdown/GettingStarted.md


Project: http://git-wip-us.apache.org/repos/asf/incubator-twill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-twill/commit/2c673aeb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-twill/tree/2c673aeb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-twill/diff/2c673aeb

Branch: refs/heads/site
Commit: 2c673aeb7a1e322c69875856f2658cb9b0291528
Parents: ff3b99b b1adf69
Author: Terence Yim <ch...@apache.org>
Authored: Tue Dec 16 11:35:55 2014 -0800
Committer: Terence Yim <ch...@apache.org>
Committed: Tue Dec 16 11:35:55 2014 -0800

----------------------------------------------------------------------
 .gitignore                                      |  6 ++
 .travis.yml                                     |  1 -
 src/site/markdown/GettingStarted.md             | 65 ++++++++++++++++++++
 twill-examples/echo/pom.xml                     |  6 ++
 twill-examples/yarn/pom.xml                     |  8 ++-
 .../twill/example/yarn/BundledJarExample.java   |  4 +-
 .../twill/yarn/PlacementPolicyTestRun.java      | 48 ++++++++-------
 .../org/apache/twill/yarn/YarnTestSuite.java    |  4 +-
 .../zookeeper/DefaultZKClientService.java       | 20 +++++-
 .../apache/twill/zookeeper/ZKClientTest.java    | 28 +++++++++
 10 files changed, 159 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-twill/blob/2c673aeb/src/site/markdown/GettingStarted.md
----------------------------------------------------------------------
diff --cc src/site/markdown/GettingStarted.md
index 9847ac1,85345ab..9343d92
--- a/src/site/markdown/GettingStarted.md
+++ b/src/site/markdown/GettingStarted.md
@@@ -147,3 -124,68 +147,68 @@@ controller.stop().get()
  ```
  
  This will shut down the application master and all the containers.
+ 
+ ### Hello World
+ 
+ To see Twill in action, you can run the "hello world" example applications located in the twill-examples module.
+ 
+ #### Prerequisites
+ 
+ * Single Node or Cluster installation of Hadoop with YARN (Hadoop >= 2.2.0) set-up and running.
+ * Single Node or Cluster installation of ZooKeeper set-up and running.
+ * Build of Twill Library Code (minimum, build of twill-examples module)
+ 
+ #### Running the Examples
+ 
+ There are two example applications you can run: HelloWorld and BundledJarExample.
+ 
+ ##### HelloWorld Application
+ 
+ The HelloWorld application creates a simple YARN application that prints a line to the log.
+ 
+ You can run the HelloWorld application from any node of the Hadoop cluster using the below command
+ (be sure to add your ZooKeeper Host and Port):
+ 
+ ```sh
+ $ CP=twill-examples-yarn-0.5.0-incubating-SNAPSHOT.jar:`hadoop classpath`; java -cp $CP org.apache.twill.example.yarn.HelloWorld {zookeeper_host:port}
+ ```
+ 
+ If successful, you should see logs output to the terminal with details of the running application.  Once the application
+ is finished running, check the YARN logs and you should see output like the following:
+ 
+ ```
+ 14:49:45.944 [TwillContainerService] INFO  o.a.twill.example.yarn.HelloWorld - Hello World. My first distributed application.
+ ```
+ 
+ ##### BundledJarExample Application
+ 
+ The BundledJarExample application demonstrates the Twill functionality that allows you to run any Java application
+ in Twill without worrying about library version conflicts between your application and Hadoop.  The example
+ calls the main class in a sample application `Echo`, which simply logs the command line argument(s) passed to it.
+ The `Echo` application uses a different version of Guava from Twill and Hadoop distributions.  BundledJarExample
+ looks for the dependency in a `lib` folder packaged at the root of the `Echo` jar.
+ 
+ You can run the BundleJarExample application from any node of the Hadoop cluster using the below command
+ (be sure to add your ZooKeeper Host and Port):
+ 
+ ```sh
+ $ CP=twill-examples-yarn-0.5.0-incubating-SNAPSHOT.jar:`hadoop classpath`; 
+      java -cp $CP org.apache.twill.example.yarn.BundledJarExample {zookeeper_host:port} twill-examples-echo-0.5.0-incubating-SNAPSHOT.jar echo.EchoMain arg1
+ ```
+ 
+ Like with the HelloWorld example, you should see logs output to the terminal.  Once the application is complete, check
+ the YARN logs as before and you should see output like the following:
+ 
+ ```
+ [TwillContainerService] INFO echo.EchoMain - Hello from EchoMain: 6
+ err HELLO from scatch
+ [TwillContainerService] INFO echo.EchoMain - Got args: [arg1]
+ 
+ ...
+ 
+ out HELLO from scatch
+ Got args: [arg1]
+ 
+ ```
+ 
 -Congratulations!  You have run your first Twill applications.
++Congratulations!  You have run your first Twill applications.