Apache Geode Native C++ Reference 1.15.0
apache::geode::client::StringPrefixPartitionResolver Class Reference

This class implements a partition resolver which routing object is the prefix of a given key. More...

#include <StringPrefixPartitionResolver.hpp>

Inherits apache::geode::client::PartitionResolver.

Public Member Functions

const std::string & getName () override
 Returns the name of the PartitionResolver. More...
 
std::shared_ptr< CacheableKeygetRoutingObject (const EntryEvent &opDetails) override
 

Detailed Description

This class implements a partition resolver which routing object is the prefix of a given key.

Delimiter is set by default to '|', still can be changed.

Note
If prefix is not found in the key an IllegalArgumentException is thrown

Examples:

  • Given key "key-1|timestamp", with delimiter '|', the routing object would be "key-1"
  • Given "key-1#DELIM#timestamp", with delimiter '|', then an exception is thrown.

Member Function Documentation

◆ getName()

const std::string & apache::geode::client::StringPrefixPartitionResolver::getName ( )
overridevirtual

Returns the name of the PartitionResolver.

Returns
String name

Reimplemented from apache::geode::client::PartitionResolver.

◆ getRoutingObject()

std::shared_ptr< CacheableKey > apache::geode::client::StringPrefixPartitionResolver::getRoutingObject ( const EntryEvent opDetails)
overridevirtual
Parameters
opDetailsthe detail of the entry event
Exceptions
RuntimeException- any exception thrown will terminate the operation and the exception will be passed to the calling thread.
Returns
object associated with entry event which allows the Partitioned Region to store associated data together

Implements apache::geode::client::PartitionResolver.


Apache Geode C++ Cache API Documentation