neuray API Programmer's Manual

mi::neuraylib::IHost_callback Class Reference

[Configuration Interfaces]

Description

Abstract interface to report cluster status changes. Each of the methods below deals with a certain type of cluster status changes, for example, hosts joining or leaving a cluster.

Users can implement this interface and register an instance of the implementation class as callback object to be notified in case of cluster status changes (see mi::neuraylib::INetwork_configuration::register_host_callback()).

Note:

Instances of this interface should not be created on the stack, since this might lead to premature destruction of such instances while still being in use by .

Public Member Functions

virtual void connection_callback( Uint32 host_id, bool flag) =0
This function is called when this host established or lost the connection to the cluster. More...
virtual void database_status_callback( const char* status) =0
This function is called when the database changes status. More...
virtual void membership_callback( Uint32 host_id, bool flag) =0
This function is called when a remote host joined or left the cluster. More...
virtual void property_callback( Uint32 host_id, const IHost_properties* properties) =0
This function is called when a remote host communicates its properties. More...
virtual void synchronizer_callback( Uint32 host_id) =0
This function is called whenever the synchronizer host changes. More...

Member Functions

virtual void mi::​neuraylib::​IHost_callback::connection_callback( Uint32 host_id, bool flag) [pure virtual]

This function is called when this host established or lost the connection to the cluster. It should return as soon as possible because it may block further network operations.

Parameters

host_id
The host ID of this host. This ID is guaranteed to be unique in a cluster and will never be reused for another host.
flag
true in case of an established connection, false in case of a lost connection.
virtual void mi::​neuraylib::​IHost_callback::database_status_callback( const char* status) [pure virtual]

This function is called when the database changes status. When the database is fully operational the function will be called first with the status "ok". When the database is recovering from a host failure the function will be called with the status "recovery". When the recovery is finished the function will be called with the status "ok" again.

Note that the database can switch to recovery mode when a host is started. This happens when the configured redundancy level could not be reached because simply not enough hosts where present before.

Parameters

status
The status of the database.
virtual void mi::​neuraylib::​IHost_callback::membership_callback( Uint32 host_id, bool flag) [pure virtual]

This function is called when a remote host joined or left the cluster. It should return as soon as possible because it may block further network operations.

Parameters

host_id
The host ID of the host joining or leaving. This ID is guaranteed to be unique in a cluster and will never be reused for another host.
flag
true in case of a joining host, false in case of a leaving host.
virtual void mi::​neuraylib::​IHost_callback::property_callback( Uint32 host_id, const IHost_properties* properties) [pure virtual]

This function is called when a remote host communicates its properties. It should return as soon as possible because it may block further network operations.

Parameters

host_id
The host ID of the remote host. This ID is guaranteed to be unique in a cluster and will never be reused for another host.
properties
The properties of the remote host, e.g., its address.
virtual void mi::​neuraylib::​IHost_callback::synchronizer_callback( Uint32 host_id) [pure virtual]

This function is called whenever the synchronizer host changes. It can be used to record the synchronizer ID for display usages. Since it is guaranteed that there is at any point in time exactly one synchronizer in a working cluster it can also be used to do certain tasks only on the synchronizer.

Parameters

host_id
The host ID of the new synchronizer.