]> Entropealabs - cluster_kv.git/commitdiff
add some logging for get requests
authorChristopher <chris@entropealabs.com>
Fri, 6 Mar 2020 23:56:24 +0000 (17:56 -0600)
committerChristopher <chris@entropealabs.com>
Fri, 6 Mar 2020 23:56:24 +0000 (17:56 -0600)
lib/cluster_kv/ring.ex

index 2192fca07cfdcd6d8bf1094884a3280f32cce361..02a4ee7330d99edc5295e01124e7490689284ade 100644 (file)
@@ -101,6 +101,7 @@ defmodule ClusterKV.Ring do
           sl
       ) do
     nodes = HashRing.key_to_nodes(r, key, repls)
+    Logger.info("Picking node #{inspect(nodes)} - #{inspect(node)}")
 
     node =
       case node in nodes do
@@ -113,7 +114,7 @@ defmodule ClusterKV.Ring do
     {:ok, %SL{sl | data: %Ring{data | requests: [{ref, from} | reqs]}}, []}
   end
 
-  def handle_call({:get, key}, from, _, sl), do: {:ok, sl, [{:reply, from, :no_quorum}]}
+  def handle_call({:get, _key}, from, _, sl), do: {:ok, sl, [{:reply, from, :no_quorum}]}
 
   def handle_cast(
         {:put, key, value},
@@ -125,7 +126,7 @@ defmodule ClusterKV.Ring do
     {:ok, sl, []}
   end
 
-  def handle_cast({:put, key, value}, _, sl), do: {:ok, sl, []}
+  def handle_cast({:put, _key, _value}, _, sl), do: {:ok, sl, []}
 
   def handle_cast({:sync, keys}, @ready, %SL{data: %Ring{db: db}} = sl) do
     Enum.each(keys, fn {key, value} ->
@@ -135,7 +136,7 @@ defmodule ClusterKV.Ring do
     {:ok, sl, []}
   end
 
-  def handle_cast({:sync, keys}, _, sl), do: {:ok, sl, []}
+  def handle_cast({:sync, _keys}, _, sl), do: {:ok, sl, []}
 
   def handle_info({:get_key, key, ref, node}, @ready, %SL{data: %Ring{name: n, db: db}} = sl) do
     val = DB.get(db, key)