Class BundleData
java.lang.Object
org.apache.pulsar.policies.data.loadbalancer.BundleData
Data class comprising the short term and long term historical data for this bundle.
-
Constructor Summary
ConstructorDescriptionBundleData
(int numShortSamples, int numLongSamples) Initialize the bundle data.BundleData
(int numShortSamples, int numLongSamples, NamespaceBundleStats defaultStats) Initialize this bundle data and have its histories default to the given stats before the first sample is received. -
Method Summary
Modifier and TypeMethodDescriptionint
void
setLongTermData
(TimeAverageMessageData longTermData) void
setShortTermData
(TimeAverageMessageData shortTermData) void
setTopics
(int topics) void
update
(NamespaceBundleStats newSample) Update the historical data for this bundle.
-
Constructor Details
-
BundleData
public BundleData() -
BundleData
public BundleData(int numShortSamples, int numLongSamples) Initialize the bundle data.- Parameters:
numShortSamples
- Number of short term samples to use.numLongSamples
- Number of long term samples to use.
-
BundleData
Initialize this bundle data and have its histories default to the given stats before the first sample is received.- Parameters:
numShortSamples
- Number of short term samples to use.numLongSamples
- Number of long term samples to use.defaultStats
- The stats to default to before the first sample is received.
-
-
Method Details
-
update
Update the historical data for this bundle.- Parameters:
newSample
- The bundle stats to update this data with.
-
getShortTermData
-
setShortTermData
-
getLongTermData
-
setLongTermData
-
getTopics
public int getTopics() -
setTopics
public void setTopics(int topics)
-