public class ProximateBalance extends DemandProfile
DemandProfile.Keys
interArrivalTime, lastReconfiguredProfile, lastRequestTime, minReconfigurationInterval, minRequestsBeforeDemandReport, minRequestsBeforeReconfiguration, numRequests, numTotalRequests
name
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 . |
createDemandProfile
createDemandProfile, createDemandProfile, getName, reset
public ProximateBalance(java.lang.String name)
name
- public ProximateBalance(org.json.JSONObject json) throws org.json.JSONException
json
- org.json.JSONException
public 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 DemandProfile
public double getRequestRate()
getRequestRate
in class DemandProfile
public double getNumRequests()
getNumRequests
in class DemandProfile
public double getNumTotalRequests()
getNumTotalRequests
in class DemandProfile
public org.json.JSONObject getDemandStats()
AbstractDemandProfile
AbstractDemandProfile.reconfigure(Set, ReconfigurableAppInfo)
that is invoked at reconfigurators (not active replicas).getDemandStats
in class DemandProfile
public DemandProfile clone()
AbstractDemandProfile
Map
, then a new Map has to be created inside the clone() method.clone
in class AbstractDemandProfile
public void combine(AbstractDemandProfile dp)
AbstractDemandProfile
update
into this
. This
method is used at reconfigurators to combine a newly received demand
report with an existing demand report.combine
in class DemandProfile
public java.util.Set<java.lang.String> reconfigure(java.util.Set<java.lang.String> curActives, ReconfigurableAppInfo nodeConfig)
AbstractDemandProfile
reconfigure
in class DemandProfile
ReconfigurationConfig.RC.RECONFIGURE_IN_PLACE
is set to false.public void justReconfigured()
AbstractDemandProfile
this
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 DemandProfile
public static void main(java.lang.String[] args)
args
-