Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update retry filter for post 1.0 notfound logic by default.

  • Loading branch information...
commit b180beb35890afac079df5ff1f87041f4cf5fe3b 1 parent 13f9eee
@mranney authored
View
11 README.md
@@ -9,6 +9,17 @@ there may be glaring holes in functionality that we don't use.
It uses the "poolee" module to do load balancing and failure detection so you don't necessarily need a load balancer between node
and Riak.
+The library has support for timing each request, resolving siblings, and conditional retry.
+
+## API
+
+### Constructor
+
+ var RiakClient = require("riak"), client;
+ client = new RiakClient(["host1:port1", "host2:port2", ... "hostn:portn"], "client_id", "pool_name");
+
+The `RiakClient` constructor takes a list of host:port pairs, each of which are equivalent nodes in a Riak cluster.
+
## Example
There is no documentation yet, and there is only one example. This is the best thing to look at for now. You can run it, and you should see something like this:
View
0  example.js → examples/counter.js
File renamed without changes
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "riak",
- "version": "1.0.2",
+ "version": "1.0.3",
"description": "Riak client",
"homepage": "http://github.com/mranney/node_riak",
"author": "Matt Ranney <mjr@ranney.com>",
View
11 riak.js
@@ -107,13 +107,6 @@ RiakClient.prototype.retry_filter = function retry_filter(options, response, bod
return true;
}
- // this works around a Riak restart condition where a precommit hook fails while the node is initializing.
- if (options.method === "PUT" && response.statusCode === 403) {
- this.warn("riak retry", log_str + " retrying PUT on 403 status");
- this.counter("riak_retry_filter|403_PUT", 1);
- return true;
- }
-
if (options.retry_not_found && options.method === "GET" && response.statusCode === 404) {
if (!options.notFound) {
options.notFound = 0;
@@ -123,8 +116,6 @@ RiakClient.prototype.retry_filter = function retry_filter(options, response, bod
this.counter("riak_retry_filter|404_GET", 1);
return true;
}
- // TODO - need an option to decide whether to log this. Sometimes 404's are expected, but you still want retry, like for bodies
- // log("riak retry", log_str + " giving up on 404");
return false;
}
@@ -607,7 +598,7 @@ RiakClient.prototype.post = function (url, post_body, callback) {
});
};
-// TODO - this is not longer used, so it might not work anymore.
+// TODO - this is no longer used, so it might not work anymore.
RiakClient.prototype.solr = function (bucket, query, limit, callback) {
var self = this;
Please sign in to comment.
Something went wrong with that request. Please try again.