public final class JetBootstrap extends Object
main()
method it is not trivial to find out the filename of the JAR containing
it.
This helper is a part of the solution to the above "bootstrapping" issue. To use it, follow these steps:
main()
method and your Jet code the usual way, except
for calling getInstance()
to acquire a Jet client
instance (instead of Jet.newJetClient()
).
Main-Class
in MANIFEST.MF
.
java -jar jetjob.jar
use submit-jet.sh jetjob.jar
. The script is found in the Jet distribution
zipfile, in the bin
directory. On Windows use submit-jet.bat
.
hazelcast-client.xml
found in the config
directory in Jet's distribution directory
structure. Adjust that file to suit your needs.
public class CustomJetJob { public static void main(String[] args) { JetInstance jet = JetBootstrap.getInstance(); jet.newJob(buildDag()).execute().get(); } public static DAG buildDag() { // ... } }After building the JAR, submit the job:
$ submit-jet.sh jetjob.jar
Modifier and Type | Method and Description |
---|---|
static JetInstance |
getInstance()
Returns the bootstrapped
JetInstance . |
static void |
main(String[] args)
Runs the supplied JAR file and sets the static jar file name
|
public static void main(String[] args) throws Exception
Exception
public static JetInstance getInstance()
JetInstance
.Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.