QueryApi
Data Client QueryApi
The QueryApi mirrors the Query Rest Api.
It provides a way to get information (metadata) about layers and partitions stored in a catalog.
For the full QueryApi specification, see QueryApi.
The following pages describe the per-request configuration and metrics.
Example
val client = BaseClient()
val queryApi = client.of[QueryApi]
val someHrn = "hrn:here:data::olp-here-test:whatever"
val someLayer = "whateverLayer"
val somePartitionId = "partition-xyz-123"
val result: Future[Partitions] =
queryApi.getPartitionsById(someHrn, someLayer, Seq(somePartitionId)).executeToEntity()
result
.andThen {
case Success(response) =>
// do something with the partitions metadata
response.partitions.foreach { partition =>
println(s"version = ${partition.version}")
}
case Failure(ex) =>
ex.printStackTrace()
}
Await.result(result, Duration.Inf)BaseClient client = BaseClientJava.instance();
QueryApi queryApi = new QueryApi(client);
String someHrn = "hrn:here:data::olp-here-test:whatever";
String someLayer = "whateverLayer";
String somePartitionId = "partition-xyz-123";
Partitions result =
queryApi
.getPartitionsById()
.withHrn(someHrn)
.withLayerId(someLayer)
.withPartition(Arrays.asList(somePartitionId))
.build()
.executeToEntity()
.toCompletableFuture()
.join();
// do something with the partitions metadata
for (Partition partition : result.getPartitions()) {
System.out.printf("version = %d\n", partition.getVersion());
}Updated 21 days ago