mi::neuraylib::ICluster_manager_connection Class Reference
[Cluster manager]
Description
Represents a connection to a cluster manager. The connection allows inquiring information about the cluster manager and the nodes in the pool. Furthermore, it allows reserving a cluster of nodes.
See also:
mi::neuraylib::ICluster_manager_configuration::connect()
Public Member Functions
- virtual bool authenticate_user( const char* user_name, const char* password, bool* is_admin = 0, Sint32* errors = 0) =0
- Checks whether an user exists on the cluster manager and whether the password matches. More...
- virtual const char* get_address() const =0
- Returns the address of the cluster manager to which this connection connects to.
- virtual bool get_auto_release_cluster() =0
- Return if auto-release is enabled or not. More...
- virtual ICluster_manager_cluster* get_cluster() =0
- Returns the reserved cluster for this user, or NULL if there is none. More...
- virtual const ICluster_pool_information* get_cluster_pool_information() const =0
- Returns information about the pool. More...
- virtual const ISoftware_package* get_compatible_software_package( Size index) const =0
- Returns a compatible software package. More...
- virtual Size get_number_of_compatible_software_packages() const =0
- Returns the number of compatible software packages. More...
- virtual Size get_number_of_software_packages() const =0
- Returns the number of software packages. More...
- virtual const ISoftware_package* get_software_package( Size index) const =0
- Returns a software package. More...
- virtual const char* get_vca_name() const =0
- Get the name of the VCA to which this connections connects to. More...
- virtual Sint32 release_cluster() =0
- Releases the reserved cluster for this user. More...
- virtual ICluster_manager_cluster* reserve_cluster( Size requested_nodes, const char* software_package_id, Sint32* errors = 0) =0
- Reserves a cluster of nodes from the pool of free nodes. More...
- virtual void set_auto_release_cluster( bool auto_release_enabled) =0
- Sets if a reserved cluster should be auto-released, if this connection is closed / lost for example because of a network outage or a crash of the client process. More...
- virtual void set_cluster_notification_callback( ICluster_notification_callback* callback) =0
- Sets a callback to be called in case of certain events. More...
Member Functions
- virtual bool mi::neuraylib::ICluster_manager_connection::authenticate_user( const char* user_name, const char* password, bool* is_admin = 0, Sint32* errors = 0) [pure virtual]
-
Checks whether an user exists on the cluster manager and whether the password matches. This can be used to share an authentication database between a cluster manager and a connected application.
Parameters
- user_name
- User name of the user to be checked.
- password
- Password of the user to be checked.
- is_admin
- An optional pointer to a bool to which the information is written whether an authenticated user is an admin. If the user could not be authenticated, then the content is undefined.
- errors
- An optional pointer to an mi::Sint32 to which an error code will be written. The error codes have the following meaning:
- 0: Success.
- -3: The connection to the cluster manager broke down.
- -5: The request timed out. Please check if the cluster manager is working properly.
Returns
true , if the user could be authenticated, or false otherwise.
- virtual const char* mi::neuraylib::ICluster_manager_connection::get_address() const [pure virtual]
-
Returns the address of the cluster manager to which this connection connects to.
- virtual bool mi::neuraylib::ICluster_manager_connection::get_auto_release_cluster() [pure virtual]
-
Return if auto-release is enabled or not.
Returns
True , if auto-release is enabled, false otherwise.
- virtual ICluster_manager_cluster* mi::neuraylib::ICluster_manager_connection::get_cluster() [pure virtual]
-
Returns the reserved cluster for this user, or NULL if there is none.
Note:This method also returns the cluster if it was reserved by other means than via reserve_cluster(), e.g., via a GUI.
- virtual const ICluster_pool_information* mi::neuraylib::ICluster_manager_connection::get_cluster_pool_information() const [pure virtual]
-
Returns information about the pool. This will ask the cluster manager for the information and block until the information was received.
- virtual const ISoftware_package* mi::neuraylib::ICluster_manager_connection::get_compatible_software_package( Size index) const [pure virtual]
-
Returns a compatible software package. An installed software package is compatible if its Bridge version is compatible with the client's Bridge version.
See also:
get_number_of_compatible_software_packages()
Parameters
- index
- The index of the software package.
Returns
The index-th software package or NULL if index is out of bounds.
- virtual Size mi::neuraylib::ICluster_manager_connection::get_number_of_compatible_software_packages() const [pure virtual]
-
Returns the number of compatible software packages. An installed software package is compatible if its Bridge version is compatible with the client's Bridge version.
See also:
get_compatible_software_package()
- virtual Size mi::neuraylib::ICluster_manager_connection::get_number_of_software_packages() const [pure virtual]
- virtual const ISoftware_package* mi::neuraylib::ICluster_manager_connection::get_software_package( Size index) const [pure virtual]
-
Parameters
- index
- The index of the software package.
Returns
The index-th software package or NULL if index is out of bounds.
- virtual const char* mi::neuraylib::ICluster_manager_connection::get_vca_name() const [pure virtual]
-
Get the name of the VCA to which this connections connects to.
Returns
The name of the VCA or VCA pool.
- virtual Sint32 mi::neuraylib::ICluster_manager_connection::release_cluster() [pure virtual]
-
Releases the reserved cluster for this user.
Note:This method must not be called from within a callback.
Returns
- 0: Success.
- -1: Cluster could not be released/was immediately re-established.
- -2: No cluster is running at the moment.
- virtual ICluster_manager_cluster* mi::neuraylib::ICluster_manager_connection::reserve_cluster( Size requested_nodes, const char* software_package_id, Sint32* errors = 0) [pure virtual]
-
Reserves a cluster of nodes from the pool of free nodes.
Note:Currently only one cluster may be reserved at a time. This method must not be called from within a callback.
Note:Releasing the returned interface will not release the reserved cluster. Use release_cluster() to release the reserved cluster.
Parameters
- requested_nodes
- The number of nodes requested for the cluster. This is the maximum number of nodes. The returned cluster may contain fewer nodes.
- software_package_id
- The ID of the software package which should be started. The value NULL can be used to specify that no software package should be started as part of the reservation process.
- errors
- An optional pointer to an mi::Sint32 to which an error code will be written. The error codes have the following meaning:
- 0: Success.
- -1: No nodes were available.
- -2: There was already running cluster. Release that first.
- -3: The connection to the cluster manager broke down.
- -4: The selected software package is not available
- -5: The request timed out. Please check if the cluster manager is working properly.
Returns
The reserved cluster or NULL in case of failure.
- virtual void mi::neuraylib::ICluster_manager_connection::set_auto_release_cluster( bool auto_release_enabled) [pure virtual]
-
Sets if a reserved cluster should be auto-released, if this connection is closed / lost for example because of a network outage or a crash of the client process. If set, then any reserved cluster will be released by the VCA manager when the connection is closed from its point of view. The default is that auto-release is not enabled.
Parameters
- auto_release_enabled
- True, if auto-release should be enabled, false otherwise.
- virtual void mi::neuraylib::ICluster_manager_connection::set_cluster_notification_callback( ICluster_notification_callback* callback) [pure virtual]
-
Sets a callback to be called in case of certain events. If there was a previously installed callback, it will be released.
Note:This method must not be called from within such a callback.
Parameters
- callback
- The new callback object.