             [mesomatic.scheduler]
             [metatransaction.core :refer (db)]
             [metrics.timers :as timers]
-            [plumbing.core :refer (map-vals map-from-vals)]
-            [plumbing.core :refer [map-keys mapply]]
+            [plumbing.core :refer [map-from-vals map-keys map-vals mapply]]
             [ring.middleware.json]
             [schema.core :as s]
             [swiss.arrows :refer :all])
-  (:import java.util.UUID))
+  (:import java.net.URLEncoder
+           (java.util Date UUID)
+           schema.core.OptionalKey))
 
 ;; This is necessary to prevent a user from requesting a uid:gid
 ;; pair other than their own (for example, root)

                                      :resource/amount (double gpus)}]))])
        commit-latch-id (d/tempid :db.part/user)
        commit-latch {:db/id commit-latch-id
                      :commit-latch/uuid (java.util.UUID/randomUUID)
                      :commit-latch/committed? true}
        txn {:db/id db-id
             :job/commit-latch commit-latch-id
             :job/uuid uuid
             :job/submit-time (java.util.Date.)
             :job/name (or name "cookjob") ; set the default job name if not provided.
             :job/command command
             :job/custom-executor false


(def ReadRetriesRequest
  {:job [s/Uuid]})

(def UpdateRetriesRequest
  {(s/optional-key :jobs) [s/Uuid]
   (s/optional-key :retries) PosNum
