NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::INode_manager_cluster Class Referenceabstract

The interface to a cluster created and managed by the node manager. More...

Inheritance diagram for mi::neuraylib::INode_manager_cluster:
Inheritance graph
[legend]

Public Types

enum   Cluster_status {
  CLUSTER_ESTABLISHED = 0,
  CLUSTER_SHUTDOWN = 1,
  CLUSTER_FAILURE = 2
}
  Possible cluster states. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x0a58b727, 0x0ed4, 0x4ecf, 0x90, 0x9a, 0x30, 0x7c, 0x65, 0xd4, 0x47, 0xe8 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
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...
 

Public Member Functions

virtual const ICluster_descriptor get_cluster_descriptor () const =0
  Returns the cluster descriptor for the cluster. More...
 
virtual Cluster_status  get_cluster_status () const =0
  Returns the status of the cluster. More...
 
virtual void  set_timeout (Float64 timeout)=0
  Sets the keep-alive timeout for the cluster. More...
 
virtual Sint32  set_cluster_property (const char *name, const char *value)=0
  Sets a cluster property. More...
 
virtual Sint32  remove_cluster_property (const char *name)=0
  Removes a cluster property. More...
 
virtual Sint32  shutdown_worker_program ()=0
  Shuts down the program that was started on all worker nodes when the cluster was created. More...
 
virtual Sint32  restart_worker_program ()=0
  Restarts the program that is supposed to run on all workers. More...
 
virtual void  shutdown ()=0
  Initiates the shutdown of the cluster. More...
 
virtual IWorker_node_descriptor get_head_node ()=0
  Returns the head node. More...
 
virtual void  add_worker_property_callback (IWorker_node_property_callback *callback)=0
  Adds a callback to be called when a property of a worker node changes. More...
 
virtual void  remove_worker_property_callback (IWorker_node_property_callback *callback)=0
  Removes a previously added callback for property changes of worker nodes. More...
 
virtual void  add_cluster_property_callback (ICluster_property_callback *callback)=0
  Adds a callback to be called when a cluster property changes. More...
 
virtual void  remove_cluster_property_callback (ICluster_property_callback *callback)=0
  Removes a previously added callback for cluster property changes. More...
 
virtual void  add_worker_node_callback (IWorker_node_callback *callback)=0
  Adds a callback to be called when a worker node joins or leaves the cluster. More...
 
virtual void  remove_worker_node_callback (IWorker_node_callback *callback)=0
  Removes a previously added callback for joined or left worker nodes. More...
 
virtual void  add_client_node_callback (IClient_node_callback *callback)=0
  Adds a callback to be called when a client joins or leaves the cluster. More...
 
virtual void  remove_client_node_callback (IClient_node_callback *callback)=0
  Removes a previously added callback for joined or left client nodes. More...
 
virtual void  add_head_node_callback (IHead_node_callback *callback)=0
  Adds a callback to be called when a new node becomes head node. More...
 
virtual void  remove_head_node_callback (IHead_node_callback *callback)=0
  Removes a previously added callback for notification about a new head node. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from mi::base::Interface_declare< 0x0a58b727, 0x0ed4, 0x4ecf, 0x90, 0x9a, 0x30, 0x7c, 0x65, 0xd4, 0x47, 0xe8 >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

The interface to a cluster created and managed by the node manager.

As long as an application holds this interface, the application will be part of the cluster. Releasing the last handle to this interface gives up cluster membership. When that happens, the node manager will check if there are no more clients. If there are still clients, the cluster will be kept alive. If there are none, then the optional timeout will be started. After the timeout elapsed without another client joining, or immediately if there is no timeout, the cluster will be shut down.

Member Enumeration Documentation

Possible cluster states.

See Also
get_cluster_status().
Enumerator
CLUSTER_ESTABLISHED 

The cluster has been successfully established.

CLUSTER_SHUTDOWN 

The cluster has been shutdown.

CLUSTER_FAILURE 

The cluster has failed for unspecified reasons.

Member Function Documentation

virtual void mi::neuraylib::INode_manager_cluster::add_client_node_callback ( IClient_node_callback callback)
pure virtual

Adds a callback to be called when a client joins or leaves the cluster.

Note that when adding a callback, it will be called automatically for all client nodes already in the cluster.

Parameters
callback The callback to be added.
See Also
remove_client_node_callback()
virtual void mi::neuraylib::INode_manager_cluster::add_cluster_property_callback ( ICluster_property_callback callback)
pure virtual

Adds a callback to be called when a cluster property changes.

When adding a callback it will be called immediately once. The cluster descriptor will contain all cluster properties known at this point.

Parameters
callback The callback to be added.
See Also
remove_cluster_property_callback()
virtual void mi::neuraylib::INode_manager_cluster::add_head_node_callback ( IHead_node_callback callback)
pure virtual

Adds a callback to be called when a new node becomes head node.

When adding a callback, it will be called immediately once.

Parameters
callback The callback to be added.
See Also
remove_client_node_callback()
virtual void mi::neuraylib::INode_manager_cluster::add_worker_node_callback ( IWorker_node_callback callback)
pure virtual

Adds a callback to be called when a worker node joins or leaves the cluster.

Note that when adding a callback, it will be called automatically for all worker nodes already in the cluster.

Parameters
callback The callback to be added.
See Also
remove_worker_node_callback()
virtual void mi::neuraylib::INode_manager_cluster::add_worker_property_callback ( IWorker_node_property_callback callback)
pure virtual

Adds a callback to be called when a property of a worker node changes.

When adding a callback it will be called immediately once for all worker nodes existing at this point. The descriptor contains all properties for the worker node known at this point.

Parameters
callback The callback to be added.
See Also
remove_worker_property_callback()
virtual const ICluster_descriptor* mi::neuraylib::INode_manager_cluster::get_cluster_descriptor ( ) const
pure virtual

Returns the cluster descriptor for the cluster.

virtual Cluster_status mi::neuraylib::INode_manager_cluster::get_cluster_status ( ) const
pure virtual

Returns the status of the cluster.

virtual IWorker_node_descriptor* mi::neuraylib::INode_manager_cluster::get_head_node ( )
pure virtual

Returns the head node.

The head node is a cluster member flagged by the node manager for applications that need support for a head node. It can be referenced by a placeholder substring in the argument string passed to mi::neuraylib::INode_manager_client::join_or_create_cluster().

See Also
mi::neuraylib::INode_manager_client::join_or_create_cluster() for how to reference the head node in the argument string.
Returns
The descriptor for the head node, or NULL if no head node has been flagged.
virtual void mi::neuraylib::INode_manager_cluster::remove_client_node_callback ( IClient_node_callback callback)
pure virtual

Removes a previously added callback for joined or left client nodes.

Parameters
callback The callback to be removed.
See Also
add_client_node_callback()
virtual Sint32 mi::neuraylib::INode_manager_cluster::remove_cluster_property ( const char *  name)
pure virtual

Removes a cluster property.

This change will be forwarded immediately to all clients.

See Also
set_cluster_property() to set cluster properties, get_cluster_descriptor() and mi::neuraylib::ICluster_descriptor to retrieve cluster properties
Parameters
name The name of the property to remove.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no property with the given name.
virtual void mi::neuraylib::INode_manager_cluster::remove_cluster_property_callback ( ICluster_property_callback callback)
pure virtual

Removes a previously added callback for cluster property changes.

Parameters
callback The callback to be removed.
See Also
add_cluster_property_callback()
virtual void mi::neuraylib::INode_manager_cluster::remove_head_node_callback ( IHead_node_callback callback)
pure virtual

Removes a previously added callback for notification about a new head node.

Parameters
callback The callback to be removed.
See Also
add_client_node_callback()
virtual void mi::neuraylib::INode_manager_cluster::remove_worker_node_callback ( IWorker_node_callback callback)
pure virtual

Removes a previously added callback for joined or left worker nodes.

Parameters
callback The callback to be removed.
See Also
add_worker_node_callback()
virtual void mi::neuraylib::INode_manager_cluster::remove_worker_property_callback ( IWorker_node_property_callback callback)
pure virtual

Removes a previously added callback for property changes of worker nodes.

Parameters
callback The callback to be removed.
See Also
add_worker_property_callback()
virtual Sint32 mi::neuraylib::INode_manager_cluster::restart_worker_program ( )
pure virtual

Restarts the program that is supposed to run on all workers.

The program command line used will be the same that was passed to mi::neuraylib::INode_manager_client::join_or_create_cluster() when the cluster was created.

Returns
  • 0: Success.
  • -1: An error occured while restarting.
virtual Sint32 mi::neuraylib::INode_manager_cluster::set_cluster_property ( const char *  name,
const char *  value 
)
pure virtual

Sets a cluster property.

This change will be forwarded immediately to all clients.

See Also
remove_cluster_property() to remove cluster properties, get_cluster_descriptor() and mi::neuraylib::ICluster_descriptor to retrieve cluster properties
Parameters
name The name of the property to set.
value The value string to be set for the property.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointers).
virtual void mi::neuraylib::INode_manager_cluster::set_timeout ( Float64  timeout)
pure virtual

Sets the keep-alive timeout for the cluster.

The keep-alive timeout specifies the amount of time (in seconds) the cluster will remain operational after the last client left the cluster. If no timeout is set, the value defaults to 0, meaning the cluster will be shut down as soon as the last connected client disconnects.

See Also
mi::neuraylib::ICluster_descriptor::get_timeout()
virtual void mi::neuraylib::INode_manager_cluster::shutdown ( )
pure virtual

Initiates the shutdown of the cluster.

This method shuts down the cluster unconditionally, independent of the keep-alive timeout or the number of client nodes using the cluster.

virtual Sint32 mi::neuraylib::INode_manager_cluster::shutdown_worker_program ( )
pure virtual

Shuts down the program that was started on all worker nodes when the cluster was created.

The cluster with all worker nodes is retained. This call will usually followed by a call to restart_worker_program().

Returns
  • 0: Success.
  • -1: An error occured while shutting down.