Constructor
new AllowListPolicy(childPolicy, allowList)
Create a new policy that wraps the provided child policy but only "allow" hosts from the provided list.
Parameters:
Name | Type | Description |
---|---|---|
childPolicy |
LoadBalancingPolicy | the wrapped policy. |
allowList |
Array.<string> | The hosts address in the format ipAddress:port. Only hosts from this list may get connected to (whether they will get connected to or not depends on the child policy). |
- Source:
Extends
- LoadBalancingPolicy
Methods
getDistance(host)
Uses the child policy to return the distance to the host if included in the allow list. Any host not in the while list will be considered ignored.
Parameters:
Name | Type | Description |
---|---|---|
host |
- Source:
getOptions()
Gets an associative array containing the policy options.
- Source:
newQueryPlan()
Returns the hosts to use for a new query filtered by the allow list.
- Source: