|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.routing.DefaultResizer
public class DefaultResizer
Constructor Summary | |
---|---|
DefaultResizer(int lower,
int upper)
Java API constructor for default values except bounds. |
|
DefaultResizer(int lowerBound,
int upperBound,
int pressureThreshold,
double rampupRate,
double backoffThreshold,
double backoffRate,
int messagesPerResize)
|
Method Summary | |
---|---|
static DefaultResizer |
apply(com.typesafe.config.Config resizerConfig)
Creates a new DefaultResizer from the given configuration |
int |
backoff(int pressure,
int capacity)
Computes a proposed negative (or zero) capacity delta using the configured backoffThreshold and backoffRate |
double |
backoffRate()
|
double |
backoffThreshold()
|
int |
capacity(scala.collection.immutable.IndexedSeq<Routee> routees)
Returns the overall desired change in resizer capacity. |
int |
filter(int pressure,
int capacity)
This method can be used to smooth the capacity delta by considering the current pressure and current capacity. |
static scala.Option<DefaultResizer> |
fromConfig(com.typesafe.config.Config resizerConfig)
|
boolean |
isTimeForResize(long messageCounter)
Is it time for resizing. |
int |
lowerBound()
|
int |
messagesPerResize()
|
int |
pressure(scala.collection.immutable.IndexedSeq<Routee> routees)
Number of routees considered busy, or above 'pressure level'. |
int |
pressureThreshold()
|
int |
rampup(int pressure,
int capacity)
Computes a proposed positive (or zero) capacity delta using the configured rampupRate . |
double |
rampupRate()
|
int |
resize(scala.collection.immutable.IndexedSeq<Routee> currentRoutees)
Decide if the capacity of the router need to be changed. |
int |
upperBound()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface scala.Product |
---|
productArity, productElement, productIterator, productPrefix |
Methods inherited from interface scala.Equals |
---|
canEqual, equals |
Constructor Detail |
---|
public DefaultResizer(int lowerBound, int upperBound, int pressureThreshold, double rampupRate, double backoffThreshold, double backoffRate, int messagesPerResize)
public DefaultResizer(int lower, int upper)
lower
- (undocumented)upper
- (undocumented)Method Detail |
---|
public static DefaultResizer apply(com.typesafe.config.Config resizerConfig)
resizerConfig
- (undocumented)
public static scala.Option<DefaultResizer> fromConfig(com.typesafe.config.Config resizerConfig)
public int lowerBound()
public int upperBound()
public int pressureThreshold()
public double rampupRate()
public double backoffThreshold()
public double backoffRate()
public int messagesPerResize()
public boolean isTimeForResize(long messageCounter)
Resizer
CAUTION: this method is invoked from the thread which tries to send a message to the pool, i.e. the ActorRef.!() method, hence it may be called concurrently.
isTimeForResize
in interface Resizer
messageCounter
- (undocumented)
public int resize(scala.collection.immutable.IndexedSeq<Routee> currentRoutees)
Resizer
isTimeForResize
returns true and no other resize is in progress.
Return the number of routees to add or remove. Negative value will remove that number of routees. Positive value will add that number of routess. 0 will not change the routees.
This method is invoked only in the context of the Router actor.
resize
in interface Resizer
currentRoutees
- (undocumented)
public int capacity(scala.collection.immutable.IndexedSeq<Routee> routees)
routees
- The current actor in the resizer
public int pressure(scala.collection.immutable.IndexedSeq<Routee> routees)
Implementation depends on the value of pressureThreshold
(default is 1).
pressureThreshold
messages in their mailbox. Note that estimating mailbox size of
default UnboundedMailbox is O(N) operation.
routees
- the current resizer of routees
public int filter(int pressure, int capacity)
pressure
- current number of busy routeescapacity
- current number of routees
public int rampup(int pressure, int capacity)
rampupRate
.
pressure
- the current number of busy routeescapacity
- the current number of total routees
public int backoff(int pressure, int capacity)
backoffThreshold
and backoffRate
pressure
- the current number of busy routeescapacity
- the current number of total routees
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |