java.lang.Object
org.apache.pulsar.policies.data.loadbalancer.BundleData

public class BundleData extends Object
Data class comprising the short term and long term 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

      public 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.
      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

      public void update(NamespaceBundleStats newSample)
      Update the historical data for this bundle.
      Parameters:
      newSample - The bundle stats to update this data with.
    • getShortTermData

      public TimeAverageMessageData getShortTermData()
    • setShortTermData

      public void setShortTermData(TimeAverageMessageData shortTermData)
    • getLongTermData

      public TimeAverageMessageData getLongTermData()
    • setLongTermData

      public void setLongTermData(TimeAverageMessageData longTermData)
    • getTopics

      public int getTopics()
    • setTopics

      public void setTopics(int topics)