Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9547

Extract immutable Membership abstraction from Group API

    XMLWordPrintable

Details

    Description

      The Group abstraction has a number of methods specific to a group membership:

      • getNodes()
      • isCoordinator()
      • getCoordinatorNode()

      However, sequential invocations of these methods can return inconsistent results, since the membership can change at any time. This is not ideal.
      Instead, we should introduce an immutable Membership abstraction, such that, within the context of a given membership, the above methods return consistent results.

      The Membership maps well onto the JGroups concept of a View and Infinispan's concept of a cache topology. Consequently, this Membership should be hashable and comparable based on the underlying view/topology id.

      The above methods in Group will be replaced with a new getMembership() which returns a volatile reference to the current membership.

      Additionally, the membershipChanged(...) event should be enhanced to leverage this new Membership abstraction.
      e.g.
      void membershipChanged(Membership previousMembership, Membership currentMembership, boolean merged)

      This allows the listener to easily determine the previous coordinator vs the new coordinator.

      Attachments

        Activity

          People

            pferraro@redhat.com Paul Ferraro
            pferraro@redhat.com Paul Ferraro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: