Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual Ndb_cluster_connection::set_service_uri()

Description.  Beginning with NDB 7.5.7 and NDB 7.8.2, this method can be used to create a URI for publication in service_URI column of the the application's row in the ndbinfo.processes table.

Provided that this method is called prior to invoking connect(), the service URI is published immediately upon connection; otherwise, it is published after a delay of up to HeartbeatIntervalDbApi milliseconds.


int set_service_uri
      const char* scheme, 
      const char* host, 
      int port,
      const char* path

Parameters.  This method takes the parameters listed here:

  • scheme: The URI scheme. This is resticted to lowercase letters, numbers, and the characters ., +, and - (period, plus sign, and dash). The maximu length is 16 characters; any characters over this limit are truncated.

  • host: The URI network address or host name. The maximum length is 48 characters (sufficient for an IPv6 network address); any characters over this limit are truncated. If null, each data node reports the network address from its own connection to this node. An Ndb_cluster_connection that uses multiple transporters or network addresses to connect to different data nodes is reflected in multiple rows in the ndbinfo.processes table.

  • port: The URI port. This is not published if it is equal to 0.

  • path: The URI path, possibly followed by a query string beginning with ?. The maximum combined length of the path and query may not exceed 128 characters; if longer, it is truncated to this length.

    The path may not begin with a double slash (//).

Return value.  0 on success, 1 in the event of a syntax error.