Get partition metadata from an index layer

Partition metadata from index layer consists of the following information about the partition:

  • ID (data handle)
  • Data size
  • Checksum
  • Metadata
  • Timestamp

To get partition metadata from the index layer:

  1. Create the OlpClientSettings instance.

    For instructions, see Create platform client settings.

  2. Create the IndexLayerClient object with the HERE Resource Name (HRN) of the catalog that contains the layer, layer ID, and platform client settings from step 1.

    const indexLayerClient = new IndexLayerClient({
      catalogHrn: HRN.fromString("your-catalog-hrn"),
      layerId: "your-layer-id",
      settings: olpClientSettings,
    });
    
  3. Create the IndexQueryRequest object with the RSQL query string and, if the query string is huge, set the huge boolean parameter to true.

    Note

    The huge parameter is optional, and its default value is false.

    const request = new IndexQueryRequest()
      .withQueryString("RSQL string query")
      .withHugeResponse(true);
    
  4. Call the getPartitions method with the IndexQueryRequest parameter.

    const partitions = await indexLayerClient.getPartitions(request);
    

    You get metadata for all the partitions in the layer.

In browser and Node.js, to abort requests before they have completed, you can create the AbortController object, and then add the AbortController.signal property to your requests. For more information, see the AbortController documentation.

Example

const abortController = new AbortController();
const partitions = await indexLayerClient.getPartitions(request),
  abortController.signal
);

results matching ""

    No results matching ""