   (:require [clojure.core.async :refer [chan go >! <! >!! close!]]
             [clojure.data :refer [diff]]
             [taoensso.timbre :refer [info] :as timbre]
-            [onyx.scheduling.common-job-scheduler :as cjs]
-            [onyx.extensions :as extensions]))
+            [onyx.extensions :as extensions]
+            [onyx.log.commands.common :as common]
+            [onyx.scheduling.common-job-scheduler :refer [reconfigure-cluster-workload]]))
 
 (defmethod extensions/apply-log-entry :accept-join-cluster
   [{:keys [args]} replica]

        (update-in [:accepted] dissoc accepted-observer)
        (update-in [:peers] vec)
        (update-in [:peers] conj accepted-joiner)
        (assoc-in [:peer-state accepted-joiner] :idle))))

(defmethod extensions/replica-diff :accept-join-cluster
  [entry old new]

          (>!! (:outbox-ch state) entry))
        (assoc (dissoc state :buffered-outbox) :stall-output? false))
    state))

(defmethod extensions/fire-side-effects! :accept-join-cluster
  [entry old new diff state]
  (let [next-state (unbuffer-messages state diff new)
        old-allocation (common/peer->allocated-job (:allocations old) (:id next-state))
        new-allocation (common/peer->allocated-job (:allocations new) (:id next-state))]
    (if-not (not old-allocation new-allocation)
      (common/start-new-lifecycle next-state diff)
      next-state)))
