VolatileBlobApi

Data Client VolatileBlobApi

The VolatileBlobApi mirrors the
Volatile Blob Rest Api.

It supports the upload and retrieval of volatile data from the storage of a
catalog. Each discrete chunk of data is stored as a blob (Binary Large Object).
Each blob has its own unique ID (data handle), which is stored as partition
metadata. Unlike with BlobApi, data handles can be
overwritten.

For the full VolatileBlobApi specification, see
VolatileBlobApi.

The following pages describe the per-request configuration and
metrics.

Example

val client = BaseClient()
val volatileBlobApi = client.of[VolatileBlobApi]

val someHrn = "hrn:here:data::olp-here-test:whatever"
val someLayer = "whateverLayer"
val someDataHandle = "whateverDataHandle"
val result: Future[Array[Byte]] =
  volatileBlobApi.getVolatileBlob(someHrn, someLayer, someDataHandle).executeToEntity()

result
  .andThen {
    case Success(response) =>
      // do something with the byte array
      println(s"received ${response.length} bytes")
    case Failure(ex) =>
      ex.printStackTrace()
  }

Await.result(result, Duration.Inf)
BaseClient client = BaseClientJava.instance();
VolatileBlobApi volatileBlobApi = new VolatileBlobApi(client);

String someHrn = "hrn:here:data::olp-here-test:whatever";
String someLayer = "whateverLayer";
String someDataHandle = "whateverDataHandle";
byte[] result =
    volatileBlobApi
        .getVolatileBlob(someHrn, someLayer, someDataHandle, Optional.empty())
        .executeToBytes()
        .toCompletableFuture()
        .join();

// do something with the byte array
System.out.printf("received %d bytes\n", result.length);