- Learning Hadoop 2
- Garry Turkington Gabriele Modena
- 204字
- 2021-07-23 20:57:38
Running the examples
The source code of all examples is available at https://github.com/learninghadoop2/book-examples.
Gradle (http://www.gradle.org/) scripts and configurations are provided to compile most of the Java code. The gradlew
script included with the example will bootstrap Gradle and use it to fetch dependencies and compile code.
JAR files can be created by invoking the jar
task via a gradlew
script, as follows:
./gradlew jar
Jobs are usually executed by submitting a JAR file using the hadoop jar
command, as follows:
$ hadoop jar example.jar <MainClass> [-libjars $LIBJARS] arg1 arg2 … argN
The optional -libjars
parameter specifies runtime third-party dependencies to ship to remote nodes.
The copyJar
Gradle task can be used to download third-party dependencies into build/libjars/<example>/lib
, as follows:
./gradlew copyJar
For convenience, we provide a fatJar
Gradle task that bundles the example classes and their dependencies into a single JAR file. Although this approach is discouraged in favor of using –libjar
, it might come in handy when dealing with dependency issues.
The following command will generate build/libs/<example>-all.jar
:
$ ./gradlew fatJar
- Java 開發從入門到精通(第2版)
- SoapUI Cookbook
- ASP.NET Core 5.0開發入門與實戰
- Photoshop智能手機APP UI設計之道
- Mastering Julia
- 秒懂設計模式
- Visual C#.NET程序設計
- Microsoft Azure Storage Essentials
- 圖數據庫實戰
- Python Essentials
- Julia High Performance(Second Edition)
- Android應用程序設計
- PHP 7 Programming Blueprints
- Jenkins 2.x Continuous Integration Cookbook(Third Edition)
- Learning HTML5 by Creating Fun Games