Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-30387

support job singleton within TM

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • API / Core
    • None

    Description

      For better managing some shared objects between slots of the same job, such as thread pool, db connections, cache data, etc., we need the ability to create these objects once for each job at the beginning, then to release the bounded resource when the job finished some how with correct order. A simple static filed cannot always archive this when the class is loaded by the TM classloader.

      To implement this job level singleton, we can use the flink user classloader. Since each flink job has its own context class loader, we could add some methods to operate the user CL to create a user specify AutoCloseable object only once for each job and close it at last in release hook of the user CL.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gzm55 James Z.M. Gao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: