private getContactPoints ( $ipAddress, $numberOfNodes ) : string | ||
$ipAddress | Starting IP address | |
$numberOfNodes | Total number of nodes in the cluster | |
Résultat | string | Comma delimited ip addresses |
private function getContactPoints($ipAddress, $numberOfNodes)
{
// Generate the contact points from the IP address and total nodes
$ipPrefix = substr($ipAddress, 0, strlen($ipAddress) - 1);
$contactPoints = $ipAddress;
foreach (range(2, $numberOfNodes) as $i) {
$contactPoints .= ", {$ipPrefix}{$i}";
}
// Return the contact points
return $contactPoints;
}