DiCE API nvidia_logo_transpbg.gif Up
mi::neuraylib::ICache_manager Class Referenceabstract

Represents an instance of the cache manager. More...

#include <icache_manager.h>

Inheritance diagram for mi::neuraylib::ICache_manager:

Public Member Functions

virtual Sint32 start (const char *listen_address, const char *directory)=0
 Starts the cache manager. More...
 
virtual Sint32 shutdown ()=0
 Shuts down 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 const IStringget_http_address () const =0
 Returns the address of the HTTP server, or NULL if none is set. More...
 
virtual const IStringget_http_user_name () const =0
 Returns the user name for the HTTP server, or NULL if none is set. More...
 
virtual const IStringget_http_password () const =0
 Returns the password for the HTTP server, or NULL if none is set. More...
 
virtual Sint32 set_multicast_address (const char *address)=0
 Sets the multicast address of the cache manager. More...
 
virtual const IStringget_multicast_address () const =0
 Returns the multicast address, or NULL if none is set. More...
 
virtual Sint32 set_cluster_interface (const char *address)=0
 Sets the cluster interface used by the cache manager. More...
 
virtual const IStringget_cluster_interface () const =0
 Returns the cluster interface, or NULL if none is set. More...
 
virtual Sint32 set_use_rdma (bool use_rdma)=0
 Enables or disables the usage of RDMA InfiniBand. More...
 
virtual bool get_use_rdma () const =0
 Indicates whether RDMA InfiniBand is enabled. More...
 
virtual Sint32 set_rdma_interface (const char *rdma_interface)=0
 Set the RDMA InfiniBand interface to be used. More...
 
virtual const IStringget_rdma_interface () const =0
 Returns RDMA InfiniBand interface to be used. More...
 
virtual Sint32 set_admin_http_address (const char *address)=0
 Sets the address for the administrative HTTP server. More...
 
virtual const IStringget_admin_http_address () const =0
 Returns the address of the admin HTTP server, or NULL if none is set. More...
 
virtual Sint32 set_memory_limits (Size low_water, Size high_water)=0
 Sets the memory limits for the garbage collection. More...
 
virtual void get_memory_limits (Size *low_water, Size *high_water) const =0
 Returns the memory limits for the garbage collection. More...
 
virtual Sint32 set_reference_count_checking (bool enabled)=0
 Enables or disables checking of reference counts. More...
 
virtual bool get_reference_count_checking () const =0
 Indicates whether checking of reference counts is enabled. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x6b063e2d, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x6b063e2d, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed 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

Member Function Documentation

 get_admin_http_address()

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.

 get_cluster_interface()

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

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

 get_http_address()

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.

 get_http_password()

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.

 get_http_user_name()

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.

 get_memory_limits()

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.

 get_multicast_address()

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

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

 get_rdma_interface()

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.

 get_reference_count_checking()

virtual bool mi::neuraylib::ICache_manager::get_reference_count_checking ( ) const
pure virtual

Indicates whether checking of reference counts is enabled.

 get_use_rdma()

virtual bool mi::neuraylib::ICache_manager::get_use_rdma ( ) const
pure virtual

Indicates whether RDMA InfiniBand is enabled.

See also
set_use_rdma()

 set_admin_http_address()

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
addressThe 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.

 set_cluster_interface()

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
addressThe 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.

 set_http_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
addressThe address on which the HTTP server listens, or NULL to disable authentication.
user_nameThe user name for authentication with the HTTP server, or NULL to disable authentication.
passwordThe 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.

 set_memory_limits()

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_waterThe garbage collection stops when memory usage (in bytes) drops below this value.
high_waterThe 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).

 set_multicast_address()

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
addressThe multicast address to be used, or NULL to disable clustering.
Returns
- 0: Success.
  • -1: The cache manager is already running.
  • -2: Invalid address.

 set_rdma_interface()

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_interfaceThe 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.

 set_reference_count_checking()

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.

 set_use_rdma()

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_rdmaIndicates whether RDMA InfiniBand should be used (if it is available).
Returns
0, in case of success, -1 in case of failure.

 shutdown()

virtual Sint32 mi::neuraylib::ICache_manager::shutdown ( )
pure virtual

Shuts down the cache manager.

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

 start()

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

Starts the cache manager.

Parameters
listen_addressThe address to listen on.
directoryThe 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.