├── examples ├── WebHCatGroovy │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── log4j.properties │ │ │ └── java │ │ │ └── org │ │ │ └── apache │ │ │ └── hadoop │ │ │ └── gateway │ │ │ └── shell │ │ │ └── job │ │ │ └── Job.java │ ├── resources │ │ └── log4j.properties │ ├── gradlew.bat │ └── MapReduce.groovy ├── WebHdfsGroovy │ ├── example.txt │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── resources │ │ └── log4j.properties │ ├── Ls.groovy │ ├── Mkdir.groovy │ ├── build.gradle │ ├── Put.groovy │ └── gradlew.bat ├── HiveGroovy │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── Example.groovy │ ├── build.gradle │ └── gradlew.bat ├── WebHdfsCurl │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ ├── Mkdir.sh │ ├── Ls.sh │ ├── Put.sh │ └── gradlew.bat ├── HiveBeeline │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ └── gradlew.bat ├── BigSQLGroovy │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── resources │ │ └── log4j.properties │ ├── Connect.groovy │ ├── README_Federation.md │ ├── Insert.groovy │ ├── Hbase.groovy │ ├── Federation.groovy │ ├── Load.groovy │ └── gradlew.bat ├── Jsqsh │ ├── simple_select.sql │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradle-app.setting │ └── gradlew.bat ├── HBaseJava │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── log4j.properties │ │ │ └── java │ │ │ └── Example.java │ ├── build.gradle │ └── gradlew.bat ├── OozieWorkflowMapReduceGroovy │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── log4j.properties │ ├── resources │ │ └── log4j.properties │ ├── build.gradle │ └── gradlew.bat ├── OozieWorkflowSparkGroovyBluemixDeploy │ ├── bluemix-deploy │ │ ├── .gitignore │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── templates │ │ │ │ │ └── greeting.html │ │ │ │ └── groovy │ │ │ │ └── net │ │ │ │ └── christophersnow │ │ │ │ └── etl │ │ │ │ └── Application.groovy │ │ ├── build.gradle │ │ └── gradlew.bat │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── hadoop-deploy │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── log4j.properties │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── spark │ │ │ │ └── examples │ │ │ │ └── WordCount.java │ │ ├── build.gradle │ │ └── gradlew.bat │ └── gradlew.bat ├── Zeppelin │ ├── Rprofile_template │ ├── image.png │ ├── docs │ │ ├── title.png │ │ ├── Pyspark_Test.png │ │ ├── ssh_port_forwarding.odg │ │ ├── ssh_port_forwarding.png │ │ └── ConfigureInterpreters.png │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── setup.R │ ├── shiro.ini_template │ ├── zeppelin_uninstall.sh │ ├── zeppelin_install.sh │ ├── zeppelin_env.sh_template │ └── gradlew.bat ├── BigSQLJava │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── Example.java │ ├── build.gradle │ └── gradlew.bat ├── HiveJava │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── Example.java │ ├── build.gradle │ └── gradlew.bat ├── SparkWordCountPython │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── wordcount.py │ ├── README.md │ ├── build.gradle │ └── gradlew.bat ├── SparkWordCountScala │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ └── scala │ │ │ └── org │ │ │ └── apache │ │ │ └── spark │ │ │ └── examples │ │ │ └── WordCount.scala │ ├── README.md │ └── gradlew.bat ├── SparkMessageHubScala │ ├── .gitignore │ ├── libs │ │ ├── messagehub.login-1.0.0.jar │ │ └── README │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── vcap.json_template │ ├── send_message.py │ ├── src │ │ └── main │ │ │ └── scala │ │ │ ├── biginsights │ │ │ └── examples │ │ │ │ └── MessageHubConsumer.scala │ │ │ └── com │ │ │ └── ibm │ │ │ └── cds │ │ │ └── spark │ │ │ └── samples │ │ │ └── config │ │ │ └── DemoConfig.scala │ └── gradlew.bat ├── SparkMessageHubScalaYarn │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── libs │ │ ├── messagehub.login-1.0.0.jar │ │ └── README │ ├── vcap.json_template │ ├── send_message.py │ ├── src │ │ └── main │ │ │ └── scala │ │ │ └── biginsights │ │ │ └── examples │ │ │ └── MessageHubConsumer.scala │ └── gradlew.bat ├── OozieWorkflowMapReduceCurl │ ├── .gitignore │ ├── knox-overview.gif │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── log4j.properties │ ├── build.gradle │ └── gradlew.bat ├── Ambari │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── RestartService.groovy │ ├── ListServices.groovy │ ├── build.gradle │ ├── AlertServices.groovy │ ├── ShowMaster.groovy │ └── gradlew.bat ├── Knoxshell │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ └── gradlew.bat ├── HBaseGroovy │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── resources │ │ └── log4j.properties │ ├── Connect.groovy │ ├── build.gradle │ └── gradlew.bat ├── SquirrelSQL │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ └── gradlew.bat ├── SparkSystemML │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ ├── LinearRegression.sh │ └── gradlew.bat └── OozieWorkflowSparkGroovy │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── src │ └── main │ │ ├── resources │ │ └── log4j.properties │ │ └── java │ │ └── org │ │ └── apache │ │ └── spark │ │ └── examples │ │ └── WordCount.java │ ├── build.gradle │ └── gradlew.bat ├── overview.png ├── downloads └── .gitignore ├── docs ├── Overview.pptx ├── GettingStarted.pptx ├── Overview │ ├── Slide1.png │ ├── Slide2.png │ ├── Slide3.png │ ├── Slide4.png │ ├── Slide5.png │ └── Slide6.png └── GettingStarted │ ├── Slide1.png │ ├── Slide2.png │ ├── Slide3.png │ └── Slide4.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore └── gradlew.bat /examples/WebHCatGroovy/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/example.txt: -------------------------------------------------------------------------------- 1 | hello world! 2 | -------------------------------------------------------------------------------- /examples/HiveGroovy/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | truststore.jks 3 | -------------------------------------------------------------------------------- /examples/WebHdfsCurl/.gitignore: -------------------------------------------------------------------------------- 1 | userHome/ 2 | build/ 3 | -------------------------------------------------------------------------------- /examples/HiveBeeline/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | truststore.jks 3 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | truststore.jks 3 | scripts/ 4 | -------------------------------------------------------------------------------- /examples/Jsqsh/simple_select.sql: -------------------------------------------------------------------------------- 1 | 2 | select * from (values (1)); 3 | -------------------------------------------------------------------------------- /examples/HBaseJava/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | .settings/ 3 | .classpath 4 | .project 5 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceGroovy/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle/ 2 | userHome/ 3 | build/ 4 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle/ 2 | -------------------------------------------------------------------------------- /examples/Zeppelin/Rprofile_template: -------------------------------------------------------------------------------- 1 | .libPaths( c( .libPaths(), "~/R/packages") ) 2 | -------------------------------------------------------------------------------- /overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/overview.png -------------------------------------------------------------------------------- /examples/Jsqsh/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | truststore.jks 3 | config/ 4 | jsqsh-2.2/ 5 | jsqsh-2.2-bin.zip 6 | -------------------------------------------------------------------------------- /downloads/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /docs/Overview.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/Overview.pptx -------------------------------------------------------------------------------- /examples/BigSQLJava/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | truststore.jks 3 | /bin/ 4 | .classpath 5 | .project 6 | .settings/ 7 | -------------------------------------------------------------------------------- /examples/HiveJava/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | truststore.jks 3 | /bin/ 4 | .classpath 5 | .project 6 | .settings/ 7 | -------------------------------------------------------------------------------- /docs/GettingStarted.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/GettingStarted.pptx -------------------------------------------------------------------------------- /docs/Overview/Slide1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/Overview/Slide1.png -------------------------------------------------------------------------------- /docs/Overview/Slide2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/Overview/Slide2.png -------------------------------------------------------------------------------- /docs/Overview/Slide3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/Overview/Slide3.png -------------------------------------------------------------------------------- /docs/Overview/Slide4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/Overview/Slide4.png -------------------------------------------------------------------------------- /docs/Overview/Slide5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/Overview/Slide5.png -------------------------------------------------------------------------------- /docs/Overview/Slide6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/Overview/Slide6.png -------------------------------------------------------------------------------- /examples/SparkWordCountPython/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | .classpath 3 | .project 4 | .settings/ 5 | .pydevproject 6 | .cache-main 7 | -------------------------------------------------------------------------------- /examples/SparkWordCountScala/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | .classpath 3 | .project 4 | .settings/ 5 | .pydevproject 6 | .cache-main 7 | -------------------------------------------------------------------------------- /examples/Zeppelin/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Zeppelin/image.png -------------------------------------------------------------------------------- /docs/GettingStarted/Slide1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/GettingStarted/Slide1.png -------------------------------------------------------------------------------- /docs/GettingStarted/Slide2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/GettingStarted/Slide2.png -------------------------------------------------------------------------------- /docs/GettingStarted/Slide3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/GettingStarted/Slide3.png -------------------------------------------------------------------------------- /docs/GettingStarted/Slide4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/docs/GettingStarted/Slide4.png -------------------------------------------------------------------------------- /examples/Zeppelin/docs/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Zeppelin/docs/title.png -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | .classpath 3 | .project 4 | .settings/ 5 | .pydevproject 6 | .cache-main 7 | vcap.json 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | .classpath 3 | .project 4 | .settings/ 5 | .pydevproject 6 | .cache-main 7 | vcap.json 8 | -------------------------------------------------------------------------------- /examples/Zeppelin/docs/Pyspark_Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Zeppelin/docs/Pyspark_Test.png -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceCurl/.gitignore: -------------------------------------------------------------------------------- 1 | workflow-configuration.xml 2 | workflow-definition.xml 3 | workflow-configuration.xml 4 | workflow-definition.xml 5 | -------------------------------------------------------------------------------- /examples/Zeppelin/docs/ssh_port_forwarding.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Zeppelin/docs/ssh_port_forwarding.odg -------------------------------------------------------------------------------- /examples/Zeppelin/docs/ssh_port_forwarding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Zeppelin/docs/ssh_port_forwarding.png -------------------------------------------------------------------------------- /examples/Ambari/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Ambari/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/Jsqsh/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Jsqsh/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/Zeppelin/docs/ConfigureInterpreters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Zeppelin/docs/ConfigureInterpreters.png -------------------------------------------------------------------------------- /examples/HBaseJava/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/HBaseJava/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/HiveJava/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/HiveJava/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/Knoxshell/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Knoxshell/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/Zeppelin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/Zeppelin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/BigSQLJava/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/BigSQLJava/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/HBaseGroovy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/HBaseGroovy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/HiveBeeline/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/HiveBeeline/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/HiveGroovy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/HiveGroovy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceCurl/knox-overview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/OozieWorkflowMapReduceCurl/knox-overview.gif -------------------------------------------------------------------------------- /examples/SquirrelSQL/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SquirrelSQL/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/WebHdfsCurl/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/WebHdfsCurl/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/BigSQLGroovy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/BigSQLGroovy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkSystemML/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SparkSystemML/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SquirrelSQL/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | truststore.jks 3 | config/ 4 | jsqsh-2.2/ 5 | jsqsh-2.2-bin.zip 6 | squirrelsql-3.7.1-optional 7 | squirrelsql-3.7.1-optional.zip 8 | config/ 9 | -------------------------------------------------------------------------------- /examples/WebHCatGroovy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/WebHCatGroovy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/WebHdfsGroovy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/Zeppelin/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | .classpath 3 | .project 4 | .settings/ 5 | .pydevproject 6 | .cache-main 7 | truststore.jks 8 | zeppelin_env.sh 9 | Rprofile 10 | shiro.ini 11 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/libs/messagehub.login-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SparkMessageHubScala/libs/messagehub.login-1.0.0.jar -------------------------------------------------------------------------------- /examples/SparkWordCountScala/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SparkWordCountScala/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SparkMessageHubScala/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkWordCountPython/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SparkWordCountPython/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/OozieWorkflowSparkGroovy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SparkMessageHubScalaYarn/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/libs/messagehub.login-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/SparkMessageHubScalaYarn/libs/messagehub.login-1.0.0.jar -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceCurl/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/OozieWorkflowMapReduceCurl/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceGroovy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/OozieWorkflowMapReduceGroovy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/libs/README: -------------------------------------------------------------------------------- 1 | Third party jar was downloaded from: 2 | 3 | https://github.com/ibm-messaging/message-hub-samples/raw/master/kafka-0.9/message-hub-login-library/messagehub.login-1.0.0.jar 4 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/libs/README: -------------------------------------------------------------------------------- 1 | Third party jar was downloaded from: 2 | 3 | https://github.com/ibm-messaging/message-hub-samples/raw/master/kafka-0.9/message-hub-login-library/messagehub.login-1.0.0.jar 4 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/OozieWorkflowSparkGroovyBluemixDeploy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | connection.properties 2 | connection.properties.* 3 | certificate 4 | certificate.* 5 | build/ 6 | .gradle/ 7 | samples/ 8 | .vagrant/ 9 | *.swp 10 | **/userHome/ 11 | **/.DS_Store 12 | .idea/ 13 | secrets.tar 14 | bin/ 15 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/hadoop-deploy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/OozieWorkflowSparkGroovyBluemixDeploy/hadoop-deploy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM-Cloud/BigInsights-on-Apache-Hadoop/HEAD/examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/vcap.json_template: -------------------------------------------------------------------------------- 1 | { 2 | "api_key": "changeme", 3 | "kafka_rest_url": "changeme", 4 | "kafka_brokers_sasl": [ 5 | "changeme" 6 | ], 7 | "user": "changeme", 8 | "password": "changeme", 9 | "topic": "changeme" 10 | } 11 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/vcap.json_template: -------------------------------------------------------------------------------- 1 | { 2 | "api_key": "changeme", 3 | "kafka_rest_url": "changeme", 4 | "kafka_brokers_sasl": [ 5 | "changeme" 6 | ], 7 | "user": "changeme", 8 | "password": "changeme", 9 | "topic": "changeme" 10 | } 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:47:20 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/Ambari/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:47:23 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/HBaseJava/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:15 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/HiveJava/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:31 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/Jsqsh/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:37 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/Knoxshell/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:40 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/Zeppelin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:05 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:47:44 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/BigSQLJava/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:47:49 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/HBaseGroovy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/HiveBeeline/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:22 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/HiveGroovy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:27 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/SparkSystemML/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 04 10:43:40 PDT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/SquirrelSQL/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue May 31 20:14:56 PDT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/WebHCatGroovy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:08 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/WebHdfsCurl/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:15 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/HBaseJava/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | -------------------------------------------------------------------------------- /examples/SparkWordCountScala/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:05 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:56 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:05 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:05 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/SparkWordCountPython/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:51:05 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/WebHCatGroovy/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceCurl/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:48 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceGroovy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:52 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceCurl/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovy/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceGroovy/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:56 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/Zeppelin/setup.R: -------------------------------------------------------------------------------- 1 | install.packages('devtools', lib="~/R/packages", repos='http://cran.us.r-project.org', quiet = TRUE) 2 | install.packages('knitr', lib="~/R/packages", repos='http://cran.us.r-project.org', quiet = TRUE) 3 | install.packages('ggplot2', lib="~/R/packages", repos='http://cran.us.r-project.org', quiet = TRUE) 4 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:56 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/hadoop-deploy/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 20 14:50:56 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/hadoop-deploy/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/src/main/resources/templates/greeting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SpringMvcGroovy 5 | 6 | 7 | 8 |

9 |

10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | 9 | log4j.logger.org.apache.http=INFO 10 | log4j.logger.org.apache.http.client=INFO 11 | log4j.logger.org.apache.http.headers=INFO 12 | log4j.logger.org.apache.http.wire=INFO 13 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | 9 | log4j.logger.org.apache.http=INFO 10 | log4j.logger.org.apache.http.client=INFO 11 | log4j.logger.org.apache.http.headers=INFO 12 | log4j.logger.org.apache.http.wire=INFO 13 | -------------------------------------------------------------------------------- /examples/HBaseGroovy/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=DEBUG, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | 9 | log4j.logger.org.apache.http=DEBUG 10 | log4j.logger.org.apache.http.client=DEBUG 11 | log4j.logger.org.apache.http.headers=DEBUG 12 | log4j.logger.org.apache.http.wire=DEBUG 13 | -------------------------------------------------------------------------------- /examples/WebHCatGroovy/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=DEBUG, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | 9 | log4j.logger.org.apache.http=DEBUG 10 | log4j.logger.org.apache.http.client=DEBUG 11 | log4j.logger.org.apache.http.headers=DEBUG 12 | log4j.logger.org.apache.http.wire=DEBUG 13 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceGroovy/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=DEBUG, stdout 3 | 4 | # Direct log messages to stdout 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.Target=System.out 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | 9 | log4j.logger.org.apache.http=DEBUG 10 | log4j.logger.org.apache.http.client=DEBUG 11 | log4j.logger.org.apache.http.headers=DEBUG 12 | log4j.logger.org.apache.http.wire=DEBUG 13 | -------------------------------------------------------------------------------- /examples/WebHdfsCurl/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | Properties props = new Properties() 3 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 4 | 5 | // task to run the bash script 6 | ['Ls', 'Mkdir', 'Put'].each { taskName -> 7 | task "$taskName" (type: Exec) { 8 | 9 | environment 'gateway', props.gateway 10 | environment 'username', props.username 11 | environment 'password', props.password 12 | 13 | commandLine "bash", "${taskName}.sh" 14 | } 15 | } 16 | 17 | task('Test') { 18 | dependsOn Ls, Mkdir, Put 19 | } 20 | 21 | // this test will be removed when tests uses Test target 22 | task('Example') { 23 | dependsOn Ls, Mkdir, Put 24 | } 25 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/src/main/groovy/net/christophersnow/etl/Application.groovy: -------------------------------------------------------------------------------- 1 | package net.christophersnow.etl 2 | 3 | import org.springframework.boot.SpringApplication 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 5 | import org.springframework.context.annotation.ComponentScan 6 | import org.springframework.context.annotation.Configuration 7 | import org.springframework.scheduling.annotation.EnableScheduling 8 | 9 | @Configuration 10 | @ComponentScan 11 | @EnableAutoConfiguration 12 | @EnableScheduling 13 | class Application { 14 | 15 | public static void main(String... args) { 16 | SpringApplication.run(Application, args) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/SparkWordCountScala/src/main/scala/org/apache/spark/examples/WordCount.scala: -------------------------------------------------------------------------------- 1 | package org.apache.spark.examples 2 | 3 | import org.apache.spark.SparkContext 4 | import org.apache.spark.SparkContext._ 5 | import org.apache.spark.SparkConf 6 | 7 | object WordCount { 8 | def main(args: Array[String]) { 9 | 10 | val conf = new SparkConf().setAppName("Word Count") 11 | val sc = new SparkContext(conf) 12 | 13 | val textFile = sc.textFile(args(0)) 14 | val counts = textFile.flatMap(line => line.split(" ")) 15 | .map(word => (word, 1)) 16 | .reduceByKey(_ + _) 17 | 18 | val output = counts.collect() 19 | output.foreach(println) 20 | 21 | sc.stop() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/HBaseJava/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | import java.util.Map; 2 | 3 | import org.apache.hadoop.gateway.shell.Hadoop; 4 | import org.apache.hadoop.gateway.shell.hbase.HBase; 5 | import static java.util.concurrent.TimeUnit.SECONDS; 6 | 7 | public class Example { 8 | 9 | public static void main(String[] args) throws Exception { 10 | 11 | Map env = System.getenv(); 12 | 13 | Hadoop session = Hadoop.login( env.get("gateway"), env.get("username"), env.get("password") ); 14 | 15 | System.out.println("System version : " + HBase.session(session).systemVersion().now().getString()); 16 | 17 | System.out.println("Cluster version : " + HBase.session(session).clusterVersion().now().getString()); 18 | 19 | System.out.println("Status : " + HBase.session(session).status().now().getString()); 20 | 21 | session.shutdown(10, SECONDS); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/Jsqsh/gradle-app.setting: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/Ambari/RestartService.groovy: -------------------------------------------------------------------------------- 1 | // Restart service uses AmbariClient class which is defined in src/main/groovy/ 2 | // This class can be extended to do more action with ambari client. 3 | 4 | env = System.getenv() 5 | 6 | ambariUrl = env.ambariUrl 7 | ambariUser = env.ambariUsername 8 | ambariPassword = env.ambariPassword 9 | service = env.service_name 10 | 11 | def cluster = new AmbariClient( ambariUrl, ambariUser, ambariPassword ) 12 | 13 | def state = cluster.getState(service) 14 | 15 | if ( state == "STARTED" ) { 16 | println "\nStop service ${service}:" 17 | id = cluster.stopService(service) 18 | println "Check request ${id} : " + cluster.checkRequest(id) 19 | 20 | println "\nStart service ${service}: " 21 | id = cluster.startService(service) 22 | println "Check request ${id} : " + cluster.checkRequest(id) 23 | } else { 24 | println "\nStart service: " 25 | id = cluster.startService(service) 26 | println "Check request ${id} : " + cluster.checkRequest(id) 27 | } 28 | -------------------------------------------------------------------------------- /examples/HBaseJava/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'eclipse' 3 | 4 | // set the dependencies for running the groovy script 5 | buildscript { 6 | repositories { 7 | mavenCentral() 8 | } 9 | dependencies { 10 | classpath 'org.apache.knox:gateway-shell:0.6.0' 11 | } 12 | } 13 | 14 | // set the dependencies for compiling the groovy script 15 | repositories { 16 | mavenCentral() 17 | } 18 | 19 | dependencies { 20 | compile 'org.apache.knox:gateway-shell:0.6.0' 21 | } 22 | 23 | // task to run the groovy script 24 | task('Connect', type: JavaExec) { 25 | 26 | Properties props = new Properties() 27 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 28 | 29 | environment 'gateway', props.gateway 30 | environment 'username', props.username 31 | environment 'password', props.password 32 | 33 | main = 'Example' 34 | classpath = sourceSets.main.runtimeClasspath 35 | } 36 | 37 | task('Example') { 38 | dependsOn Connect 39 | } 40 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceCurl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | Properties props = new Properties() 4 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 5 | 6 | // set the dependencies for compiling the mapreduce classes 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | // compile MapReduce class 13 | compile(group: 'org.apache.hadoop', name: 'hadoop-common', version:'2.2.0') { } 14 | compile(group: 'org.apache.hadoop', name: 'hadoop-mapreduce-client-core', version:'2.2.0') { } 15 | } 16 | 17 | // Jar up the MapReduce classes and save in the samples folder 18 | jar { 19 | archiveName = 'hadoop-examples.jar' 20 | destinationDir = file('samples') 21 | } 22 | 23 | task('OozieMapReduce', dependsOn:'jar', type: Exec) { 24 | 25 | environment 'gateway', props.gateway 26 | environment 'username', props.username 27 | environment 'password', props.password 28 | 29 | if (project.hasProperty('debugExample')) { 30 | commandLine "bash", "-x", "MapReduce.sh" 31 | } else { 32 | commandLine "bash", "MapReduce.sh" 33 | } 34 | } 35 | 36 | task('Example') { 37 | dependsOn OozieMapReduce 38 | } 39 | -------------------------------------------------------------------------------- /examples/SparkSystemML/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | // ssh plugin documentation: https://gradle-ssh-plugin.github.io/docs/ 3 | id 'org.hidetake.ssh' version '1.5.0' 4 | } 5 | 6 | // load some common helper methods 7 | apply from: "${projectDir}/../../shared/common-helpers.gradle" 8 | 9 | // get the cluster connection details 10 | Properties props = new Properties() 11 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 12 | 13 | 14 | task LinearRegression << { 15 | 16 | ssh.run { 17 | // remotes.bicluster is defined in shared/common-helpers.gradle 18 | session(remotes.bicluster) { 19 | try { 20 | // initialise kerberos 21 | execute "kinit -k -t ${props.username}.keytab ${props.username}@IBM.COM" 22 | } 23 | catch (Exception e) { 24 | println "kinit not found so not renewing kerberos ticket - maybe this is a Basic cluster?" 25 | } 26 | 27 | put from: "${projectDir}/LinearRegression.sh", 28 | into: "./LinearRegression.sh" 29 | 30 | // dos2unix incase users have edited on windows 31 | execute "sed -i 's/\r//' ./LinearRegression.sh" 32 | 33 | execute "bash ./LinearRegression.sh" 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /examples/WebHdfsCurl/Mkdir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # abort script if any commands return an error 20 | set -e 21 | 22 | DIR="/user/${username}/test-$(date +%s)" 23 | 24 | # create the temporary directory 25 | curl -s -i -k -u ${username}:${password} -X PUT \ 26 | "${gateway}/webhdfs/v1/${DIR}?op=MKDIRS" | grep 'HTTP/1.1 200 OK' 27 | 28 | # clean up - remove the temporary directory 29 | curl -s -i -k -u ${username}:${password} -X DELETE \ 30 | "${gateway}/webhdfs/v1/${DIR}?op=DELETE&recursive=true" | grep 'HTTP/1.1 200 OK' 31 | 32 | printf "\n>> Mkdir test was successful.\n\n" 33 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/Connect.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.sql.Sql 20 | 21 | env = System.getenv() 22 | 23 | url = "jdbc:db2://${env.hostname}:51000/bigsql:sslConnection=true;sslTrustStoreLocation=./truststore.jks;Password=mypassword;" 24 | 25 | db = [ url:url, user:env.username, password:env.password, driver:'com.ibm.db2.jcc.DB2Driver'] 26 | 27 | sql = Sql.newInstance(db.url, db.user, db.password, db.driver) 28 | 29 | // test connectivity 30 | 31 | def rows = sql.rows("SELECT 1 FROM SYSIBM.SYSDUMMY1") 32 | assert rows.size() == 1 33 | 34 | println "\n>> Connectivity test was successful." 35 | -------------------------------------------------------------------------------- /examples/BigSQLJava/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | import java.sql.*; 2 | import java.util.Map; 3 | 4 | public class Example { 5 | 6 | public static void main(String[] args) throws Exception { 7 | 8 | // NOTE: truststore.jks is created by build.gradle 9 | 10 | final String connOptions = "sslConnection=true;sslTrustStoreLocation=./truststore.jks;Password=mypassword;"; 11 | 12 | // Hostname, Username and Password are passed in through the environment 13 | 14 | Map env = System.getenv(); 15 | 16 | final String db = String.format( 17 | "jdbc:db2://%s:51000/bigsql:%s", env.get("hostname"), connOptions 18 | ); 19 | 20 | final String user = env.get("username"); 21 | final String pwd = env.get("password"); 22 | 23 | Connection conn = null; 24 | Statement stmt = null; 25 | 26 | Class.forName("com.ibm.db2.jcc.DB2Driver"); 27 | 28 | conn = DriverManager.getConnection(db, user, pwd); 29 | 30 | stmt = conn.createStatement(); 31 | String sql = "SELECT 99 as ID FROM SYSIBM.SYSDUMMY1"; 32 | ResultSet rs = stmt.executeQuery(sql); 33 | 34 | rs.next(); // Go to first record 35 | 36 | // Check our query returned the expected result 37 | 38 | if (rs.getInt("ID") != 99) { 39 | throw new RuntimeException("Test failed attemping to connect to BigSql"); 40 | } 41 | 42 | rs.close(); 43 | stmt.close(); 44 | conn.close(); 45 | 46 | System.out.println("\n>> Connectivity test was successful."); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/Ls.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.json.JsonSlurper 20 | import org.apache.hadoop.gateway.shell.Hadoop 21 | import org.apache.hadoop.gateway.shell.hdfs.Hdfs 22 | 23 | env = System.getenv() 24 | 25 | session = Hadoop.login( env.gateway, env.username, env.password ) 26 | 27 | // list files in the root folder '/' 28 | text = Hdfs.ls( session ).dir( "/" ).now().string 29 | json = (new JsonSlurper()).parseText( text ) 30 | 31 | // print out the contents 32 | println "\n>> " + json.FileStatuses.FileStatus.pathSuffix 33 | 34 | session.shutdown() 35 | 36 | println "\n>> Ls test was successful." 37 | -------------------------------------------------------------------------------- /examples/WebHdfsCurl/Ls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # We want to list the contents of the root folder 20 | DIR="/" 21 | 22 | # execute curl and save the output 23 | OUTPUT=$(curl -v -s -i -k -u ${username}:${password} -X GET \ 24 | "${gateway}/webhdfs/v1/${DIR}?op=LISTSTATUS") 25 | 26 | # was the curl command successful? 27 | SUCCESS="$(echo $OUTPUT | grep -c 'HTTP/1.1 200 OK')" 28 | 29 | # show the output from the curl command 30 | echo $OUTPUT 31 | 32 | if [[ $SUCCESS == 1 ]] 33 | then 34 | printf "\n>> Ls test was successful.\n\n" 35 | exit 0 36 | else 37 | printf "\n>> Ls test was not successful.\n\n" 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /examples/Ambari/ListServices.groovy: -------------------------------------------------------------------------------- 1 | import groovyx.net.http.RESTClient 2 | import groovy.json.JsonSlurper 3 | 4 | env = System.getenv() 5 | 6 | ambariUrl = env.ambariUrl 7 | ambariUser = env.ambariUsername 8 | ambariPassword = env.ambariPassword 9 | 10 | println "\nAmbari URL: " + ambariUrl 11 | def client = new RESTClient( ambariUrl ) 12 | client.ignoreSSLIssues() 13 | 14 | client.headers['Authorization'] = 'Basic ' + "$ambariUser:$ambariPassword".getBytes('iso-8859-1').encodeBase64() 15 | client.headers['X-Requested-By'] = 'ambari' 16 | 17 | // Make REST call to get clusters 18 | def resp = client.get( path : 'api/v1/clusters' ) 19 | 20 | assert resp.status == 200 // HTTP response code; 404 means not found, etc. 21 | 22 | // Parse output to JSON 23 | def jsonSlurper = new JsonSlurper() 24 | def object = jsonSlurper.parseText(resp.data.text) 25 | 26 | // Get Cluster Name 27 | clusterName = object.items.Clusters[0].cluster_name 28 | println "\nCluster name is: " + clusterName 29 | 30 | // Make REST to get services 31 | def respServices = client.get( path : 'api/v1/clusters/' + clusterName + '/services' ) 32 | 33 | assert respServices.status == 200 // HTTP response code; 404 means not found, etc. 34 | 35 | // Get services 36 | def object_services = jsonSlurper.parseText(respServices.data.text) 37 | 38 | println "\nServices are: " 39 | object_services.items.eachWithIndex { serviceName, index -> 40 | println "service ${index}: ${serviceName.ServiceInfo.service_name}" 41 | } 42 | 43 | -------------------------------------------------------------------------------- /examples/HBaseGroovy/Connect.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import org.apache.hadoop.gateway.shell.Hadoop 20 | import org.apache.hadoop.gateway.shell.hbase.HBase 21 | 22 | import static java.util.concurrent.TimeUnit.SECONDS 23 | 24 | tableName = "test_table" 25 | 26 | def env = System.getenv() 27 | session = Hadoop.login( env.gateway, env.username, env.password ) 28 | 29 | println ">> System version : " + HBase.session(session).systemVersion().now().string 30 | 31 | println ">> Cluster version : " + HBase.session(session).clusterVersion().now().string 32 | 33 | println ">> Status : " + HBase.session(session).status().now().string 34 | 35 | session.shutdown(10, SECONDS) 36 | 37 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/Mkdir.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.json.JsonSlurper 20 | import org.apache.hadoop.gateway.shell.Hadoop 21 | import org.apache.hadoop.gateway.shell.hdfs.Hdfs 22 | 23 | env = System.getenv() 24 | 25 | session = Hadoop.login( env.gateway, env.username, env.password ) 26 | 27 | // makde a name for the folder using the current timestamp 28 | tmpDir = "/user/${env.username}/test-${new Date().getTime()}" 29 | 30 | // create the directory 31 | Hdfs.mkdir( session ).dir( tmpDir ).now() 32 | 33 | // remove the directory 34 | Hdfs.rm( session ).file( tmpDir ).recursive().now() 35 | 36 | session.shutdown() 37 | 38 | println "\n>> Mkdir test was successful." 39 | -------------------------------------------------------------------------------- /examples/SparkWordCountPython/wordcount.py: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | from __future__ import print_function 19 | 20 | import sys 21 | from operator import add 22 | 23 | from pyspark import SparkContext 24 | 25 | 26 | if __name__ == "__main__": 27 | if len(sys.argv) != 2: 28 | print("Usage: wordcount ", file=sys.stderr) 29 | exit(-1) 30 | sc = SparkContext(appName="PythonWordCount") 31 | lines = sc.textFile(sys.argv[1], 1) 32 | counts = lines.flatMap(lambda x: x.split(' ')) \ 33 | .map(lambda x: (x, 1)) \ 34 | .reduceByKey(add) 35 | output = counts.collect() 36 | for (word, count) in output: 37 | print("%s: %i" % (word, count)) 38 | 39 | sc.stop() 40 | -------------------------------------------------------------------------------- /examples/HBaseGroovy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | 3 | // set the dependencies for running the groovy script 4 | buildscript { 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 10 | classpath 'org.apache.knox:gateway-shell:0.8.0' 11 | } 12 | } 13 | 14 | // set the dependencies for compiling the groovy script 15 | repositories { 16 | mavenCentral() 17 | } 18 | 19 | dependencies { 20 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 21 | compile 'org.apache.knox:gateway-shell:0.8.0' 22 | } 23 | 24 | // tell gradle the groovy script is in the same folder as the build.gradle file 25 | sourceSets { 26 | main { 27 | groovy { 28 | srcDirs = ['.'] 29 | } 30 | 31 | // switch on debug output with ./gradlew Example -PdebugExample 32 | if (project.hasProperty('debugExample')) { 33 | resources { 34 | srcDirs = ['resources'] 35 | } 36 | } 37 | } 38 | } 39 | 40 | Properties props = new Properties() 41 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 42 | 43 | 44 | // task to run groovy script 45 | ['Connect', 'CRUD'].each { taskName -> 46 | task "$taskName" (type: JavaExec) { 47 | 48 | environment 'gateway', props.gateway 49 | environment 'username', props.username 50 | environment 'password', props.password 51 | 52 | main = taskName 53 | classpath = sourceSets.main.runtimeClasspath 54 | } 55 | } 56 | 57 | task('Example') { 58 | dependsOn Connect, CRUD 59 | } 60 | -------------------------------------------------------------------------------- /examples/HiveJava/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | import java.sql.*; 2 | import java.util.Map; 3 | import java.util.Date; 4 | 5 | public class Example { 6 | 7 | public static void main(String[] args) throws Exception { 8 | 9 | // truststore.jks is created by the build.gradle script 10 | 11 | final String connOptions = "ssl=true;sslTrustStore=./truststore.jks;trustStorePassword=mypassword;"; 12 | 13 | // Hostname, Username and Password are passed in through the environment 14 | 15 | Map env = System.getenv(); 16 | 17 | final String db = String.format( 18 | "jdbc:hive2://%s:10000/default;%s", env.get("hostname"), connOptions 19 | ); 20 | 21 | final String user = env.get("username"); 22 | final String pwd = env.get("password"); 23 | 24 | 25 | Connection conn = null; 26 | Statement stmt = null; 27 | 28 | Class.forName("org.apache.hive.jdbc.HiveDriver"); 29 | 30 | conn = DriverManager.getConnection(db, user, pwd); 31 | 32 | stmt = conn.createStatement(); 33 | 34 | String tmpTableName = String.format("%s_temp_%s", 35 | env.get("username"), 36 | new Date().getTime() 37 | ); 38 | 39 | stmt.execute( 40 | String.format("create table %s ( id int, name string )", tmpTableName) 41 | ); 42 | System.out.println("\n>> Create Table"); 43 | 44 | stmt.execute( 45 | String.format("drop table %s", tmpTableName) 46 | ); 47 | System.out.println("\n>> Drop Table"); 48 | 49 | stmt.close(); 50 | conn.close(); 51 | 52 | System.out.println("\n>> Connectivity test was successful."); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/send_message.py: -------------------------------------------------------------------------------- 1 | from kafka import KafkaProducer 2 | from kafka.errors import KafkaError 3 | import ssl 4 | import sys 5 | import json 6 | 7 | if len(sys.argv) != 2: 8 | sys.exit("Usage: ./send_message.py text_to_send") 9 | 10 | with open('vcap.json') as data_file: 11 | mhProps = json.load(data_file) 12 | 13 | bootstrap_servers = mhProps['kafka_brokers_sasl'] 14 | sasl_plain_username = mhProps['user'] 15 | sasl_plain_password = mhProps['password'] 16 | topic = mhProps['topic'] 17 | 18 | text_to_send = sys.argv[1].encode() 19 | 20 | 21 | sasl_mechanism = 'PLAIN' 22 | security_protocol = 'SASL_SSL' 23 | 24 | # Create a new context using system defaults, disable all but TLS1.2 25 | context = ssl.create_default_context() 26 | context.options &= ssl.OP_NO_TLSv1 27 | context.options &= ssl.OP_NO_TLSv1_1 28 | 29 | producer = KafkaProducer(bootstrap_servers = bootstrap_servers, 30 | sasl_plain_username = sasl_plain_username, 31 | sasl_plain_password = sasl_plain_password, 32 | security_protocol = security_protocol, 33 | ssl_context = context, 34 | sasl_mechanism = sasl_mechanism, 35 | api_version=(0,10)) 36 | 37 | # Asynchronous by default 38 | future = producer.send(topic, text_to_send) 39 | 40 | try: 41 | record_metadata = future.get(timeout=10) 42 | except KafkaError: 43 | log.exception() 44 | pass 45 | 46 | # Successful result returns assigned partition and offset 47 | print ('topic', record_metadata.topic) 48 | print ('partition', record_metadata.partition) 49 | print ('offset', record_metadata.offset) 50 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/send_message.py: -------------------------------------------------------------------------------- 1 | from kafka import KafkaProducer 2 | from kafka.errors import KafkaError 3 | import ssl 4 | import sys 5 | import json 6 | 7 | if len(sys.argv) != 2: 8 | sys.exit("Usage: ./send_message.py text_to_send") 9 | 10 | with open('vcap.json') as data_file: 11 | mhProps = json.load(data_file) 12 | 13 | bootstrap_servers = mhProps['kafka_brokers_sasl'] 14 | sasl_plain_username = mhProps['user'] 15 | sasl_plain_password = mhProps['password'] 16 | topic = mhProps['topic'] 17 | 18 | text_to_send = sys.argv[1].encode() 19 | 20 | 21 | sasl_mechanism = 'PLAIN' 22 | security_protocol = 'SASL_SSL' 23 | 24 | # Create a new context using system defaults, disable all but TLS1.2 25 | context = ssl.create_default_context() 26 | context.options &= ssl.OP_NO_TLSv1 27 | context.options &= ssl.OP_NO_TLSv1_1 28 | 29 | producer = KafkaProducer(bootstrap_servers = bootstrap_servers, 30 | sasl_plain_username = sasl_plain_username, 31 | sasl_plain_password = sasl_plain_password, 32 | security_protocol = security_protocol, 33 | ssl_context = context, 34 | sasl_mechanism = sasl_mechanism, 35 | api_version=(0,10)) 36 | 37 | # Asynchronous by default 38 | future = producer.send(topic, text_to_send) 39 | 40 | try: 41 | record_metadata = future.get(timeout=10) 42 | except KafkaError: 43 | log.exception() 44 | pass 45 | 46 | # Successful result returns assigned partition and offset 47 | print ('topic', record_metadata.topic) 48 | print ('partition', record_metadata.partition) 49 | print ('offset', record_metadata.offset) 50 | -------------------------------------------------------------------------------- /examples/HiveGroovy/Example.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.sql.Sql 20 | 21 | env = System.getenv() 22 | 23 | // truststore is created with the cluster's certificate by the build.gradle script 24 | url = "jdbc:hive2://${env.hostname}:10000/default;ssl=true;sslTrustStore=./truststore.jks;trustStorePassword=mypassword;" 25 | 26 | db = [ url:url, user:env.username, password:env.password, driver:'org.apache.hive.jdbc.HiveDriver'] 27 | 28 | sql = Sql.newInstance(db.url, db.user, db.password, db.driver) 29 | 30 | // test connectivity 31 | 32 | tmpTableName = "${env.username}_temp_${new Date().getTime()}" 33 | 34 | println ">> Create table" 35 | sql.execute """ 36 | create table ${tmpTableName} ( id int, name string ) 37 | """.toString() 38 | 39 | println ">> Drop table" 40 | sql.execute """ 41 | drop table ${tmpTableName} purge 42 | """.toString() 43 | 44 | println "\n>> Hive test was successful." 45 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/hadoop-deploy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | apply plugin: 'java' 3 | apply plugin: 'eclipse' 4 | // need to include spark libs in jar 5 | apply plugin: 'com.github.johnrengelman.shadow' 6 | 7 | // set the dependencies for running the groovy script 8 | buildscript { 9 | repositories { 10 | mavenCentral() 11 | jcenter() 12 | } 13 | dependencies { 14 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 15 | classpath 'org.apache.knox:gateway-shell:0.6.0' 16 | // uberjar 17 | classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2' 18 | } 19 | } 20 | 21 | // set the dependencies for compiling the groovy script and mapreduce classes 22 | repositories { 23 | mavenCentral() 24 | } 25 | 26 | dependencies { 27 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 28 | compile 'org.apache.knox:gateway-shell:0.6.0' 29 | // compile Spark class 30 | compile 'org.apache.spark:spark-core_2.10:1.4.1' 31 | } 32 | 33 | sourceCompatibility = 1.7 34 | targetCompatibility = 1.7 35 | 36 | // tell gradle the groovy script is in the same folder as the build.gradle file 37 | sourceSets { 38 | main { 39 | groovy { 40 | srcDirs = ['.'] 41 | } 42 | } 43 | } 44 | 45 | // task to run the groovy script 46 | task('Setup', dependsOn:'jar', type: JavaExec) { 47 | 48 | Properties props = new Properties() 49 | props.load(new FileInputStream("$projectDir/../../../connection.properties")) 50 | 51 | environment 'gateway', props.gateway 52 | environment 'username', props.username 53 | environment 'password', props.password 54 | 55 | main = 'Setup' 56 | classpath = sourceSets.main.runtimeClasspath 57 | } 58 | -------------------------------------------------------------------------------- /examples/SparkSystemML/LinearRegression.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SPARK_HOME=/usr/iop/4.3.0.0/spark2/ 4 | SYSTEMML_CLASS=org.apache.sysml.api.DMLScript 5 | SYSTEMML_JAR=/usr/iop/current/systemml-client/lib/systemml.jar 6 | SYSTEMML_SCRIPTS=/usr/iop/current/systemml-client/scripts 7 | 8 | submit() 9 | { 10 | ${SPARK_HOME}/bin/spark-submit \ 11 | --master yarn --deploy-mode cluster \ 12 | --class ${SYSTEMML_CLASS} ${SYSTEMML_JAR} \ 13 | -f ${SYSTEMML_SCRIPTS}/$1 \ 14 | -exec spark \ 15 | -nvargs $2 16 | } 17 | 18 | # Abort if any command fails 19 | set -e 20 | 21 | echo 22 | echo "Submit genLinearRegressionData" 23 | submit datagen/genLinearRegressionData.dml 'numSamples=1000 numFeatures=50 maxFeatureValue=5 maxWeight=5 addNoise=FALSE b=0 sparsity=0.7 output=linRegData.csv format=csv perc=0.5' 24 | rc=$? 25 | 26 | echo 27 | echo "Submit Sample" 28 | submit utils/sample.dml 'X=linRegData.csv sv=perc.csv O=linRegDataParts ofmt=csv' 29 | rc=$? 30 | 31 | echo 32 | echo "Submit splitXY train" 33 | submit utils/splitXY.dml 'X=linRegDataParts/1 y=51 OX=linRegData.train.data.csv OY=linRegData.train.labels.csv ofmt=csv' 34 | rc=$? 35 | 36 | echo 37 | echo "Submit splitXY test data" 38 | submit utils/splitXY.dml 'X=linRegDataParts/2 y=51 OX=linRegData.test.data.csv OY=linRegData.test.labels.csv ofmt=csv' 39 | rc=$? 40 | 41 | echo 42 | echo "Submit LinearRegDS" 43 | submit algorithms/LinearRegDS.dml 'X=linRegData.train.data.csv Y=linRegData.train.labels.csv B=betas.csv fmt=csv' 44 | rc=$? 45 | 46 | ### This Steps is commented out for now 47 | ### See JIRA: https://issues.apache.org/jira/browse/SYSTEMML-955 48 | # echo 49 | # echo "Submit GLM-predict" 50 | # submit algorithms/GLM-predict.dml 'X=linRegData.test.data.csv Y=linRegData.test.labels.csv B=betas.csv fmt=csv' 51 | # rc=$? 52 | 53 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | apply plugin: 'java' 3 | apply plugin: 'eclipse' 4 | // need to include spark libs in jar 5 | apply plugin: 'com.github.johnrengelman.shadow' 6 | 7 | // set the dependencies for running the groovy script 8 | buildscript { 9 | repositories { 10 | mavenCentral() 11 | jcenter() 12 | } 13 | dependencies { 14 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 15 | classpath 'org.apache.knox:gateway-shell:0.6.0' 16 | // uberjar 17 | classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2' 18 | } 19 | } 20 | 21 | // set the dependencies for compiling the groovy script and mapreduce classes 22 | repositories { 23 | mavenCentral() 24 | } 25 | 26 | dependencies { 27 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 28 | compile 'org.apache.knox:gateway-shell:0.6.0' 29 | // compile Spark class 30 | compile 'org.apache.spark:spark-core_2.10:1.4.1' 31 | } 32 | 33 | sourceCompatibility = 1.7 34 | targetCompatibility = 1.7 35 | 36 | // tell gradle the groovy script is in the same folder as the build.gradle file 37 | sourceSets { 38 | main { 39 | groovy { 40 | srcDirs = ['.'] 41 | } 42 | } 43 | } 44 | 45 | // task to run the groovy script 46 | task('OozieMapReduce', dependsOn:'jar', type: JavaExec) { 47 | 48 | Properties props = new Properties() 49 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 50 | 51 | environment 'gateway', props.gateway 52 | environment 'username', props.username 53 | environment 'password', props.password 54 | 55 | main = 'Example' 56 | classpath = sourceSets.main.runtimeClasspath 57 | } 58 | 59 | task('Example') { 60 | dependsOn OozieMapReduce 61 | } 62 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | 3 | Properties props = new Properties() 4 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 5 | 6 | // set the dependencies for running the groovy script 7 | buildscript { 8 | repositories { 9 | mavenCentral() 10 | } 11 | dependencies { 12 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 13 | classpath 'org.apache.knox:gateway-shell:0.8.0' 14 | } 15 | } 16 | 17 | // set the dependencies for compiling the groovy script 18 | repositories { 19 | mavenCentral() 20 | } 21 | 22 | dependencies { 23 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 24 | compile 'org.apache.knox:gateway-shell:0.8.0' 25 | } 26 | 27 | // tell gradle the groovy script is in the same folder as the build.gradle file 28 | sourceSets { 29 | main { 30 | groovy { 31 | srcDirs = ['.'] 32 | } 33 | // You can update log4j.properties under resources directory 34 | // to set logging level e.g. DEBUG 35 | resources { 36 | srcDirs = ['resources'] 37 | } 38 | } 39 | } 40 | 41 | 42 | // task to run the groovy script 43 | ['Ls', 'Mkdir', 'Put'].each { taskName -> 44 | task "$taskName" (type: JavaExec) { 45 | 46 | // pass the connection details from the connection.properties file 47 | // as environment variables that can be accessed from the example groovy script 48 | 49 | environment 'gateway', props.gateway 50 | environment 'username', props.username 51 | environment 'password', props.password 52 | 53 | // compile the groovy script and run it as a java application 54 | 55 | main = taskName 56 | classpath = sourceSets.main.runtimeClasspath 57 | } 58 | } 59 | 60 | task('Example') { 61 | dependsOn Ls, Mkdir, Put 62 | } 63 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/Put.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.json.JsonSlurper 20 | import org.apache.hadoop.gateway.shell.Hadoop 21 | import org.apache.hadoop.gateway.shell.hdfs.Hdfs 22 | 23 | env = System.getenv() 24 | 25 | session = Hadoop.login( env.gateway, env.username, env.password ) 26 | 27 | // make a name for the folder using the current timestamp 28 | tmpDir = "/user/${env.username}/test-${new Date().getTime()}" 29 | 30 | // the name of the files to create 31 | tmpFile1 = "${tmpDir}/file1" 32 | tmpFile2 = "${tmpDir}/file2" 33 | 34 | // create a dir 35 | Hdfs.mkdir( session ).dir( tmpDir ).now() 36 | 37 | // create a file from a string 38 | Hdfs.put( session ).text( "hello world!" ).to( tmpFile1 ).now() 39 | 40 | // upload the local file example.txt 41 | Hdfs.put( session ).file( "example.txt" ).to( tmpFile2 ).now() 42 | 43 | // remove the dir 44 | Hdfs.rm( session ).file( tmpDir ).recursive().now() 45 | 46 | session.shutdown() 47 | 48 | println "\n>> Upload test was successful." 49 | -------------------------------------------------------------------------------- /examples/SparkWordCountPython/README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | This example shows how to execute the spark wordcount example on the BigInsights cluster. The wordcount is performed on an Apache 2 License file. 4 | 5 | ## Developer experience 6 | 7 | Developers will gain the most from these examples if they are: 8 | 9 | - Comfortable using Windows, OS X or *nix command prompts 10 | - Able to read code written in a high level language such as [Groovy](http://www.groovy-lang.org/) 11 | - Familiar with the [Gradle](https://gradle.org/) build tool 12 | - Familiar with Spark concepts 13 | 14 | ## Example Requirements 15 | 16 | - You meet the [pre-requisites](../../README.md#pre-requisites) in the top level [README](../../README.md) 17 | - You have performed the [setup instructions](../../README.md#setup-instructions) in the top level [README](../../README.md) 18 | 19 | ## Run the example 20 | 21 | To run the examples, in a command prompt window: 22 | 23 | - change into the directory containing this example and run gradle to execute the example 24 | - `./gradlew Example` (OS X / *nix) 25 | - `gradlew.bat Example` (Windows) 26 | 27 | Output from the command will contain the wordcounts: 28 | 29 | ``` 30 | ... 31 | bicluster#54|: 1136 32 | bicluster#54|limited: 4 33 | bicluster#54|all: 3 34 | bicluster#54|code: 1 35 | bicluster#54|managed: 1 36 | bicluster#54|customary: 1 37 | bicluster#54|Works,: 2 38 | bicluster#54|APPENDIX:: 1 39 | ... 40 | 41 | ``` 42 | ## Decomposition Instructions 43 | 44 | The [./build.gradle](./build.gradle) script runs the example. It uses a ssh plugin to: 45 | 46 | - copy [./wordcount.py](./wordcount.py) and [./LICENSE](./LICENSE) files to the BigInsights cluster 47 | - from the ssh session, use the `hadoop fs` command to add the LICENSE to hdfs 48 | - from the ssh session, execute the wordcount.py script with the `pyspark` command 49 | -------------------------------------------------------------------------------- /examples/WebHCatGroovy/src/main/java/org/apache/hadoop/gateway/shell/job/Job.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.hadoop.gateway.shell.job; 19 | 20 | import org.apache.hadoop.gateway.shell.Hadoop; 21 | 22 | public class Job { 23 | 24 | static String SERVICE_PATH = "/templeton/v1"; 25 | 26 | public static Java.Request submitJava( Hadoop session ) { 27 | return new Java.Request( session ); 28 | } 29 | 30 | public static Sqoop.Request submitSqoop( Hadoop session ) { 31 | return new Sqoop.Request( session ); 32 | } 33 | 34 | public static Pig.Request submitPig( Hadoop session ) { 35 | return new Pig.Request( session ); 36 | } 37 | 38 | public static Hive.Request submitHive( Hadoop session ) { 39 | return new Hive.Request( session ); 40 | } 41 | 42 | public static Queue.Request queryQueue( Hadoop session ) { 43 | return new Queue.Request( session ); 44 | } 45 | 46 | public static Status.Request queryStatus( Hadoop session ) { 47 | return new Status.Request( session ); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /examples/WebHdfsCurl/Put.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # abort script if any commands return an error 20 | set -e 21 | 22 | # Uncomment to debug 23 | #set -x 24 | 25 | DIR="/user/${username}/test-$(date +%s)" 26 | 27 | FILE="LICENSE" 28 | 29 | # create the temporary directory 30 | CMD="curl -s -i -k --negotiate -u ${username}: -X PUT '${gateway}/webhdfs/v1/${DIR}?op=MKDIRS' | grep 'HTTP/1.1 200 OK'" 31 | 32 | echo $CMD 33 | 34 | # register the name for the file, and get the location (use tr to strip header CRLF 35 | LOCATION=$(curl -s -i -k -u ${username}:${password} -X PUT "${gateway}/webhdfs/v1/${DIR}/${FILE}?op=CREATE" | tr -d '\r' | sed -En "s/^Location: (.*)$/\1/p") 36 | 37 | # cmd to send the file to the location 38 | curl -s -i -k -u ${username}:${password} -T ${FILE} -X PUT ${LOCATION} | grep 'HTTP/1.1 201 Created' 39 | 40 | # clean up - remove the temporary directory 41 | curl -s -i -k -u ${username}:${password} -X DELETE "${gateway}/webhdfs/v1/${DIR}?op=DELETE&recursive=true" | grep 'HTTP/1.1 200 OK' 42 | 43 | printf "\n>> Put test was successful.\n\n" 44 | -------------------------------------------------------------------------------- /examples/Zeppelin/shiro.ini_template: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | [users] 19 | # List of users with their password allowed to access Zeppelin. 20 | #admin = password1 21 | #user1 = password2, role1, role2 22 | #user2 = password3, role3 23 | #user3 = password4, role2 24 | 25 | [main] 26 | sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager 27 | 28 | ### If caching of user is required then uncomment below lines 29 | #cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager 30 | #securityManager.cacheManager = $cacheManager 31 | 32 | securityManager.sessionManager = $sessionManager 33 | # 86,400,000 milliseconds = 24 hour 34 | securityManager.sessionManager.globalSessionTimeout = 86400000 35 | shiro.loginUrl = /api/login 36 | 37 | [roles] 38 | role1 = * 39 | role2 = * 40 | role3 = * 41 | 42 | [urls] 43 | # anon means the access is anonymous. 44 | # authcBasic means Basic Auth Security 45 | # authc means Form based Auth Security 46 | # To enfore security, comment the line below and uncomment the next one 47 | /api/version = anon 48 | #/** = anon 49 | /** = authc 50 | -------------------------------------------------------------------------------- /examples/Knoxshell/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.github.tkruse.groovysh' 2 | apply plugin: 'java' 3 | 4 | import org.apache.tools.ant.taskdefs.condition.Os 5 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 6 | throw new GradleException("You appear to be running on a Windows machine. This example does not support Windows.") 7 | } 8 | 9 | // set the dependencies for running the groovy script 10 | buildscript { 11 | repositories { 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath 'org.apache.knox:gateway-shell:0.6.0' 16 | classpath 'com.tkruse.gradle:gradle-groovysh-plugin:1.0.7' 17 | } 18 | } 19 | 20 | // set the dependencies for compiling the groovy script 21 | repositories { 22 | mavenCentral() 23 | } 24 | 25 | dependencies { 26 | compile 'org.apache.knox:gateway-shell:0.6.0' 27 | compile 'commons-io:commons-io:2.4' 28 | } 29 | 30 | Properties props = new Properties() 31 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 32 | 33 | groovysh { 34 | shell { 35 | environment = [ 36 | 'gateway':props.gateway, 37 | 'username':props.username, 38 | 'password':props.password 39 | ] 40 | args = [ 41 | '-e', 42 | 'import org.apache.hadoop.gateway.shell.Hadoop;' + 43 | 'import org.apache.hadoop.gateway.shell.hdfs.Hdfs;' + 44 | 'import org.apache.hadoop.gateway.shell.job.Job;' + 45 | 'import org.apache.hadoop.gateway.shell.workflow.Workflow;' + 46 | 'import org.apache.hadoop.gateway.shell.yarn.Yarn;' + 47 | 'import groovy.json.JsonSlurper;' + 48 | 'import java.util.concurrent.TimeUnit;\n' + 49 | """session = Hadoop.login( "${props.gateway}", "${props.username}", "${props.password}" );\n""" + 50 | 'slurper = new JsonSlurper();\n' 51 | ] 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /examples/HiveBeeline/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'groovy' 3 | id 'org.hidetake.ssh' version '1.5.0' 4 | } 5 | 6 | import org.apache.tools.ant.taskdefs.condition.Os 7 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 8 | throw new GradleException("You appear to be running on a Windows machine. This example does not support Windows.") 9 | } 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 17 | compile 'org.apache.hive:hive-beeline:2.0.0' 18 | } 19 | 20 | Properties props = new Properties() 21 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 22 | 23 | // load some common helper methods 24 | apply from: "${projectDir}/../../shared/common-helpers.gradle" 25 | 26 | // Get Hive server host name 27 | def hostname = getMasters(props)['HIVE_SERVER'][0] 28 | 29 | // task to run a script 30 | task('Example', type: JavaExec) { 31 | 32 | if (!(file("${projectDir}/../../certificate").exists())) { 33 | throw new GradleException("'certificate' file could not be found in ${projectDir.parentFile.parentFile}") 34 | } 35 | 36 | // import the BigInsights manager certificate 37 | println '>> Creating key store\n' 38 | ant.exec(executable: "${getKeytoolPath()}", dir:'./') { 39 | arg(line: '-import -trustcacerts -alias biginsights -file ../../certificate -keystore ./truststore.jks -storepass mypassword -noprompt') 40 | } 41 | 42 | // run the Beeline client 43 | println '>> Starting Beeline and connect to Hive\n' 44 | main = 'org.apache.hive.beeline.BeeLine' 45 | classpath = sourceSets.main.runtimeClasspath 46 | args = [ 47 | "-u", "jdbc:hive2://${hostname}:10000/default;ssl=true;sslTrustStore=${projectDir.absolutePath.replaceAll(/\\+/, '/')}/truststore.jks;", 48 | "-n", props.username, 49 | "-p", props.password 50 | ] 51 | standardInput = System.in 52 | } 53 | -------------------------------------------------------------------------------- /examples/Zeppelin/zeppelin_uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # abort script if any commands return an error 20 | set -e 21 | 22 | # debug output 23 | set -x 24 | 25 | ZEPPELIN=zeppelin-0.6.0-bin-all 26 | 27 | # zeppelin isn't installed so we can just exit 28 | if [[ ! -d ./${ZEPPELIN} ]] 29 | then 30 | echo 'Existing zeppelin install not found, so exiting' 31 | exit 0 32 | fi 33 | 34 | # suppress any errors trying to run zeppelin-daemon.sh stop 35 | ./${ZEPPELIN}/bin/zeppelin-daemon.sh stop | echo -n '' 36 | 37 | BACKUP_DATE=$(date +%Y%m%d%H%M%S) 38 | BACKUP_DIR=./zeppelin_backup_${BACKUP_DATE} 39 | 40 | mkdir -p ${BACKUP_DIR}/conf 41 | mkdir -p ${BACKUP_DIR}/notebook 42 | 43 | cp -rvf ./${ZEPPELIN}/conf/* ./${BACKUP_DIR}/conf 44 | cp -rvf ./${ZEPPELIN}/notebook/* ./${BACKUP_DIR}/notebook 45 | 46 | echo '\n\n' 47 | echo "** INFO: zeppelin conf and notebook folders backed up to ${BACKUP_DIR}" 48 | echo '\n\n' 49 | 50 | rm -rf ./${ZEPPELIN} 51 | 52 | rm -f ${ZEPPELIN}.tgz 53 | rm -f ${ZEPPELIN}.tgz.* 54 | rm -f zeppelin_install.sh 55 | rm -f zeppelin_uninstall.sh 56 | rm -f zeppelin_env.sh 57 | rm -f setup.R 58 | 59 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceGroovy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | apply plugin: 'java' 3 | 4 | // set the dependencies for running the groovy script 5 | buildscript { 6 | repositories { 7 | mavenCentral() 8 | } 9 | dependencies { 10 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 11 | classpath 'org.apache.knox:gateway-shell:0.8.0' 12 | } 13 | } 14 | 15 | // set the dependencies for compiling the groovy script and mapreduce classes 16 | repositories { 17 | mavenCentral() 18 | } 19 | 20 | dependencies { 21 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 22 | compile 'org.apache.knox:gateway-shell:0.8.0' 23 | // compile MapReduce class 24 | compile(group: 'org.apache.hadoop', name: 'hadoop-common', version:'2.2.0') { } 25 | compile(group: 'org.apache.hadoop', name: 'hadoop-mapreduce-client-core', version:'2.2.0') { } 26 | } 27 | 28 | // tell gradle the groovy script is in the same folder as the build.gradle file 29 | sourceSets { 30 | main { 31 | groovy { 32 | srcDirs = ['.'] 33 | } 34 | // uncomment to enable http debugging 35 | // run './gradlew clean' after commenting/uncommenting 36 | resources { 37 | // srcDirs = ['resources'] 38 | } 39 | } 40 | } 41 | 42 | // MapReduce classes 43 | jar { 44 | archiveName = 'hadoop-examples.jar' 45 | destinationDir = file('samples') 46 | } 47 | 48 | // task to run the groovy script 49 | task('OozieMapReduce', dependsOn:'jar', type: JavaExec) { 50 | 51 | Properties props = new Properties() 52 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 53 | 54 | environment 'gateway', props.gateway 55 | environment 'username', props.username 56 | environment 'password', props.password 57 | 58 | main = 'Example' 59 | classpath = sourceSets.main.runtimeClasspath 60 | } 61 | 62 | task('Example') { 63 | dependsOn OozieMapReduce 64 | } 65 | -------------------------------------------------------------------------------- /examples/Zeppelin/zeppelin_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # abort script if any commands return an error 20 | set -e 21 | 22 | # debugging - echo commands as they are executed 23 | set -x 24 | 25 | ZEPPELIN=zeppelin-0.6.0-bin-all 26 | 27 | if [[ -d ./${ZEPPELIN} ]] 28 | then 29 | echo "*******" 30 | echo "ERROR: Found existing ${ZEPPELIN} installation. Uninstall before retrying the installation." 31 | echo "*******" 32 | exit 0 33 | fi 34 | 35 | cat << EOF > ${ZEPPELIN}.tgz.md5 36 | 62a018ccbcc9bbff254bed3001b31b29 zeppelin-0.6.0-bin-all.tgz 37 | EOF 38 | 39 | if [[ ! -e ${ZEPPELIN}.tgz || "$(md5sum -c --status ${ZEPPELIN}.tgz.md5)" != 0 ]] 40 | then 41 | echo "Couldn't find ${ZEPPELIN}.tgz so downloading now ..." 42 | wget -q http://archive.apache.org/dist/zeppelin/zeppelin-0.6.0/${ZEPPELIN}.tgz 43 | fi 44 | 45 | tar xzf ${ZEPPELIN}.tgz 46 | 47 | # copy the zeppelin environment variable script to the conf folder 48 | cp ./zeppelin_env.sh ./${ZEPPELIN}/conf/zeppelin-env.sh 49 | 50 | # load the zeppelin envivonment variables 51 | source ./${ZEPPELIN}/conf/zeppelin-env.sh 52 | 53 | ./${ZEPPELIN}/bin/zeppelin-daemon.sh start 54 | 55 | -------------------------------------------------------------------------------- /examples/HiveJava/build.gradle: -------------------------------------------------------------------------------- 1 | // set the dependencies for running the groovy script 2 | buildscript { 3 | repositories { 4 | mavenCentral() 5 | } 6 | dependencies { 7 | classpath 'org.apache.hive:hive-jdbc:2.0.0' 8 | } 9 | } 10 | 11 | plugins { 12 | id 'groovy' 13 | id 'org.hidetake.ssh' version '1.5.0' 14 | } 15 | 16 | // set the dependencies for compiling the groovy script 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | // compile('org.apache.hive:hive-jdbc:2.0.0') { 23 | // exclude group:'org.apache.logging.log4j', module:'log4j-slf4j-impl' 24 | // } 25 | compile('org.apache.hive:hive-jdbc:2.0.0') 26 | } 27 | 28 | sourceSets { 29 | main { 30 | resources { 31 | srcDir file('.') include 'truststore.jks' 32 | } 33 | } 34 | } 35 | 36 | // load some common helper methods 37 | apply from: "${projectDir}/../../shared/common-helpers.gradle" 38 | 39 | // task to run a Java class 40 | task('CreateTable', type: JavaExec) { 41 | 42 | Properties props = new Properties() 43 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 44 | 45 | if (!(new File("${projectDir}/../../certificate").exists())) { 46 | throw new GradleException("'certificate' file could not be found in ${projectDir.parentFile.parentFile}") 47 | } 48 | 49 | delete './truststore.jks' 50 | 51 | // import the BigInsights manager certificate 52 | ant.exec(executable: 'keytool', dir:'./') { 53 | arg(line: '-import -trustcacerts -alias biginsights -file ../../certificate -keystore ./truststore.jks -storepass mypassword -noprompt') 54 | } 55 | 56 | // pass environment variables to the class 57 | environment 'hostname', getMasters(props)['HIVE_SERVER'][0] 58 | environment 'username', props.username 59 | environment 'password', props.password 60 | 61 | // run the class 62 | main = 'Example' 63 | classpath = sourceSets.main.runtimeClasspath 64 | } 65 | 66 | task('Example') { 67 | dependsOn CreateTable 68 | } 69 | -------------------------------------------------------------------------------- /examples/Ambari/build.gradle: -------------------------------------------------------------------------------- 1 | // set the dependencies for running the groovy script 2 | buildscript { 3 | repositories { 4 | mavenCentral() 5 | } 6 | dependencies { 7 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 8 | classpath 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1' 9 | } 10 | } 11 | 12 | plugins { 13 | id 'groovy' 14 | } 15 | 16 | // get the cluster connection details 17 | Properties props = new Properties() 18 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 19 | 20 | // Set default service name to check 21 | def service_name = "HDFS" 22 | 23 | // set the dependencies for compiling the groovy script 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | dependencies { 29 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 30 | compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1' 31 | } 32 | 33 | // tell gradle the groovy script is in the same folder as the build.gradle file 34 | sourceSets { 35 | main { 36 | groovy { 37 | srcDirs = ['.'] 38 | } 39 | } 40 | } 41 | 42 | // Get service name from command line argument 43 | // For example -Pservice=YARN. 44 | // See service ServiceCheck.grooyv for valid value 45 | if (project.hasProperty('service')) { 46 | service_name = service 47 | } 48 | 49 | // task to run the Example.groovy script 50 | ['ListServices', 'ShowMaster', 'AlertServices', 'HdfsServiceCheck', 'ServiceCheck', 'RestartService'].each { taskName -> 51 | task "$taskName" (type: JavaExec) { 52 | 53 | // if running this task with clean, ensure clean runs first 54 | mustRunAfter clean 55 | 56 | environment 'ambariUrl', props.ambariUrl 57 | environment 'ambariUsername', props.ambariUsername 58 | environment 'ambariPassword', props.ambariPassword 59 | environment 'service_name', service_name 60 | 61 | main = taskName 62 | classpath = sourceSets.main.runtimeClasspath 63 | } 64 | } 65 | 66 | task('Example') { 67 | 68 | dependsOn ListServices, HdfsServiceCheck, ShowMaster 69 | } 70 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/src/main/scala/biginsights/examples/MessageHubConsumer.scala: -------------------------------------------------------------------------------- 1 | package biginsights.examples 2 | 3 | import org.apache.spark.SparkContext 4 | import org.apache.spark.SparkContext._ 5 | import org.apache.spark.SparkConf 6 | 7 | import org.apache.spark.streaming.Duration 8 | import org.apache.spark.streaming.Seconds 9 | import org.apache.spark.streaming.StreamingContext 10 | import com.ibm.cds.spark.samples.config.MessageHubConfig 11 | import com.ibm.cds.spark.samples.dstream.KafkaStreaming.KafkaStreamingContextAdapter 12 | import org.apache.kafka.common.serialization.Deserializer 13 | import org.apache.kafka.common.serialization.StringDeserializer 14 | 15 | object MessageHubConsumer{ 16 | def main(args: Array[String]) { 17 | 18 | val sc = new SparkConf().setAppName("MessageHubConsumer") 19 | 20 | val appArgs = sc.get("spark.driver.args").split("\\s+") 21 | 22 | val kafkaProps = new MessageHubConfig 23 | 24 | kafkaProps.setConfig("bootstrap.servers", appArgs(0)) 25 | kafkaProps.setConfig("kafka.user.name", appArgs(1)) 26 | kafkaProps.setConfig("kafka.user.password", appArgs(2)) 27 | kafkaProps.setConfig("api_key", appArgs(3)) 28 | kafkaProps.setConfig("kafka_rest_url", appArgs(4)) 29 | kafkaProps.setConfig("kafka.topic", appArgs(5)) 30 | 31 | val username = appArgs(6) 32 | 33 | kafkaProps.createConfiguration() 34 | 35 | 36 | val ssc = new StreamingContext( sc, Seconds(60) ) 37 | 38 | val stream = ssc.createKafkaStream[String, String, StringDeserializer, StringDeserializer]( 39 | kafkaProps, 40 | List(kafkaProps.getConfig("kafka.topic")) 41 | ); 42 | 43 | stream.foreachRDD{ rdd => 44 | // we only want to create a folder in hdfs if we have some data 45 | if (rdd.count() > 0) { 46 | def uuid = java.util.UUID.randomUUID.toString 47 | val outDir = s"hdfs:///user/${username}/test-${uuid}" 48 | rdd.saveAsTextFile (outDir) 49 | } 50 | } 51 | 52 | stream.print() 53 | ssc.start() 54 | ssc.awaitTermination() 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/README_Federation.md: -------------------------------------------------------------------------------- 1 | 2 | # README for Big SQL Federation 3 | 4 | BIGSQL should be setup such that federation is on and appropriate library are in place to allow wrapper to function beetween BIGSQL and data source. 5 | 6 | **NOTE:** *Federation is not yet available on BigInsights on Cloud clusters* 7 | 8 | ## Setup client keystore for SSL 9 | 10 | Make sure to get the CA certificate file from DASHDB and copy it to `/home/bigsql/sqllib/security/keystore/DigiCertGlobalRootCA.crt` on the BigSQL host. E.g. using scp: 11 | 12 | ``` 13 | scp DigiCertGlobalRootCA.crt biadmin@:/home/bigsql/sqllib/security/keystore/DigiCertGlobalRootCA.crt 14 | ``` 15 | 16 | Ssh into the Big SQL head node and go to keystory directory: 17 | 18 | ``` 19 | cd /home/bigsql/sqllib/security/keystore 20 | ``` 21 | 22 | Create keystore db: 23 | 24 | ``` 25 | /home/bigsql/sqllib/gskit/bin/gsk8capicmd_64 -keydb -create -db "dashclient.kdb" -pw "myCli3ntPassw0rd" -stash 26 | /home/bigsql/sqllib/gskit/bin/gsk8capicmd_64 -cert -add -db "dashclient.kdb" -pw "myCli3ntPassw0rd" -label "DigiCert" -file "/home/bigsql/sqllib/security/keystore/DigiCertGlobalRootCA.crt" -format ascii -fips 27 | ``` 28 | 29 | Update database manager configuration to use key and stash file: 30 | 31 | ``` 32 | db2 update dbm cfg using SSL_CLNT_KEYDB /home/bigsql/sqllib/security/keystore/dashclient.kdb 33 | db2 update dbm cfg using SSL_CLNT_STASH /home/bigsql/sqllib/security/keystore/dashclient.sth 34 | ``` 35 | 36 | 37 | ## Catalog remote database 38 | 39 | You need DBADM privilege to perform following. As bigsql on master-2 (Big SQL Head Node). Do the following. 40 | 41 | Uncatalog if needed: 42 | ``` 43 | db2 UNCATALOG DATABASE BLUDB 44 | db2 UNCATALOG NODE DASHNODE 45 | ``` 46 | 47 | Catalog the remote server: 48 | ``` 49 | db2 CATALOG TCPIP NODE DASHNODE REMOTE SERVER SECURITY SSL 50 | ``` 51 | 52 | Catalog the remote database: 53 | ``` 54 | db2 CATALOG DATABASE BLUDB AS BLUDB AT NODE DASHNODE 55 | ``` 56 | 57 | ### Test connection 58 | 59 | ``` 60 | db2 connect to BLUDB user using 61 | ``` 62 | 63 | 64 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/Insert.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.sql.Sql 20 | 21 | env = System.getenv() 22 | 23 | url = "jdbc:db2://${env.hostname}:51000/bigsql:sslConnection=true;sslTrustStoreLocation=./truststore.jks;Password=mypassword;" 24 | 25 | db = [ url:url, user:env.username, password:env.password, driver:'com.ibm.db2.jcc.DB2Driver'] 26 | 27 | sql = Sql.newInstance(db.url, db.user, db.password, db.driver) 28 | 29 | def tableName = "test_${new Date().getTime()}" 30 | 31 | // Drop table 32 | println 'Drop table' 33 | sql.execute """ 34 | drop table if exists $tableName 35 | """.toString() 36 | 37 | // Create table 38 | println 'Create table' 39 | sql.execute """ 40 | create hadoop table if not exists $tableName(id int, name varchar(30)) 41 | """.toString() 42 | 43 | // Insert data 44 | println 'Insert into table' 45 | sql.execute """ 46 | insert into $tableName values (1,'pierre'), (2,'chris') 47 | """.toString() 48 | 49 | // Select from table 50 | def select_statment = "select id, name from $tableName" 51 | println "Select from table: $select_statment" 52 | sql.eachRow(select_statment.toString()) { row -> 53 | println "$row.id : $row.name" 54 | } 55 | 56 | sql.execute """ 57 | drop table if exists $tableName 58 | """.toString() 59 | 60 | println "\n>> Connectivity test was successful." 61 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/src/main/scala/biginsights/examples/MessageHubConsumer.scala: -------------------------------------------------------------------------------- 1 | package biginsights.examples 2 | 3 | import org.apache.spark.SparkContext 4 | import org.apache.spark.SparkContext._ 5 | import org.apache.spark.SparkConf 6 | 7 | import org.apache.spark.streaming.Duration 8 | import org.apache.spark.streaming.Seconds 9 | import org.apache.spark.streaming.StreamingContext 10 | import com.ibm.cds.spark.samples.config.MessageHubConfig 11 | import com.ibm.cds.spark.samples.dstream.KafkaStreaming.KafkaStreamingContextAdapter 12 | import org.apache.kafka.common.serialization.Deserializer 13 | import org.apache.kafka.common.serialization.StringDeserializer 14 | 15 | object MessageHubConsumer{ 16 | def main(args: Array[String]) { 17 | 18 | val sc = new SparkConf().setAppName("MessageHubConsumer") 19 | 20 | val appArgs = sc.get("spark.driver.args").split("\\s+") 21 | 22 | val kafkaProps = new MessageHubConfig 23 | 24 | kafkaProps.setConfig("bootstrap.servers", appArgs(0)) 25 | kafkaProps.setConfig("kafka.user.name", appArgs(1)) 26 | kafkaProps.setConfig("kafka.user.password", appArgs(2)) 27 | 28 | // TODO these parameters aren't used and can probably be removed 29 | kafkaProps.setConfig("api_key", appArgs(3)) 30 | kafkaProps.setConfig("kafka_rest_url", appArgs(4)) 31 | 32 | kafkaProps.setConfig("kafka.topic", appArgs(5)) 33 | 34 | val username = appArgs(6) 35 | 36 | kafkaProps.createConfiguration() 37 | 38 | 39 | val ssc = new StreamingContext( sc, Seconds(60) ) 40 | 41 | val stream = ssc.createKafkaStream[String, String, StringDeserializer, StringDeserializer]( 42 | kafkaProps, 43 | List(kafkaProps.getConfig("kafka.topic")) 44 | ); 45 | 46 | stream.foreachRDD{ rdd => 47 | // we only want to create a folder in hdfs if we have some data 48 | if (rdd.count() > 0) { 49 | def uuid = java.util.UUID.randomUUID.toString 50 | val outDir = s"hdfs:///user/${username}/test-${uuid}" 51 | rdd.saveAsTextFile (outDir) 52 | } 53 | } 54 | 55 | stream.print() 56 | ssc.start() 57 | ssc.awaitTermination() 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /examples/SparkWordCountScala/README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | This example shows how to execute the spark wordcount example on the BigInsights cluster. The wordcount is performed on an Apache 2 License file. 4 | 5 | ## Developer experience 6 | 7 | Developers will gain the most from these examples if they are: 8 | 9 | - Comfortable using Windows, OS X or *nix command prompts 10 | - Able to read code written in a high level language such as [Groovy](http://www.groovy-lang.org/) 11 | - Familiar with the [Gradle](https://gradle.org/) build tool 12 | - Familiar with Spark concepts 13 | 14 | ## Example Requirements 15 | 16 | - You meet the [pre-requisites](../../README.md#pre-requisites) in the top level [README](../../README.md) 17 | - You have performed the [setup instructions](../../README.md#setup-instructions) in the top level [README](../../README.md) 18 | 19 | ## Run the example 20 | 21 | To run the examples, in a command prompt window: 22 | 23 | - change into the directory containing this example and run gradle to execute the example 24 | - `./gradlew Example` (OS X / *nix) 25 | - `gradlew.bat Example` (Windows) 26 | 27 | Output from the command will contain the wordcounts: 28 | 29 | ``` 30 | ... 31 | bicluster#54|: 1136 32 | bicluster#54|limited: 4 33 | bicluster#54|all: 3 34 | bicluster#54|code: 1 35 | bicluster#54|managed: 1 36 | bicluster#54|customary: 1 37 | bicluster#54|Works,: 2 38 | bicluster#54|APPENDIX:: 1 39 | ... 40 | 41 | ``` 42 | ## Decomposition Instructions 43 | 44 | The [./build.gradle](./build.gradle) script runs the example. Build.gradle: 45 | 46 | - compiles [WordCount.scala](./src/main/scala/org/apache/spark/examples/WordCount.scala) 47 | - package WordCount classes into a jar file samples/scala-examples.jar 48 | 49 | It then uses a ssh plugin to: 50 | 51 | - copy samples/scala-examples.jar and [./LICENSE](./LICENSE) files to the BigInsights cluster 52 | - from the ssh session, use the `hadoop fs` command to add the LICENSE to hdfs 53 | - from the ssh session, execute the WordCount class with the `spark-submit` command 54 | - job is submitted against YARN cluster (BigInsights). You can retrieve log via `yarn logs -applicationID ` 55 | 56 | -------------------------------------------------------------------------------- /examples/SparkWordCountPython/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.hidetake.ssh' version '1.5.0' 3 | } 4 | 5 | // load some common helper methods 6 | apply from: "${projectDir}/../../shared/common-helpers.gradle" 7 | 8 | // get the cluster connection details 9 | Properties props = new Properties() 10 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 11 | 12 | 13 | task PythonWordCount << { 14 | 15 | def tmpDir = "test-${new Date().getTime()}" 16 | 17 | def tmpHdfsDir = "/user/${props.username}/${tmpDir}" 18 | 19 | // ssh plugin documentation: https://gradle-ssh-plugin.github.io/docs/ 20 | 21 | ssh.run { 22 | // remotes.bicluster is defined in shared/common-helpers.gradle 23 | session(remotes.bicluster) { 24 | 25 | try { 26 | // initialise kerberos 27 | execute "kinit -k -t ${props.username}.keytab ${props.username}@IBM.COM" 28 | } 29 | catch (Exception e) { 30 | println "problem running kinit - maybe this is a Basic cluster?" 31 | } 32 | 33 | // create temp local dir for holding LICENSE file before uploading it to hdfs 34 | execute "mkdir ${tmpDir}" 35 | 36 | // upload spark script and text file to process 37 | put from: "${projectDir}/wordcount.py", into: "${tmpDir}/wordcount.py" 38 | put from: "${projectDir}/LICENSE", into: "${tmpDir}/LICENSE" 39 | 40 | // create temp hdfs folder for holding LICENSE file 41 | execute "hadoop fs -mkdir ${tmpHdfsDir}" 42 | 43 | // put LICENSE into hdfs 44 | execute "hadoop fs -put ${tmpDir}/LICENSE ${tmpHdfsDir}/LICENSE" 45 | 46 | // execute spark workcount job against the LICENSE file in hdfs 47 | execute "pyspark ${tmpDir}/wordcount.py ${tmpHdfsDir}/LICENSE" 48 | 49 | // remove temporary hdfs dir 50 | execute "hadoop fs -rm -r ${tmpHdfsDir}" 51 | 52 | // remove temporary local dir 53 | execute "rm -rf ${tmpDir}" 54 | } 55 | } 56 | } 57 | 58 | 59 | task Example { 60 | dependsOn PythonWordCount 61 | } 62 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/Hbase.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.sql.Sql 20 | 21 | env = System.getenv() 22 | 23 | url = "jdbc:db2://${env.hostname}:51000/bigsql:sslConnection=true;sslTrustStoreLocation=./truststore.jks;Password=mypassword;" 24 | 25 | db = [ url:url, user:env.username, password:env.password, driver:'com.ibm.db2.jcc.DB2Driver'] 26 | 27 | sql = Sql.newInstance(db.url, db.user, db.password, db.driver) 28 | 29 | def tableName = "test_${new Date().getTime()}" 30 | 31 | // Drop table 32 | println 'Drop table' 33 | sql.execute """ 34 | drop table if exists $tableName 35 | """.toString() 36 | 37 | // Create table 38 | println 'Create hbase table' 39 | sql.execute """ 40 | create hbase table if not exists $tableName (c1 integer, c2 integer, c3 integer) column mapping (key mapped by (c1), cf1:cq1 mapped by (c2, c3)) 41 | """.toString() 42 | 43 | // Insert data 44 | println 'Insert into hbase table' 45 | sql.execute """ 46 | insert into $tableName values (1,1,1), (2,2,2) 47 | """.toString() 48 | 49 | // Select from table 50 | def select_statment = "select c1, c2, c3 from $tableName" 51 | println "Select from table: $select_statment" 52 | sql.eachRow(select_statment.toString()) { row -> 53 | println "$row.c1 : $row.c2 : $row.c3" 54 | } 55 | 56 | sql.execute """ 57 | drop table if exists $tableName 58 | """.toString() 59 | 60 | println "\n>> BIGSQL/HBASE test was successful." 61 | -------------------------------------------------------------------------------- /examples/Ambari/AlertServices.groovy: -------------------------------------------------------------------------------- 1 | import groovyx.net.http.RESTClient 2 | import groovy.json.JsonSlurper 3 | 4 | env = System.getenv() 5 | 6 | ambariUrl = env.ambariUrl 7 | ambariUser = env.ambariUsername 8 | ambariPassword = env.ambariPassword 9 | 10 | println "\nAmbari URL: " + ambariUrl 11 | def client = new RESTClient( ambariUrl ) 12 | client.ignoreSSLIssues() 13 | 14 | client.headers['Authorization'] = 'Basic ' + "$ambariUser:$ambariPassword".getBytes('iso-8859-1').encodeBase64() 15 | client.headers['X-Requested-By'] = 'ambari' 16 | 17 | // Make REST call to get clusters 18 | def resp = client.get( path : 'api/v1/clusters' ) 19 | 20 | assert resp.status == 200 // HTTP response code; 404 means not found, etc. 21 | 22 | // Parse output to JSON 23 | def jsonSlurper = new JsonSlurper() 24 | def object = jsonSlurper.parseText(resp.data.text) 25 | 26 | // Get Cluster Name 27 | clusterName = object.items.Clusters[0].cluster_name 28 | println "\nCluster name is: " + clusterName 29 | 30 | // Make REST to get services 31 | def respServices = client.get( path : 'api/v1/clusters/' + clusterName + '/services' ) 32 | 33 | assert respServices.status == 200 // HTTP response code; 404 means not found, etc. 34 | 35 | // Get services 36 | def object_services = jsonSlurper.parseText(respServices.data.text) 37 | 38 | println "\nServices are: " 39 | object_services.items.eachWithIndex { serviceName, index -> 40 | 41 | // Get service name 42 | service = serviceName.ServiceInfo.service_name 43 | print "service ${index}: ${service}" 44 | 45 | // Get service info 46 | def respInfo = client.get( path : 'api/v1/clusters/' + clusterName + "/services/${service}" ) 47 | 48 | // Get service status - should be STARTED or INSTALLED (client) 49 | def object_health = jsonSlurper.parseText(respInfo.data.text) 50 | print " [${object_health.ServiceInfo.state}]" 51 | 52 | // Check service alerts 53 | critAlert = object_health.alerts_summary.CRITICAL 54 | warnAlert = object_health.alerts_summary.WARNING 55 | 56 | if ( critAlert == 0 && warnAlert == 0) { 57 | println " - ALL GOOD (no critical or warning alerts)" 58 | } else { 59 | println " - ATTENTION ( ${critAlert} CRITICAL and ${warnAlert} WARNING aleerts" 60 | } 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /examples/Ambari/ShowMaster.groovy: -------------------------------------------------------------------------------- 1 | import groovyx.net.http.RESTClient 2 | import groovy.json.JsonSlurper 3 | 4 | env = System.getenv() 5 | 6 | ambariUrl = env.ambariUrl 7 | ambariUser = env.ambariUsername 8 | ambariPassword = env.ambariPassword 9 | 10 | def client = new RESTClient( ambariUrl ) 11 | client.ignoreSSLIssues() 12 | 13 | client.headers['Authorization'] = 'Basic ' + "$ambariUser:$ambariPassword".getBytes('iso-8859-1').encodeBase64() 14 | client.headers['X-Requested-By'] = 'ambari' 15 | 16 | // Make REST call to get clusters 17 | def resp = client.get( path : 'api/v1/clusters' ) 18 | assert resp.status == 200 // HTTP response code; 404 means not found, etc. 19 | 20 | // Parse output to JSON 21 | def jsonSlurper = new JsonSlurper() 22 | def object = jsonSlurper.parseText(resp.data.text) 23 | 24 | // Get Cluster Name 25 | clusterName = object.items.Clusters[0].cluster_name 26 | 27 | // Let's build list of service present on that cluster 28 | def respServices = client.get( path : 'api/v1/clusters/' + clusterName + '/services' ) 29 | assert respServices.status == 200 // HTTP response code; 404 means not found, etc. 30 | 31 | def all_services = jsonSlurper.parseText(respServices.data.text) 32 | 33 | def service_list = [] 34 | all_services.items.each { serviceName -> 35 | service_list << serviceName.ServiceInfo.service_name 36 | } 37 | 38 | // Define service and corresponding master components 39 | def services = [ 40 | 'BIGSQL':'BIGSQL_HEAD', 41 | 'KNOX':'KNOX_GATEWAY', 42 | 'HIVE':'HIVE_SERVER', 43 | 'BIGR':'BIGRCONNECTOR' 44 | ] 45 | 46 | println "" 47 | 48 | services.each { service_name, component_name -> 49 | 50 | if ( service_list.contains(service_name) ) { 51 | // Make REST to get compoent info 52 | def respComponent = client.get(path: 'api/v1/clusters/' + clusterName + '/services/' + service_name + '/components/' + component_name) 53 | assert respComponent.status == 200 // HTTP response code; 404 means not found, etc. 54 | 55 | // Get hostname 56 | def object_component = jsonSlurper.parseText(respComponent.data.text) 57 | 58 | println "${component_name} (${service_name}) hostname is: " + object_component.host_components.HostRoles.host_name 59 | } else { 60 | println "Service ${service_name} not installed" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | dependencies { 6 | classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE") 7 | } 8 | } 9 | 10 | 11 | apply plugin: 'java' 12 | apply plugin: 'groovy' 13 | apply plugin: 'spring-boot' 14 | apply plugin: 'eclipse' 15 | 16 | 17 | jar { 18 | baseName = 'ETL_Service' 19 | version = '0.1.0' 20 | } 21 | 22 | repositories { 23 | mavenCentral() 24 | flatDir { 25 | dirs 'libs' 26 | } 27 | } 28 | 29 | dependencies { 30 | compile("org.codehaus.groovy:groovy-all:2.2.1") 31 | compile("org.springframework.boot:spring-boot-starter-web:1.2.3.RELEASE") 32 | compile("org.thymeleaf:thymeleaf-spring4:2.1.2.RELEASE") 33 | compile("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:1.2.1") 34 | compile("org.apache.knox:gateway-shell:0.6.0") { 35 | exclude group: "org.slf4j", module: "slf4j-log4j12" 36 | exclude group: "log4j", module: "log4j" 37 | } 38 | } 39 | 40 | task wrapper(type: Wrapper) { 41 | gradleVersion = '2.0' 42 | } 43 | 44 | Properties props = new Properties() 45 | props.load(new FileInputStream("$projectDir/../../../connection.properties")) 46 | 47 | task ('RunLocally') << { 48 | 49 | println """ 50 | 51 | # set the following environment variables 52 | 53 | export gateway=${props.gateway} 54 | export username=${props.username} 55 | export password=${props.password} 56 | 57 | # Then execute: 58 | 59 | ./gradlew run 60 | 61 | # Then open a browser to: 62 | 63 | http://localhost:8080 64 | """ 65 | } 66 | 67 | task ('Deploy') << { 68 | 69 | println """ 70 | # To deploy to bluemix 71 | 72 | ./gradlew build 73 | 74 | # create a Liberty application in blumemix. Set APPNAME (below) to the name of the application. 75 | 76 | APPNAME=<> 77 | cf login -u cf_username -p cf_password 78 | 79 | cf set-env \$APPNAME gateway ${props.gateway} 80 | cf set-env \$APPNAME username ${props.username} 81 | cf set-env \$APPNAME password ${props.password} 82 | 83 | cf push \$APPNAME -p build/libs/ETL_Service-0.1.0.jar -b https://github.com/cloudfoundry/java-buildpack 84 | """ 85 | } 86 | 87 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/src/main/scala/com/ibm/cds/spark/samples/config/DemoConfig.scala: -------------------------------------------------------------------------------- 1 | package com.ibm.cds.spark.samples.config 2 | 3 | import org.apache.kafka.clients.CommonClientConfigs 4 | import java.io.FileInputStream 5 | import java.io.InputStream 6 | import scala.collection.JavaConversions._ 7 | import org.apache.spark.SparkContext 8 | 9 | 10 | class DemoConfig extends Serializable{ 11 | 12 | //Hold configuration key/value pairs 13 | var config = scala.collection.mutable.Map[String, String]( 14 | ) 15 | 16 | private def getKeyOrFail(key:String):String={ 17 | config.get(key).getOrElse( { 18 | throw new IllegalStateException("Missing key: " + key) 19 | }) 20 | } 21 | 22 | def cloneConfig():MessageHubConfig={ 23 | val props = new MessageHubConfig 24 | config.foreach{ entry => props.setConfig(entry._1, entry._2)} 25 | props 26 | } 27 | 28 | def initConfigKeys(){ 29 | //Overridable by subclasses 30 | } 31 | 32 | //Give a chance to subclasses to init the keys 33 | initConfigKeys; 34 | 35 | { 36 | //Load config from property file if specified 37 | val configPath = System.getenv("DEMO_CONFIG_PATH"); 38 | if ( configPath != null ){ 39 | val props = new java.util.Properties 40 | var fis:InputStream = null 41 | try{ 42 | fis = new FileInputStream(configPath) 43 | props.load(fis) 44 | for( key <- props.keysIterator ){ 45 | setConfig( key, props.getProperty(key)) 46 | } 47 | }catch{ 48 | case e:Throwable => e.printStackTrace 49 | }finally{ 50 | if ( fis != null ){ 51 | fis.close 52 | } 53 | } 54 | } 55 | } 56 | 57 | private[config] def registerConfigKey( key: String, default: String = null ) : (String,String) = { 58 | if ( default == null ){ 59 | (key, Option(System.getProperty(key)).orNull ) 60 | } 61 | (key, Option(System.getProperty(key)) getOrElse default ) 62 | } 63 | 64 | def setConfig(key:String, value:String){ 65 | config.put( key, value ) 66 | } 67 | 68 | def getConfig(key:String):String={ 69 | config.get(key).getOrElse("") 70 | } 71 | 72 | implicit def toImmutableMap(): Map[String,String]= { 73 | Map( config.toList: _* ) 74 | } 75 | } 76 | object DemoConfig extends DemoConfig 77 | 78 | -------------------------------------------------------------------------------- /examples/BigSQLJava/build.gradle: -------------------------------------------------------------------------------- 1 | // set the dependencies for running the groovy script 2 | buildscript { 3 | repositories { 4 | mavenCentral() 5 | } 6 | dependencies { 7 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 8 | classpath 'org.apache.knox:gateway-shell:0.6.0' 9 | } 10 | } 11 | 12 | plugins { 13 | id 'java' 14 | id 'eclipse' 15 | id 'org.hidetake.ssh' version '1.5.0' 16 | } 17 | 18 | // load some common helper methods 19 | apply from: "${projectDir}/../../shared/common-helpers.gradle" 20 | 21 | // get the cluster connection details 22 | Properties props = new Properties() 23 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 24 | 25 | // set the dependencies for compiling the groovy script 26 | repositories { 27 | mavenCentral() 28 | } 29 | 30 | 31 | dependencies { 32 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 33 | compile 'org.apache.knox:gateway-shell:0.6.0' 34 | runtime fileTree(dir: 'lib', include: '*.jar') 35 | } 36 | 37 | sourceSets { 38 | main { 39 | resources { 40 | srcDir file('.') include 'truststore.jks' 41 | } 42 | } 43 | } 44 | 45 | task ('CreateTrustStore', type:Exec) { 46 | 47 | // this build step will fail if we try to import the certificate into an existing truststore 48 | delete './truststore.jks' 49 | 50 | // ensure the ssl certificate exists 51 | if (!file("${projectDir}/../../certificate").exists()) { 52 | throw new GradleException("'certificate' file could not be found in ${projectDir.parentFile.parentFile}") 53 | } 54 | 55 | // import the BigInsights manager certificate 56 | commandLine "keytool -import -trustcacerts -alias biginsights -file ${projectDir}/../../certificate -keystore ./truststore.jks -storepass mypassword -noprompt".split() 57 | } 58 | 59 | // task to run a script 60 | task('Connect', type: JavaExec) { 61 | 62 | // if running this task with clean, ensure clean runs first 63 | mustRunAfter clean 64 | 65 | dependsOn CreateTrustStore 66 | dependsOn SetupLibs 67 | 68 | environment 'hostname', getMasters(props)['BIGSQL_HEAD'][0] 69 | environment 'username', props.username 70 | environment 'password', props.password 71 | 72 | main = 'Example' 73 | classpath = sourceSets.main.runtimeClasspath 74 | } 75 | 76 | task('Example') { 77 | dependsOn Connect 78 | } 79 | -------------------------------------------------------------------------------- /examples/Zeppelin/zeppelin_env.sh_template: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | # IMPORTANT: Before you make any changes to this file, ensure that you 20 | # stop Zeppelin with `./gradlew stop` 21 | # 22 | # After making the change run `./gradlew UpdateEnv`, followed 23 | # by `./gradlew start` or `./gradlew restart` 24 | 25 | export SPARK_HOME=/usr/iop/current/spark-client 26 | export HADOOP_CONF_DIR=/usr/iop/current/hadoop-client/conf 27 | 28 | SPARK_SUBMIT_OPTIONS="" 29 | SPARK_SUBMIT_OPTIONS="$SPARK_SUBMIT_OPTIONS --packages cloudant-labs:spark-cloudant:1.6.4-s_2.10" 30 | SPARK_SUBMIT_OPTIONS="$SPARK_SUBMIT_OPTIONS --packages com.databricks:spark-csv_2.10:1.2.0" 31 | 32 | # fix for http://www.ibm.com/support/knowledgecenter/SSPT3X_4.2.0/com.ibm.swg.im.infosphere.biginsights.product.doc/doc/bi_spark.html 33 | SPARK_SUBMIT_OPTIONS="$SPARK_SUBMIT_OPTIONS --jars /usr/iop/4.2.0.0/hive/lib/datanucleus-api-jdo-3.2.6.jar,/usr/iop/4.2.0.0/hive/lib/datanucleus-core-3.2.10.jar,/usr/iop/4.2.0.0/hive/lib/datanucleus-rdbms-3.2.9.jar" 34 | SPARK_SUBMIT_OPTIONS="$SPARK_SUBMIT_OPTIONS --files /usr/iop/current/spark-client/conf/hive-site.xml" 35 | 36 | export SPARK_SUBMIT_OPTIONS 37 | 38 | # If you want to use a different version of python, you could try setting the following 39 | # values to point to your python: 40 | # 41 | # export PYSPARK_PYTHON=/home/biadmin/anaconda2/bin/python2.7 42 | # export PYSPARK_DRIVER_PYTHON=/home/biadmin/anaconda2/bin/python2.7 43 | 44 | # WARNING: Zeppelin will listen for connections on this port and will not 45 | # authenticate users. Ensure the Zeppelin port is protected by a 46 | # firewall so that it is only available through a ssh tunnel to 47 | # the cluster. 48 | 49 | export ZEPPELIN_PORT=8080 50 | -------------------------------------------------------------------------------- /examples/HiveGroovy/build.gradle: -------------------------------------------------------------------------------- 1 | // set the dependencies for running the groovy script 2 | buildscript { 3 | repositories { 4 | mavenCentral() 5 | } 6 | dependencies { 7 | classpath 'org.codehaus.groovy:groovy-all:2.0.5' 8 | classpath 'org.apache.hive:hive-jdbc:2.0.0' 9 | } 10 | } 11 | 12 | plugins { 13 | id 'groovy' 14 | id 'org.hidetake.ssh' version '1.5.0' 15 | } 16 | 17 | // set the dependencies for compiling the groovy script 18 | repositories { 19 | mavenCentral() 20 | } 21 | 22 | dependencies { 23 | compile 'org.codehaus.groovy:groovy-all:2.0.5' 24 | compile 'org.apache.hive:hive-jdbc:2.0.0' 25 | } 26 | 27 | // tell gradle the groovy script is in the same folder as the build.gradle file 28 | sourceSets { 29 | main { 30 | groovy { 31 | srcDirs = ['.'] 32 | } 33 | } 34 | } 35 | 36 | // load some common helper methods 37 | apply from: "${projectDir}/../../shared/common-helpers.gradle" 38 | 39 | // task to run a script 40 | task('CreateTable', type: JavaExec) { 41 | 42 | Properties props = new Properties() 43 | props.load(new FileInputStream("$projectDir/../../connection.properties")) 44 | 45 | if (!(new File("${projectDir}/../../certificate").exists())) { 46 | throw new GradleException("'certificate' file could not be found in ${projectDir.parentFile.parentFile}") 47 | } 48 | 49 | println ">> Remove key store" 50 | delete './truststore.jks' 51 | 52 | // import the BigInsights manager certificate 53 | println ">> Create key store" 54 | ant.exec(executable: "${getKeytoolPath()}", dir:'./') { 55 | arg(line: '-import -trustcacerts -alias biginsights -file ../../certificate -keystore ./truststore.jks -storepass mypassword -noprompt') 56 | } 57 | 58 | def hive_hostname 59 | 60 | // get hive server hostname 61 | try { 62 | hive_hostname = getMasters(props)['HIVE_SERVER'][0] 63 | } catch (Exception e) { 64 | throw new GradleException('Could not find a HIVE host for this cluster.') 65 | } 66 | 67 | // pass environment variables to the groovy script 68 | // hostname is set by identifying HIVE_SERVER host 69 | // if hive server 2 is running on default port, change Example.groovy jdbc connection 70 | environment 'hostname', hive_hostname 71 | environment 'username', props.username 72 | environment 'password', props.password 73 | 74 | // run the groovy script 75 | main = 'Example' 76 | classpath = sourceSets.main.runtimeClasspath 77 | } 78 | 79 | task('Example') { 80 | dependsOn CreateTable 81 | } 82 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/Federation.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.sql.Sql 20 | 21 | env = System.getenv() 22 | 23 | url = "jdbc:db2://${env.hostname}:51000/bigsql:sslConnection=true;sslTrustStoreLocation=./truststore.jks;Password=mypassword;" 24 | 25 | db = [ url:url, user:env.username, password:env.password, driver:'com.ibm.db2.jcc.DB2Driver'] 26 | 27 | println "[Federation.groovy] Connecting to Big SQL" 28 | sql = Sql.newInstance(db.url, db.user, db.password, db.driver) 29 | 30 | dash_user = env.dashUser 31 | dash_password = env.dashPassword 32 | dash_host = env.dashHost 33 | dash_port = env.dashPort 34 | 35 | // Create wrapper 36 | println "[Federation.groovy] Create wrapper" 37 | //sql.execute("DROP WRAPPER drda") 38 | sql.execute("CREATE WRAPPER drda") 39 | 40 | // Create server mapping 41 | println "[Federation.groovy] Create server mapping" 42 | sql.execute """ 43 | CREATE SERVER DASHDB TYPE DB2/UDB VERSION 11.1 44 | WRAPPER DRDA 45 | AUTHORIZATION "${dash_user}" PASSWORD "${dash_password}" 46 | OPTIONS (HOST '${dash_host}', PORT '${dash_port}', DBNAME 'BLUDB', PASSWORD 'Y') 47 | """.toString() 48 | 49 | // Create user mapping 50 | println "[Federation.groovy] Create user mapping" 51 | sql.execute """ 52 | CREATE USER MAPPING FOR ${db.user} SERVER DASHDB 53 | OPTIONS (REMOTE_AUTHID '${dash_user}', REMOTE_PASSWORD '${dash_password}') 54 | """.toString() 55 | 56 | // Create nickname 57 | println "[Federation.groovy] Create nickname" 58 | sql.execute("CREATE NICKNAME LANGUAGE FOR DASHDB.SAMPLES.LANGUAGE") 59 | 60 | // Select from table 61 | def select_statment = "select language_code, language_desc from language" 62 | println "[Federation.groovy] Select from table: $select_statment" 63 | sql.eachRow(select_statment.toString()) { row -> 64 | println "$row.language_code : $row.language_desc" 65 | } 66 | 67 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovy/src/main/java/org/apache/spark/examples/WordCount.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | 16 | package org.apache.spark.examples; 17 | 18 | import java.util.Arrays; 19 | import org.apache.spark.SparkConf; 20 | import org.apache.spark.api.java.JavaPairRDD; 21 | import org.apache.spark.api.java.JavaRDD; 22 | import org.apache.spark.api.java.JavaSparkContext; 23 | import org.apache.spark.api.java.function.FlatMapFunction; 24 | import org.apache.spark.api.java.function.Function2; 25 | import org.apache.spark.api.java.function.PairFunction; 26 | 27 | import scala.Tuple2; 28 | 29 | import java.util.logging.Level; 30 | import java.util.logging.Logger; 31 | 32 | public class WordCount { 33 | 34 | private final static Logger LOGGER = Logger.getLogger(WordCount.class.getName()); 35 | 36 | @SuppressWarnings("serial") 37 | public static void main(String[] args) { 38 | 39 | LOGGER.setLevel(Level.INFO); 40 | 41 | String inputPath = args[0]; 42 | String outputPath = args[1]; 43 | 44 | LOGGER.info("inputPath: " + inputPath); 45 | LOGGER.info("outputPath: " + outputPath); 46 | 47 | SparkConf sparkConf = new SparkConf().setAppName("Word count"); 48 | 49 | JavaSparkContext ctx = new JavaSparkContext(sparkConf); 50 | 51 | JavaRDD textFile = ctx.textFile(inputPath); 52 | JavaRDD words = textFile.flatMap(new FlatMapFunction() { 53 | public Iterable call(String s) { return Arrays.asList(s.split(" ")); } 54 | }); 55 | JavaPairRDD pairs = words.mapToPair(new PairFunction() { 56 | public Tuple2 call(String s) { return new Tuple2(s, 1); } 57 | }); 58 | JavaPairRDD counts = pairs.reduceByKey(new Function2() { 59 | public Integer call(Integer a, Integer b) { return a + b; } 60 | }); 61 | counts.saveAsTextFile(outputPath); 62 | 63 | ctx.close(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/Load.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import groovy.sql.Sql 20 | import org.apache.hadoop.gateway.shell.Hadoop 21 | import org.apache.hadoop.gateway.shell.hdfs.Hdfs 22 | 23 | env = System.getenv() 24 | 25 | session = Hadoop.login( env.gateway, env.username, env.password ) 26 | 27 | dataFile = """1|Pierre 28 | 2|Chris 29 | 3|Jane 30 | """ 31 | 32 | // Put data file in HDFS 33 | println "Copy data to tmp" 34 | rmData = Hdfs.rm( session ).file( "/tmp/data.csv" ).now() 35 | putData = Hdfs.put( session ).text( dataFile ).to( "/tmp/data.csv" ).now() 36 | 37 | url = "jdbc:db2://${env.hostname}:51000/bigsql:sslConnection=true;sslTrustStoreLocation=./truststore.jks;Password=mypassword;" 38 | 39 | db = [ url:url, user:env.username, password:env.password, driver:'com.ibm.db2.jcc.DB2Driver'] 40 | 41 | sql = Sql.newInstance(db.url, db.user, db.password, db.driver) 42 | 43 | def tableName = "test_${new Date().getTime()}" 44 | 45 | // Drop table 46 | println 'Drop table' 47 | sql.execute """ 48 | drop table if exists $tableName 49 | """.toString() 50 | 51 | // Create table 52 | println 'Create table' 53 | sql.execute """ 54 | create hadoop table if not exists $tableName(id int, name varchar(30)) 55 | """.toString() 56 | 57 | // Load data 58 | println 'Load into table' 59 | sql.execute """ 60 | load hadoop using file url '/tmp/data.csv' with source properties ('field.delimiter'='|', 'ignore.extra.fields'='true') into table $tableName append 61 | """.toString() 62 | 63 | // Select from table 64 | def select_statment = "select id, name from $tableName" 65 | println "Select from table: $select_statment" 66 | sql.eachRow(select_statment.toString()) { row -> 67 | println "ID: $row.id NAME: $row.name" 68 | } 69 | 70 | sql.execute """ 71 | drop table if exists $tableName 72 | """.toString() 73 | 74 | println "\n>> Connectivity test was successful." 75 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/hadoop-deploy/src/main/java/org/apache/spark/examples/WordCount.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | 16 | package org.apache.spark.examples; 17 | 18 | import java.util.Arrays; 19 | import org.apache.spark.SparkConf; 20 | import org.apache.spark.api.java.JavaPairRDD; 21 | import org.apache.spark.api.java.JavaRDD; 22 | import org.apache.spark.api.java.JavaSparkContext; 23 | import org.apache.spark.api.java.function.FlatMapFunction; 24 | import org.apache.spark.api.java.function.Function2; 25 | import org.apache.spark.api.java.function.PairFunction; 26 | 27 | import scala.Tuple2; 28 | 29 | import java.util.logging.Level; 30 | import java.util.logging.Logger; 31 | 32 | public class WordCount { 33 | 34 | private final static Logger LOGGER = Logger.getLogger(WordCount.class.getName()); 35 | 36 | @SuppressWarnings("serial") 37 | public static void main(String[] args) { 38 | 39 | LOGGER.setLevel(Level.INFO); 40 | 41 | String inputPath = args[0]; 42 | String outputPath = args[1]; 43 | 44 | LOGGER.info("inputPath: " + inputPath); 45 | LOGGER.info("outputPath: " + outputPath); 46 | 47 | SparkConf sparkConf = new SparkConf().setAppName("Word count"); 48 | 49 | JavaSparkContext ctx = new JavaSparkContext(sparkConf); 50 | 51 | JavaRDD textFile = ctx.textFile(inputPath); 52 | JavaRDD words = textFile.flatMap(new FlatMapFunction() { 53 | public Iterable call(String s) { return Arrays.asList(s.split(" ")); } 54 | }); 55 | JavaPairRDD pairs = words.mapToPair(new PairFunction() { 56 | public Tuple2 call(String s) { return new Tuple2(s, 1); } 57 | }); 58 | JavaPairRDD counts = pairs.reduceByKey(new Function2() { 59 | public Integer call(Integer a, Integer b) { return a + b; } 60 | }); 61 | counts.saveAsTextFile(outputPath); 62 | 63 | ctx.close(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/Ambari/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/Jsqsh/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/BigSQLGroovy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/BigSQLJava/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/HBaseGroovy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/HBaseJava/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/HiveBeeline/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/HiveGroovy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/HiveJava/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/Knoxshell/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/SquirrelSQL/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/WebHdfsCurl/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/Zeppelin/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/SparkSystemML/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/WebHCatGroovy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/WebHdfsGroovy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScala/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/SparkWordCountPython/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/SparkWordCountScala/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceCurl/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/SparkMessageHubScalaYarn/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/OozieWorkflowMapReduceGroovy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/bluemix-deploy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/OozieWorkflowSparkGroovyBluemixDeploy/hadoop-deploy/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /examples/WebHCatGroovy/MapReduce.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | import com.jayway.jsonpath.JsonPath 19 | import groovy.json.JsonSlurper 20 | import org.apache.hadoop.gateway.shell.Hadoop 21 | import org.apache.hadoop.gateway.shell.hdfs.Hdfs 22 | import org.apache.hadoop.gateway.shell.job.Job 23 | 24 | import static java.util.concurrent.TimeUnit.SECONDS 25 | 26 | def env = System.getenv() 27 | gateway = env.gateway 28 | username = env.username 29 | password = env.password 30 | 31 | inputFile = "LICENSE" 32 | jobDir = "/user/" + username + "/test" 33 | jarFile = "samples/hadoop-examples.jar" 34 | 35 | session = Hadoop.login( gateway, username, password ) 36 | 37 | println "[MapReduce.groovy] Delete " + jobDir + ": " + Hdfs.rm( session ).file( jobDir ).recursive().now().statusCode 38 | println "[MapReduce.groovy] Mkdir " + jobDir + ": " + Hdfs.mkdir( session ).dir( jobDir ).now().statusCode 39 | 40 | println "[MapReduce.groovy] Copy input file to HDFS" 41 | Hdfs.put(session).file( inputFile ).to( jobDir + "/input/FILE" ).now() 42 | println "[MapReduce.groovy] Copy jar file to HDFS" 43 | Hdfs.put(session).file( jarFile ).to( jobDir + "/lib/hadoop-examples.jar" ).now() 44 | 45 | jobId = Job.submitJava(session) \ 46 | .jar( jobDir + "/lib/hadoop-examples.jar" ) \ 47 | .app( "org.apache.hadoop.examples.WordCount" ) \ 48 | .input( jobDir + "/input" ) \ 49 | .output( jobDir + "/output" ) \ 50 | .now().jobId 51 | 52 | println "[MapReduce.groovy] Submitted job: " + jobId 53 | 54 | println "[MapReduce.groovy] Polling up to 60s for job completion..." 55 | done = false 56 | count = 0 57 | while( !done && count++ < 60 ) { 58 | sleep( 1000 ) 59 | json = Job.queryStatus(session).jobId(jobId).now().string 60 | done = JsonPath.read( json, "\$.status.jobComplete" ) 61 | print "."; System.out.flush(); 62 | } 63 | println "" 64 | println "[MapReduce.groovy] Job status: " + done 65 | 66 | 67 | text = Hdfs.ls( session ).dir( jobDir + "/output" ).now().string 68 | json = (new JsonSlurper()).parseText( text ) 69 | println json.FileStatuses.FileStatus.pathSuffix 70 | 71 | session.shutdown() 72 | --------------------------------------------------------------------------------