olp-cpp-sdk  1.22.0
Static Public Member Functions | List of all members
olp::cache::KeyGenerator Class Reference

Helper class to generate cache keys for different entities. More...

#include <KeyGenerator.h>

Static Public Member Functions

static std::string CreateApiKey (const std::string &hrn, const std::string &service, const std::string &version)
 Generates cache key for service API. More...
 
static std::string CreateCatalogKey (const std::string &hrn)
 Generates cache key for catalog data. More...
 
static std::string CreateLatestVersionKey (const std::string &hrn)
 Generates cache key to store latest catalog version. More...
 
static std::string CreatePartitionKey (const std::string &hrn, const std::string &layer_id, const std::string &partition_id, const boost::optional< int64_t > &version)
 Generates cache key for storing partition data. More...
 
static std::string CreatePartitionsKey (const std::string &hrn, const std::string &layer_id, const boost::optional< int64_t > &version)
 Generates cache key for storing list of partitions. More...
 
static std::string CreateLayerVersionsKey (const std::string &hrn, const int64_t version)
 Generates cache key for storing list of available layer versions. More...
 
static std::string CreateQuadTreeKey (const std::string &hrn, const std::string &layer_id, olp::geo::TileKey root, const boost::optional< int64_t > &version, int32_t depth)
 Generates cache key for storing quadtree metadata. More...
 
static std::string CreateDataHandleKey (const std::string &hrn, const std::string &layer_id, const std::string &data_handle)
 Generates cache key for data handle entities. More...
 

Detailed Description

Helper class to generate cache keys for different entities.

Member Function Documentation

◆ CreateApiKey()

static std::string olp::cache::KeyGenerator::CreateApiKey ( const std::string &  hrn,
const std::string &  service,
const std::string &  version 
)
static

Generates cache key for service API.

Parameters
hrnThe HRN of the catalog.
serviceThe service.
versionThe version of the service.
Returns
A key used to store the API in cache.

◆ CreateCatalogKey()

static std::string olp::cache::KeyGenerator::CreateCatalogKey ( const std::string &  hrn)
static

Generates cache key for catalog data.

Parameters
hrnThe HRN of the catalog.
Returns
A key used to store the catalog data in cache.

◆ CreateDataHandleKey()

static std::string olp::cache::KeyGenerator::CreateDataHandleKey ( const std::string &  hrn,
const std::string &  layer_id,
const std::string &  data_handle 
)
static

Generates cache key for data handle entities.

Parameters
hrnThe HRN of the catalog.
layer_idThe layer of the data handle.
data_handleThe data handle.
Returns
A key used to store the data handle in cache.

◆ CreateLatestVersionKey()

static std::string olp::cache::KeyGenerator::CreateLatestVersionKey ( const std::string &  hrn)
static

Generates cache key to store latest catalog version.

Parameters
hrnThe HRN of the catalog.
Returns
A key used to store the version in cache.

◆ CreateLayerVersionsKey()

static std::string olp::cache::KeyGenerator::CreateLayerVersionsKey ( const std::string &  hrn,
const int64_t  version 
)
static

Generates cache key for storing list of available layer versions.

Parameters
hrnThe HRN of the catalog.
versionThe version of the catalog.
Returns
A key used to store the list layer versions in cache.

◆ CreatePartitionKey()

static std::string olp::cache::KeyGenerator::CreatePartitionKey ( const std::string &  hrn,
const std::string &  layer_id,
const std::string &  partition_id,
const boost::optional< int64_t > &  version 
)
static

Generates cache key for storing partition data.

Parameters
hrnThe HRN of the catalog.
layer_idThe layer of the partition.
partition_idThe partition name.
versionThe version of the catalog.
Returns
A key used to store the patition data in cache.

◆ CreatePartitionsKey()

static std::string olp::cache::KeyGenerator::CreatePartitionsKey ( const std::string &  hrn,
const std::string &  layer_id,
const boost::optional< int64_t > &  version 
)
static

Generates cache key for storing list of partitions.

Parameters
hrnThe HRN of the catalog.
layer_idThe layer of the partition.
versionThe version of the catalog.
Returns
A key used to store the list of patitions in cache.

◆ CreateQuadTreeKey()

static std::string olp::cache::KeyGenerator::CreateQuadTreeKey ( const std::string &  hrn,
const std::string &  layer_id,
olp::geo::TileKey  root,
const boost::optional< int64_t > &  version,
int32_t  depth 
)
static

Generates cache key for storing quadtree metadata.

Parameters
hrnThe HRN of the catalog.
layer_idThe layer of the quadtree.
rootThe root tile of the quadtree.
versionThe version of the catalog.
depthThe quadtree depth.
Returns
A key used to store the quadtree in cache.

The documentation for this class was generated from the following file: