Skip to content

Commit

Permalink
adjust signature for find_nodes function
Browse files Browse the repository at this point in the history
  • Loading branch information
cablehead committed Aug 3, 2013
1 parent 37db92b commit 3c7bff0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hash_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ int hash_ring_find_nodes(
hash_ring_t *ring,
uint8_t *key,
uint32_t keyLen,
hash_ring_node_t **nodes,
hash_ring_node_t *nodes[],
uint32_t num) {

// the number of nodes we're going to return is either the number of nodes
Expand Down
6 changes: 6 additions & 0 deletions hash_ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ hash_ring_node_t *hash_ring_get_node(hash_ring_t *ring, uint8_t *name, uint32_t
*/
hash_ring_node_t *hash_ring_find_node(hash_ring_t *ring, uint8_t *key, uint32_t keyLen);

/**
* Finds the set of num nodes by hashing the given key and searching the ring.
* Returns the number of nodes found, or -1 if there is an error
*/
int hash_ring_find_nodes(hash_ring_t *ring, uint8_t *key, uint32_t keyLen, hash_ring_node_t *nodes[], uint32_t num);

/**
* Find the next highest item for the given num.
* This function is invoked by hash_ring_find_node to locate a key on the ring. If you want to do your own hashing on
Expand Down

0 comments on commit 3c7bff0

Please sign in to comment.