Manage DataStoreClient instance

In this section, learn how to:

Create a DataStoreClient instance

Create a DataStoreClient instance using a shared pointer to the previously created DataStoreServer instance.

Notes:

  • It is not recommended to mix OCM data from different catalog versions. To keep OCM data consistent, consume data from each catalog version separately through its own DataStoreClient instance. Before switching to a new catalog version, ensure that any local cache, which the user maintains outside of DataStoreClient, is cleaned up. OCMAM will download only map data, which has changed between versions and keep the unchanged data intact. To ensure that the map data is not mixed up, it is recommended to decode the map data anew for every catalog version.

  • Multiple DataStoreClient instances must use the same DataStoreServer instance.

  • To consume a specific catalog version data, add a catalog to the relevant DataStoreClient. For more information on how to add a catalog, refer to Add catalog.

Example:

#include <olp/clientmap/datastore/DataStoreClient.h>
...
olp::clientmap::datastore::DataStoreClientSettings client_settings;

olp::clientmap::datastore::DataStoreClient client( server, client_settings );

In the example above, server is a shared pointer to the previously created DataStoreServer instance.

Cancel pending requests

To cancel network requests from a DataStoreClient instance that are not complete yet, use the CancelPendingRequests method of the DataStoreClient class.

Example:

client.CancelPendingRequests( );

In the example above, client is the previously created DataStoreClient instance.

Shut down a DataStoreClient instance

To cancel network requests from a DataStoreClient instance that are not complete yet and not to allow further requests from the same DataStoreClient instance, use the Shutdown method of the DataStoreClient class.

Note: When a DataStoreClient instance is shut down, all requests to the same instance end with the kForbidden error code.

Example:

client.Shutdown( );

In the example above, client is the previously created DataStoreClient instance.

results matching ""

    No results matching ""