setQuorum

This method is called by the master to set the HA quorum at runtime.

For an overview see page HA Applications

Prototype

 
    public void setQuorum(int quorum);
 

Arguments

quorum The number of active replicas that is acceptable (including 0)

Description

This function is called by the master to set the HA quorum at runtime. Note that a value of quorum greater than 0 is allowed only for synchronous replication mode.

Return Codes

No value returned.

Example

     
    MasterConnection con = new MasterConnection(db);
    MasterConnection.Parameters ha_params = new MasterConnection.Parameters();
    ha_params.quorum = 1; /* set initial value for HA quorum */
    con.setReplicationMode(ha_params);
    ...
     
    con.setQuorum(0); /* change HA quorum at runtime */