Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-3925

Allow user resources (in WorkerTopologyContext) to be set by Worker Hooks

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • storm-core
    • None

    Description

      The current implementation of WorkerTopologyContext in WorkerState will always lead to empty userResources as no interface exposes a way to allow user to set them.

          private Map<String, Object> makeUserResources() {
              /* TODO: need to invoke a hook provided by the topology, giving it a chance to create user resources.
               * this would be part of the initialization hook
               * need to separate workertopologycontext into WorkerContext and WorkerUserContext.
               * actually just do it via interfaces. just need to make sure to hide setResource from tasks
               */
              return new HashMap<>();
          } 

      The intention will be to expose the relevant methods under a separate class which can then allow users to set the resources from WorkerHooks while only providing get access from Tasks (i.e. via TopologyContext)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              6harat Bharat Gulati
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h