neuray API Programmer's Manual

mi::neuraylib::ICache_manager Class Reference

Description

Represents an instance of the cache manager. You cannot directly interact with the cache manager yourself. The purpose of this interface is to allow you to start a cache manager such that it can be used by other components, e.g., the Bridge. See mi::bridge::IApplication::set_disk_cache().

See also:

mi::neuraylib::ICache_manager_factory

Public Member Functions

virtual const IStringget_admin_http_address() const =0
Returns the address of the admin HTTP server, or NULL if none is set.
virtual const IStringget_cluster_interface() const =0
Returns the cluster interface, or NULL if none is set.
virtual const IStringget_http_address() const =0
Returns the address of the HTTP server, or NULL if none is set.
virtual const IStringget_http_password() const =0
Returns the password for the HTTP server, or NULL if none is set.
virtual const IStringget_http_user_name() const =0
Returns the user name for the HTTP server, or NULL if none is set.
virtual void get_memory_limits( Size* low_water, Size* high_water) const =0
Returns the memory limits for the garbage collection.
virtual const IStringget_multicast_address() const =0
Returns the multicast address, or NULL if none is set.
virtual const IStringget_rdma_interface() const =0
Returns RDMA InfiniBand interface to be used. More...
virtual bool  get_reference_count_checking() const =0
Indicates whether checking of reference counts is enabled.
virtual bool  get_use_rdma() const =0
Indicates whether RDMA InfiniBand is enabled. More...
virtual Sint32 set_admin_http_address( const char* address) =0
Sets the address for the administrative HTTP server. More...
virtual Sint32 set_cluster_interface( const char* address) =0
Sets the cluster interface used by the cache manager. More...
virtual Sint32 set_http_address( const char* address, const char* user_name, const char* password) =0
Sets the address and authentication information of the HTTP server. More...
virtual Sint32 set_memory_limits( Size low_water, Size high_water) =0
Sets the memory limits for the garbage collection. More...
virtual Sint32 set_multicast_address( const char* address) =0
Sets the multicast address of the cache manager. More...
virtual Sint32 set_rdma_interface( const char* rdma_interface) =0
Set the RDMA InfiniBand interface to be used. More...
virtual Sint32 set_reference_count_checking( bool enabled) =0
Enables or disables checking of reference counts. More...
virtual Sint32 set_use_rdma( bool use_rdma) =0
Enables or disables the usage of RDMA InfiniBand. More...
virtual Sint32 shutdown() =0
Shuts down the cache manager. More...
virtual Sint32 start( const char* listen_address, const char* directory) =0
Starts the cache manager. More...

Member Functions

virtual const IString* mi::​neuraylib::​ICache_manager::get_admin_http_address() const [pure virtual]

Returns the address of the admin HTTP server, or NULL if none is set.

virtual const IString* mi::​neuraylib::​ICache_manager::get_cluster_interface() const [pure virtual]

Returns the cluster interface, or NULL if none is set.

virtual const IString* mi::​neuraylib::​ICache_manager::get_http_address() const [pure virtual]

Returns the address of the HTTP server, or NULL if none is set.

virtual const IString* mi::​neuraylib::​ICache_manager::get_http_password() const [pure virtual]

Returns the password for the HTTP server, or NULL if none is set.

virtual const IString* mi::​neuraylib::​ICache_manager::get_http_user_name() const [pure virtual]

Returns the user name for the HTTP server, or NULL if none is set.

virtual void mi::​neuraylib::​ICache_manager::get_memory_limits( Size* low_water, Size* high_water) const [pure virtual]

Returns the memory limits for the garbage collection.

virtual const IString* mi::​neuraylib::​ICache_manager::get_multicast_address() const [pure virtual]

Returns the multicast address, or NULL if none is set.

virtual const IString* mi::​neuraylib::​ICache_manager::get_rdma_interface() const [pure virtual]

Returns RDMA InfiniBand interface to be used.

See also:

get_rdma_interface()

Returns

The RDMA interface to be used, or NULL if none is found.

virtual bool mi::​neuraylib::​ICache_manager::get_reference_count_checking() const [pure virtual]

Indicates whether checking of reference counts is enabled.

virtual bool mi::​neuraylib::​ICache_manager::get_use_rdma() const [pure virtual]

Indicates whether RDMA InfiniBand is enabled.

See also:

set_use_rdma()

virtual Sint32 mi::​neuraylib::​ICache_manager::set_admin_http_address( const char* address) [pure virtual]

Sets the address for the administrative HTTP server.

See also:

mi::neuraylib::IGeneral_configuration::set_admin_http_address() for details about administrative HTTP servers.

Parameters

address
The address to be used, or NULL to disable the administrative HTTP server.

Returns

- 0: Success.

  • -1: The cache manager is already running.
  • -2: Invalid address.

virtual Sint32 mi::​neuraylib::​ICache_manager::set_cluster_interface( const char* address) [pure virtual]

Sets the cluster interface used by the cache manager.

See also:

mi::neuraylib::INetwork_configuration::set_cluster_interface() for details about cluster interfaces.

Parameters

address
The cluster interface to be used, or NULL to disable a previous setting.

Returns

- 0: Success.

  • -1: The cache manager is already running.
  • -2: Invalid address.

virtual Sint32 mi::​neuraylib::​ICache_manager::set_http_address( const char* address, const char* user_name, const char* password) [pure virtual]

Sets the address and authentication information of the HTTP server.

Parameters

address
The address on which the HTTP server listens, or NULL to disable authentication.
user_name
The user name for authentication with the HTTP server, or NULL to disable authentication.
password
The password for authentication with the HTTP server, or NULL to disable authentication.

Returns

- 0: Success.

  • -1: The cache manager is already running.
  • -2: Invalid address.

virtual Sint32 mi::​neuraylib::​ICache_manager::set_memory_limits( Size low_water, Size high_water) [pure virtual]

Sets the memory limits for the garbage collection. The cache manager uses a garbage collection scheme to attempt to keep the total amount of memory, i.e., disk space, below a configurable limit called high water mark. If that limit is exceeded the garbage collection reduces memory usage usage until another limit, the low water mark, is reached (or no further memory reduction is possible).

Note:
  • No guarantee is given that the high water mark is not exceeded. In particular, cache elements may be retained which prevents them from cache eviction.

  • The memory usage here refers to the size of the cache values itself. The meta data for managing the cache as well as overhead from the database backend are not included here.

Parameters

low_water
The garbage collection stops when memory usage (in bytes) drops below this value.
high_water
The garbage collection starts when memory usage (in bytes) exceeds this value. The value 0 disables the garbage collection.

Returns

  • 0: Success.
  • -1: Invalid parameters (low_water is not less than high_water unless high_water equals zero).

virtual Sint32 mi::​neuraylib::​ICache_manager::set_multicast_address( const char* address) [pure virtual]

Sets the multicast address of the cache manager. The multicast address is used to create a cluster of cache managers.

See also:

mi::neuraylib::INetwork_configuration::set_multicast_address() for details about multicast addresses.

Parameters

address
The multicast address to be used, or NULL to disable clustering.

Returns

- 0: Success.

  • -1: The cache manager is already running.
  • -2: Invalid address.

virtual Sint32 mi::​neuraylib::​ICache_manager::set_rdma_interface( const char* rdma_interface) [pure virtual]

Set the RDMA InfiniBand interface to be used. If unspecified, an arbitrary RDMA InfiniBand interface will be chosen.

See also:

get_rdma_interface()

Parameters

rdma_interface
The RDMA InfiniBand interface to be used, either "ib0", "ib1", etc. or the address of an InfiniBand interface.

Returns

0, in case of success, -1 in case of failure.

virtual Sint32 mi::​neuraylib::​ICache_manager::set_reference_count_checking( bool enabled) [pure virtual]

Enables or disables checking of reference counts. If enabled, reference counts of cache elements are checked during startup and adjusted as necessary. Depending on the cache size this can take some time and delay startup.

virtual Sint32 mi::​neuraylib::​ICache_manager::set_use_rdma( bool use_rdma) [pure virtual]

Enables or disables the usage of RDMA InfiniBand. The default value is false (disabled).

See also:

get_use_rdma()

Parameters

use_rdma
Indicates whether RDMA InfiniBand should be used (if it is available).

Returns

0, in case of success, -1 in case of failure.

virtual Sint32 mi::​neuraylib::​ICache_manager::shutdown() [pure virtual]

Shuts down the cache manager.

Returns

  • 0: Success.
  • -1: The cache manager is not running.

virtual Sint32 mi::​neuraylib::​ICache_manager::start( const char* listen_address, const char* directory) [pure virtual]

Starts the cache manager.

Parameters

listen_address
The address to listen on.
directory
The directory to be used by the cache manager to store its data.

Returns

  • 0: Success.
  • -1: The cache manager is already running.
  • -2: Invalid parameters (listen_address or directory is NULL).
  • -3: Failed to create directory for the disk cache.
  • -4: Directory for the disk cache is not writable.
  • -5: Failed to open the database.
  • -6: Database locked by another instance (from the same or a different process).
  • -7: Failed to upgrade the database.
  • -8: Failed to listen on the listen address.
  • -9: Failed to establish cluster on the multicast address, cluster interface, and/or RDMA interface.