public class CpuUsageStrategy<T extends Endpoint> extends XorShiftRandomStrategy<T>
| Modifier and Type | Field and Description |
|---|---|
protected int |
lowCpuUsage
lowCpuUsage ~= zero CPU usage
|
protected int |
sampleCount
This strategy compares number of 'sampleCount' random node.
|
protected Transporter |
transporter |
rndendpointCache, endpoints, nodeID, preferLocal| Constructor and Description |
|---|
CpuUsageStrategy(ServiceBroker broker,
boolean preferLocal,
int sampleCount,
int lowCpuUsage,
Transporter transporter) |
| Modifier and Type | Method and Description |
|---|---|
Endpoint |
next(Context ctx,
Endpoint[] array) |
addEndpoint, getAllEndpoints, getEndpoint, getEndpointsByNodeID, isEmpty, removeprotected final int sampleCount
protected final int lowCpuUsage
protected final Transporter transporter
public CpuUsageStrategy(ServiceBroker broker, boolean preferLocal, int sampleCount, int lowCpuUsage, Transporter transporter)