public class LoadingFactor extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
LoadingFactor.ConsumerStatus |
static class |
LoadingFactor.ProducerStatus |
static class |
LoadingFactor.Status |
Modifier and Type | Field and Description |
---|---|
boolean |
autoEvalThreshold
automatic eval threshold
|
ClusterQueue |
clusterQueue
reference to clusterQueue
|
private int |
consumerStatus
consumer status
|
int |
consumThreshold
consumer threshold
|
(package private) float |
lastROFSent |
static org.objectweb.util.monolog.api.Logger |
logger
logger
|
(package private) int |
maxFwdPerQueue
maximum number of messages forwarded to each queue of cluster by round
|
private int |
producerStatus
producer status
|
int |
producThreshold
producer threshold
|
private float |
rateOfFlow |
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
private int |
status
status
|
private long |
statusTime
status time
|
long |
validityPeriod
validity period
|
Constructor and Description |
---|
LoadingFactor(ClusterQueue clusterQueue,
int producThreshold,
int consumThreshold,
boolean autoEvalThreshold,
long validityPeriod,
int maxFwdPerQueue) |
Modifier and Type | Method and Description |
---|---|
private int |
dispatchAndSendTo(Map clusters,
int nbOfPendingMessages,
int nbOfPendingRequests,
int cload,
int pload)
use to dispatch request hope or give messages
in clusters.
|
void |
dispatchLifeCycle(Map clusters)
send a hope request on a cluster queue.
|
void |
evalRateOfFlow(int pendingMessages,
int pendingRequests,
int cload,
int pload)
Evaluates the average rate of flow.
|
int |
factorCheck(Map clusters,
int pendingMessages,
int pendingRequests,
int cload,
int pload)
This method evaluates the rate of flow and activity.
|
String |
getConsumerStatus() |
String |
getProducerStatus() |
float |
getRateOfFlow() |
String |
getStatus() |
private int |
processGive(int nbMsgGive,
Map clusters)
send nb messages on clusters.
|
private void |
processHope(int nbMsgHope,
Map clusters)
send a hope request on a cluster queue.
|
void |
setRateOfFlow(float rateOfFlow) |
void |
setWait() |
String |
toString() |
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
private int status
private long statusTime
private int consumerStatus
private int producerStatus
public ClusterQueue clusterQueue
public int producThreshold
public int consumThreshold
public boolean autoEvalThreshold
public long validityPeriod
int maxFwdPerQueue
private float rateOfFlow
float lastROFSent
public LoadingFactor(ClusterQueue clusterQueue, int producThreshold, int consumThreshold, boolean autoEvalThreshold, long validityPeriod, int maxFwdPerQueue)
public void setRateOfFlow(float rateOfFlow)
public float getRateOfFlow()
public String getStatus()
public String getProducerStatus()
public String getConsumerStatus()
public void setWait()
public void evalRateOfFlow(int pendingMessages, int pendingRequests, int cload, int pload)
pendingMessages
- the number of pending messages.pendingRequests
- the number of pending requests.public int factorCheck(Map clusters, int pendingMessages, int pendingRequests, int cload, int pload)
clusters
- pendingMessages
- pendingRequests
- private int dispatchAndSendTo(Map clusters, int nbOfPendingMessages, int nbOfPendingRequests, int cload, int pload)
clusters
- nbOfPendingMessages
- nbOfPendingRequests
- private int processGive(int nbMsgGive, Map clusters)
nbMsgGive
- clusters
- Map of cluster Queueprivate void processHope(int nbMsgHope, Map clusters)
nbMsgHope
- clusters
- Map of cluster Queuepublic void dispatchLifeCycle(Map clusters)
nbMsgHope
- clusters
- Map of cluster QueueCopyright © 2015 ScalAgent D.T.. All Rights Reserved.