Gemfire JavaDocs
Package org.apache.geode.cache.server
Class ServerLoad
- java.lang.Object
-
- org.apache.geode.cache.server.ServerLoad
-
- All Implemented Interfaces:
java.io.Serializable
,DataSerializable
public final class ServerLoad extends java.lang.Object implements DataSerializable
A data object containing the load information for a cache server. This object is returned fromServerLoadProbe.getLoad(ServerMetrics)
and indicates how heavily loaded the server is. The values returned bygetConnectionLoad()
andgetSubscriptionConnectionLoad()
can be any number greater than 0. A larger load value means that the server has more load. The values returned by getLoadPerConnection() and getLoadPerSubscriptionConnection are used to estimate the effect of new connections before the connects are actually made to this server. The load is estimated asload + loadPerConnection*numAdditionalConnections.
- Since:
- GemFire 5.7
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.geode.DataSerializable
DataSerializable.Replaceable
-
-
Constructor Summary
Constructors Constructor Description ServerLoad()
ServerLoad(float connectionLoad, float loadPerConnection, float subscriptionConnectionLoad, float loadPerSubscriptionConnection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
void
fromData(java.io.DataInput in)
Reads the state of this object as primitive data from the givenDataInput
.float
getConnectionLoad()
Get the load on the server due to client to server connections.float
getLoadPerConnection()
Get an estimate of the how much load each new connection will add to this server.float
getLoadPerSubscriptionConnection()
Get an estimate of the how much load each new subscriber will add to this server.float
getSubscriptionConnectionLoad()
Get the load on the server due to subscription connections.int
hashCode()
void
setConnectionLoad(float connectionLoad)
Set the load due to client to server connections.void
setLoadPerConnection(float loadPerConnection)
Set the estimated load per connection.void
setLoadPerSubscriptionConnection(float loadPerSubscriber)
Set the estimated load per subscription connection.void
setSubscriptionConnectionLoad(float subscriberLoad)
Set the load due to client subscriptions.void
toData(java.io.DataOutput out)
Writes the state of this object as primitive data to the givenDataOutput
.java.lang.String
toString()
-
-
-
Method Detail
-
getConnectionLoad
public float getConnectionLoad()
Get the load on the server due to client to server connections.- Returns:
- a float greater than or equals to 0
-
getLoadPerConnection
public float getLoadPerConnection()
Get an estimate of the how much load each new connection will add to this server. The locator uses this information to estimate the load on the server before it receives a new load snapshot.- Returns:
- a float greater than or equals to 0
-
getSubscriptionConnectionLoad
public float getSubscriptionConnectionLoad()
Get the load on the server due to subscription connections.- Returns:
- a float greater than or equals to 0
-
getLoadPerSubscriptionConnection
public float getLoadPerSubscriptionConnection()
Get an estimate of the how much load each new subscriber will add to this server. The locator uses this information to estimate the load on the server before it receives a new load snapshot.- Returns:
- a float greater than or equals to 0
-
setConnectionLoad
public void setConnectionLoad(float connectionLoad)
Set the load due to client to server connections.- Parameters:
connectionLoad
- the load due to client to server connections
-
setSubscriptionConnectionLoad
public void setSubscriptionConnectionLoad(float subscriberLoad)
Set the load due to client subscriptions.- Parameters:
subscriberLoad
- he load due to client subscriptions
-
setLoadPerConnection
public void setLoadPerConnection(float loadPerConnection)
Set the estimated load per connection.- Parameters:
loadPerConnection
- the estimated load per connection
-
setLoadPerSubscriptionConnection
public void setLoadPerSubscriptionConnection(float loadPerSubscriber)
Set the estimated load per subscription connection.- Parameters:
loadPerSubscriber
- the estimated load per subscription connection
-
toData
public void toData(java.io.DataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes the state of this object as primitive data to the givenDataOutput
.Since 5.7 it is possible for any method call to the specified
DataOutput
to throwGemFireRethrowable
. It should not be caught by user code. If it is it must be rethrown.- Specified by:
toData
in interfaceDataSerializable
- Parameters:
out
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
-
fromData
public void fromData(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Description copied from interface:DataSerializable
Reads the state of this object as primitive data from the givenDataInput
.- Specified by:
fromData
in interfaceDataSerializable
- Parameters:
in
- theDataInput
to read from- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- A class could not be loaded while reading fromin
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-