Skip to main content

Quick start

From zero to a stored datapoint in about five minutes.

1. Install

The Java SDK is not on Maven Central yet, so build it from the platform repository and install it into your local Maven repository once:

git clone https://github.com/IntelliStream-DataHub/datahub-platform.git
cd datahub-platform
./gradlew :datahub-api-model:publishToMavenLocal :datahub-java-sdk:publishToMavenLocal

Then depend on it:

// build.gradle.kts
repositories {
mavenLocal()
mavenCentral()
}

dependencies {
implementation("ai.intellistream:datahub-sdk:0.1.0-SNAPSHOT")
}
The name is long on purpose, and you can shorten it

datahub-sdk was already taken on PyPI by an unrelated project, and the bare datahub neighbourhood belongs to a much better-known metadata platform, so the package is qualified with the organisation and the Rust crate takes the same name. Alias it if you would rather not type it:

import intellistream_datahub_sdk as dh
# Cargo.toml — a crate-wide rename
dh = { package = "intellistream-datahub-sdk", version = "0.1" }

2. Configure credentials

The client reads configuration from the environment (or a .env file): a base URL and either a static token or OAuth2 client-credentials.

BASE_URL=https://api.intellistream.ai
TOKEN=eyJhbGciOi... # or CLIENT_ID / CLIENT_SECRET / TOKEN_URI

3. Create a client and write a datapoint

var client = DatahubClient.fromEnv();

var series = Timeseries.of("engine_temperature").name("Engine temperature");
series.setUnit("celsius");
series.setValueType("float");
client.timeseries().create(series);

client.timeseries().ingest(Map.of(
"engine_temperature", List.of(
Datapoint.of(Instant.now(), 92.4))));

4. Read it back

var filter = new RetrieveFilter();
filter.setExternalId("engine_temperature");
filter.setStart(ZonedDateTime.now().minusHours(1));
filter.setEnd(ZonedDateTime.now());

var request = new DataRetriever<RetrieveFilter>();
request.setItems(List.of(filter));

client.timeseries().retrieve(request).getItems()
.forEach(c -> c.getDatapoints().forEach(System.out::println));
Pick once, follow everywhere

The tabs above all switch together — and your choice persists as you move through the docs. One selection for the whole site.

Next: a real program

The tutorial turns these calls into a complete agent: it samples your machine's memory every few seconds, creates its series idempotently, and survives API outages with the durable ingest buffer.