Package org.apache.geode.cache.server
Class ServerLoad
java.lang.Object
org.apache.geode.cache.server.ServerLoad
- All Implemented Interfaces:
Serializable,DataSerializable
A data object containing the load information for a cache server. This object is returned from
ServerLoadProbe.getLoad(ServerMetrics) and indicates how heavily loaded the server is.
The values returned by getConnectionLoad() and getSubscriptionConnectionLoad()
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 as
load + loadPerConnection*numAdditionalConnections.
- Since:
- GemFire 5.7
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.geode.DataSerializable
DataSerializable.Replaceable -
Constructor Summary
ConstructorsConstructorDescriptionServerLoad(float connectionLoad, float loadPerConnection, float subscriptionConnectionLoad, float loadPerSubscriptionConnection) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidReads the state of this object as primitive data from the givenDataInput.floatGet the load on the server due to client to server connections.floatGet an estimate of the how much load each new connection will add to this server.floatGet an estimate of the how much load each new subscriber will add to this server.floatGet the load on the server due to subscription connections.inthashCode()voidsetConnectionLoad(float connectionLoad) Set the load due to client to server connections.voidsetLoadPerConnection(float loadPerConnection) Set the estimated load per connection.voidsetLoadPerSubscriptionConnection(float loadPerSubscriber) Set the estimated load per subscription connection.voidsetSubscriptionConnectionLoad(float subscriberLoad) Set the load due to client subscriptions.voidtoData(DataOutput out) Writes the state of this object as primitive data to the givenDataOutput.toString()
-
Constructor Details
-
ServerLoad
public ServerLoad(float connectionLoad, float loadPerConnection, float subscriptionConnectionLoad, float loadPerSubscriptionConnection) -
ServerLoad
public ServerLoad()
-
-
Method Details
-
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
Description copied from interface:DataSerializableWrites the state of this object as primitive data to the givenDataOutput.Since 5.7 it is possible for any method call to the specified
DataOutputto throwGemFireRethrowable. It should not be caught by user code. If it is it must be rethrown.- Specified by:
toDatain interfaceDataSerializable- Parameters:
out- theDataOutputto write to- Throws:
IOException- A problem occurs while writing toout
-
fromData
Description copied from interface:DataSerializableReads the state of this object as primitive data from the givenDataInput.- Specified by:
fromDatain interfaceDataSerializable- Parameters:
in- theDataInputto read from- Throws:
IOException- A problem occurs while reading frominClassNotFoundException- A class could not be loaded while reading fromin
-
hashCode
public int hashCode() -
equals
-
toString
-