Java SDK Getting Started
The CloudQuant Data Liberator Java SDK uses Apache Arrow for efficient data streaming and provides a generator-based iteration pattern.
Prerequisites
sudo apt-get install ca-certificates-java openjdk-17-jdk openjdk-17-jre maven
Run the ./build_maven.sh script to build the Maven project and install the project dependencies.
Required Security Files
Place the following files from your Downloads ZIP in your working directory:
liberator.pfx — Security certificate
liberator.json — Contains your Username and Token
liberator.pfx and liberator.json must be in your working directory.
Quick Start
Liberator liberator = new Liberator();
Object query_id = liberator.query(new HashMap<>() {{
put("name", "daily_bars");
put("as_of", "2020-11-15");
put("symbols", "AAPL");
}});
for (Liberator.QueryResult res : liberator.Generate()) {
Object res_id = res.GetId();
Object data = res.GetData();
if (data instanceof org.apache.arrow.vector.VectorSchemaRoot) {
org.apache.arrow.vector.VectorSchemaRoot recordBatch =
(org.apache.arrow.vector.VectorSchemaRoot) data;
printRecordBatch(recordBatch);
} else if (data instanceof javax.json.JsonValue) {
javax.json.JsonValue jsonValue = (javax.json.JsonValue) data;
System.out.println(jsonValue);
}
}