DB_ENV->repmgr_site_by_eid()

#include <db.h>

int
DB_ENV->repmgr_site_by_eid(DB_ENV *env, int eid,
    DB_SITE **sitep);  

The DB_ENV->repmgr_site_by_eid() method returns a DB_SITE handle based on the site's environment ID value. You use the DB_SITE handle to configure and manage replication sites.

This method allocates memory for the handle, returning a pointer to the structure in the memory to which sitep refers. To release the allocated memory and discard the handle, call the DB_SITE->close() method.

The DB_ENV->repmgr_site_by_eid() method may be called at any time after opening the environment.

The DB_ENV->repmgr_site_by_eid() method returns a non-zero error value on failure and 0 on success.

Parameters

eid

The environment ID of the site for which you want to create the DB_SITE handle. You can obtain a site's EID by using the DB_SITE->get_eid() method.

sitep

References memory into which a pointer to the allocated handle is copied.

Errors

The DB_ENV->repmgr_site() method may fail and return one of the following non-zero errors:

DB_NOTFOUND

Returned if there is no site corresponding to the supplied eid value.

EINVAL

If this method is called from a Base API application, or if an invalid flag value or parameter was specified.

Class

DB_ENV

See Also

Replication and Related Methods