Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FairPartitionLoadBalancer

Package version

This class is responsible for balancing the load of processing events from all partitions of an Event Hub by distributing the number of partitions uniformly among all the active EventProcessors.

This load balancer will retrieve partition ownership details from the PartitionManager to find the number of active EventProcessor. It uses the last modified time to decide if an EventProcessor is active. If a partition ownership entry has not be updated for a specified duration of time, the owner of that partition is considered inactive and the partition is available for other EventProcessors to own.

class

PartitionLoadBalancer

Hierarchy

  • FairPartitionLoadBalancer

Implements

Index

Constructors

Methods

Constructors

constructor

  • Creates an instance of PartitionBasedLoadBalancer.

    Parameters

    • ownerId: string

      The identifier of the Event Processor that owns this load balancer.

    • inactiveTimeLimitInMS: number

      The time to wait for an update on an ownership record before assuming the owner of the partition is inactive.

    Returns FairPartitionLoadBalancer

Methods

loadBalance

  • loadBalance(partitionOwnershipMap: Map<string, PartitionOwnership>, partitionsToAdd: string[]): string[]

Generated using TypeDoc