Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-902 Improvements to thread safety in Samza
  3. SAMZA-899

Re-design the JobModel class to be immutable

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      The current design of the JobModel class takes in a LocalityManager instance. The JobModel class also populates and mutates the container host mappings by reading from the LocalityManager. This state in the class is also mutated by the methods that make a call to populateContainerToHost mappings.

      The JobModel class should not know who its LocalityManager is. The JobModel class must merely take in a final container-host mapping as a part of its constructor. (as opposed to taking in a LocalityManager and mutating state)

      The JobModel class is currently shared from multiple threads, hence it's dangerous to expose public methods that mutate state without proper synchronization.

      This re-design will ensure that the JobModel will be immutable and merely expose getters. This is important as the JobModel evolves into a standard interface that all systems that integrate with Samza will have to provide.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jagadish1989@gmail.com Jagadish
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: