taoensso / faraday

Amazon DynamoDB client for Clojure
https://www.taoensso.com/faraday
Eclipse Public License 1.0
238 stars 84 forks source link

update-table does nothing and returns no error message #8

Closed dkincaid closed 10 years ago

dkincaid commented 10 years ago

Trying to use update-table and it is not doing anything nor returning any error messages. Am I doing something wrong or is there a defect here?

Here is the output from the REPL session:

dynamodb-client.core> (far/describe-table creds "myTableName")
{:name :myTableName,
 :creation-date #inst "2013-09-27T15:28:35.000-00:00",
 :item-count 0,
 :size 0,
 :throughput
 {:read 30,
  :write 30,
  :last-decrease nil,
  :last-increase nil,
  :num-decreases-today 0},
 :indexes nil,
 :status :active,
 :prim-keys {:id {:data-type :s, :key-type :hash}}}
nil
dynamodb-client.core> (def update-promise (far/update-table creds "myTableName" [200 100]))
#<Var@3814a36e: #<Promise@1e1127f1: nil>>
nil

dynamodb-client.core> (realized? update-promise)
true
nil

dynamodb-client.core> @update-promise
nil
nil

dynamodb-client.core> (far/describe-table creds "myTableName")
{:name :myTableName,
 :creation-date #inst "2013-09-27T15:28:35.000-00:00",
 :item-count 0,
 :size 0,
 :throughput
 {:read 30,
  :write 30,
  :last-decrease nil,
  :last-increase nil,
  :num-decreases-today 0},
 :indexes nil,
 :status :active,
 :prim-keys {:id {:data-type :s, :key-type :hash}}}
nil
ptaoussanis commented 10 years ago

Hi Dave, it looks like you might be using the wrong syntax.

Try (far/update-table creds "myTableName" {:read 200 :write 100}) instead of (far/update-table creds "myTableName" [200 100]).

That should execute a three stage step-up: {:read 60 :write 60}, {:read 120 :write 100}, {:read 200 :write 100}.

Let me know if you're still having any trouble! Cheers :-)

dkincaid commented 10 years ago

Aha! I knew it must be something I was doing wrong. Thank you. That, of course, works perfectly. Let me say that this is an extremely nice feature too. Takes away a lot of pain when increasing throughput.

ptaoussanis commented 10 years ago

Great, no problem. And appreciate the positive feedback :-)