public class ProximateBalance extends DemandProfile
DemandProfile.KeysinterArrivalTime, lastReconfiguredProfile, lastRequestTime, minReconfigurationInterval, minRequestsBeforeDemandReport, minRequestsBeforeReconfiguration, numRequests, numTotalRequestsname| Constructor and Description |
|---|
ProximateBalance(org.json.JSONObject json)
Required JSONObject constructor.
|
ProximateBalance(java.lang.String name)
Required String constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DemandProfile |
clone()
Creates a deep copy of this object.
|
void |
combine(AbstractDemandProfile dp)
Combine the new information in
update into this. |
org.json.JSONObject |
getDemandStats()
All relevant stats must be serializable into JSONObject.
|
double |
getNumRequests() |
double |
getNumTotalRequests() |
double |
getRequestRate() |
void |
justReconfigured()
Tells
this that the current demand profile was just used to
perform reconfiguration. |
static void |
main(java.lang.String[] args) |
java.util.Set<java.lang.String> |
reconfigure(java.util.Set<java.lang.String> curActives,
ReconfigurableAppInfo nodeConfig)
The main reconfiguration policy invoked at reconfigurators (not active
replicas).
|
boolean |
shouldReportDemandStats(Request request,
java.net.InetAddress sender,
ReconfigurableAppInfo nodeConfig)
This method is used to inform the reconfiguration policy that
request received from a client at IP address sender. |
createDemandProfilecreateDemandProfile, createDemandProfile, getName, resetpublic ProximateBalance(java.lang.String name)
name - public ProximateBalance(org.json.JSONObject json)
throws org.json.JSONException
json - org.json.JSONExceptionpublic boolean shouldReportDemandStats(Request request, java.net.InetAddress sender, ReconfigurableAppInfo nodeConfig)
request received from a client at IP address sender. The
parameter nodeConfig provides the list of all active replica
locations. The reconfiguration policy may use this information to
assimilate a demand distribution and use that to determine whether and
how to reconfigure the current set of replicas.
The simplistic example below ignores the sender information that
in general is needed to determine the geo-distribution of demand.shouldReportDemandStats in class DemandProfilepublic double getRequestRate()
getRequestRate in class DemandProfilepublic double getNumRequests()
getNumRequests in class DemandProfilepublic double getNumTotalRequests()
getNumTotalRequests in class DemandProfilepublic org.json.JSONObject getDemandStats()
AbstractDemandProfileAbstractDemandProfile.reconfigure(Set, ReconfigurableAppInfo)
that is invoked at reconfigurators (not active replicas).getDemandStats in class DemandProfilepublic DemandProfile clone()
AbstractDemandProfileMap, then a new Map has to be created inside the clone() method.clone in class AbstractDemandProfilepublic void combine(AbstractDemandProfile dp)
AbstractDemandProfileupdate into this. This
method is used at reconfigurators to combine a newly received demand
report with an existing demand report.combine in class DemandProfilepublic java.util.Set<java.lang.String> reconfigure(java.util.Set<java.lang.String> curActives,
ReconfigurableAppInfo nodeConfig)
AbstractDemandProfilereconfigure in class DemandProfileReconfigurationConfig.RC.RECONFIGURE_IN_PLACE is set to false.public void justReconfigured()
AbstractDemandProfilethis that the current demand profile was just used to
perform reconfiguration. This information is useful for implementing
policies based on the difference between the current demand profile and
the one at the time of the most recent reconfiguration, e.g., reconfigure
only if the demand from some region has changed by more than 10%.justReconfigured in class DemandProfilepublic static void main(java.lang.String[] args)
args -