(doseq [storm-id downloaded-storm-ids] (add-blob-references (:localizer supervisor) storm-id conf)) ;; do this after adding the references so we don't try to clean things being used (.startCleaner (:localizer supervisor))
;; 如果 supervisor.enable: true 设置为 true ;; 则 启动以下定时任务。 (when (conf SUPERVISOR-ENABLE) ;; This isn't strictly necessary, but it doesn't hurt and ensures that the machine stays up ;; to date even if callbacks don't all work exactly right ;; 1 & 2 这两个定时任务不是必须的,因为已经在 assignments-snapshot 函数 ;; 中调用 (.assignments storm-cluster-state callback) 将 mk-synchronize-supervisor ;; 返回的函数注册为回调函数,一旦 zookeeper 上的 /storm/assignments 目录发生变化时 ;; mk-synchronize-supervisor 函数就会被调用。