   ([db users resource-types]
    (timers/time!
      get-shares-duration
-     (let [type->default (-> (fn [type] (get-share-by-type db type default-user Double/MAX_VALUE))
-                             (pc/map-from-keys resource-types))]
+     (let [type->default (get-share db default-user resource-types {})]
        (-> (fn [user] (get-share db user resource-types type->default))
            (pc/map-from-keys users))))))
 

  ([db user]
   (get-share db user (util/get-all-resource-types db)))
  ([db user resource-types]
   (pc/map-from-keys (fn get-share-3p-helper [type] (get-share-by-type db type user))
                     resource-types))
  ([db user resource-types type->default]
   (pc/map-from-keys (fn get-share-4p-helper [type] (get-share-by-type db type user (type->default type)))
                     resource-types)))

(timers/deftimer [cook-mesos share get-shares-duration])


(def default-user "default")

(defn- resource-type->datomic-resource-type
  "Converts the resource type to a datomic resource type keyword, e.g. :cpus to :resource.type/cpus"
  [type]
  (keyword "resource.type" (name type)))

(defn- datomic-resource-type->resource-type
  "Converts the datomic resource type to a resource type keyword, e.g. :resource.type/cpus to :cpus"
  [type]
  (keyword (name type)))

(defn- retract-share-by-type!
  [conn type user]
