Represents a connection to a cluster manager.
More...
|
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...
|
|
static bool |
compare_iid (const Uuid &iid) |
|
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
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()
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. |
[out] |
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. |
[out] |
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.
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.
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 |
Returns a software package.
- See Also
- get_number_of_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 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.
- 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.
- 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. |
[out] |
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.
- Note
- Releasing the returned interface will not release the reserved cluster. Use release_cluster() to release the reserved cluster.
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. |
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. |