commit | 6ec083fac210362e6be7f7d781470386138f205a | [log] [tgz] |
---|---|---|
author | Pat Ferrel <pat@occamsmachete.com> | Mon Dec 28 13:50:09 2015 -0800 |
committer | Pat Ferrel <pat@occamsmachete.com> | Mon Dec 28 13:50:09 2015 -0800 |
tree | 0c802ba826eb83f1bcf7d3f3210a09dc777ea177 | |
parent | a74b30828288c33b1818631f690f2d494c555016 [diff] | |
parent | dbbdebf9dda75b0b312de33728b2b77d4ac10b09 [diff] |
Merge pull request #4 from EmergentOrder/develop Add methods for batch event creation, example
This bulk of this README is divided into two sections: Using the SDK and Developing the SDK. Choose the one the suits you. For Support please see the bottom of this README.
If you have a Maven project, simply add the dependency to your pom.xml
.
<project ...> ... <dependencies> <dependency> <groupId>io.prediction</groupId> <artifactId>client</artifactId> <version>0.9.5</version> </dependency> </dependencies> ...
If you use Ivy, simply add the dependency to your ivy.xml
.
<ivy-module ...> ... <dependencies> <dependency org="io.prediction" name="client" rev="0.9.5" /> ... </dependencies> ...
If you have an sbt project, add the library dependency to your build definition.
libraryDependencies += "io.prediction" % "client" % "0.9.5"
Please check out the examples under examples/
.
Assuming you are cloning to your home directory.
cd ~ git clone git://github.com/PredictionIO/PredictionIO-Java-SDK.git
To build this SDK you will need Maven 3+. Run the following to publish the module to your local Maven repository.
cd ~/PredictionIO-Java-SDK mvn clean install
Run the following to generate API documentation.
cd ~/PredictionIO-Java-SDK mvn clean javadoc:javadoc
Simply add the dependency to your pom.xml
.
<project ...> ... <dependencies> <dependency> <groupId>io.prediction</groupId> <artifactId>client</artifactId> <version>0.9.6-SNAPSHOT</version> </dependency> </dependencies> ...
If your PredictionIO server is not at localhost, edit the source and replace API URLs with your PredictionIO server host.
To build these examples you will need Maven 3+. Run the following in each example's directory, e.g.
cd ~/PredictionIO-Java-SDK/examples/quickstart_import mvn clean compile assembly:single cd ~/PredictionIO-Java-SDK/examples/import mvn clean compile assembly:single
These will create JAR files with all dependencies built in.
For running the quick start example (quickstart_import), please refer to the “Quick Start” page of the PredictionIO documentation. Most importantly, create an App with pio new app MyApp
and take note of the Access Key
produced, which will be <your accessKey here>
in the following.
For quickstart_import
,
cd ~/PredictionIO-Java-SDK/examples/quickstart_import java -jar target/quickstart-import-<latest version>-jar-with-dependencies.jar <your accessKey here>
To check the data has been imported successfully, run
curl -i -X GET http://localhost:7070/events.json?accessKey=<your accessKey here>
To import the provided small sample data for the import example using asynchronous calls:
cd ~/PredictionIO-Java-SDK/examples/import java -jar target/sample-import-<latest version>-jar-with-dependencies.jar <your accessKey here> sampledata/sample1.txt
To check the data is imported properly, run
curl -i -X GET http://localhost:7070/events.json?accessKey=<your accessKey here>
Enjoy!
https://groups.google.com/group/predictionio-user
https://predictionio.atlassian.net
If you are unsure whether a behavior is an issue, bringing it up in the forum is highly encouraged.