Distributed Hash Table File System for Linux








routing.c File Reference

#include "magma.h"

Defines

#define INCLUDE_FLARE_INTERNALS

Functions

int is_included (const char *key, magma_node_t *node, int redundant_space)
magma_node_tinternal_route_key (const char *key, magma_node_t *node, int redundant_space)
magma_node_tinternal_route_path (const char *path, int redundant_space)
int compare_nodes (const magma_node_t *n1, const magma_node_t *n2)

Define Documentation

#define INCLUDE_FLARE_INTERNALS


Function Documentation

int compare_nodes ( const magma_node_t n1,
const magma_node_t n2 
)

Compares two nodes to check if are the same.

Parameters:
n1 first given node
n2 second given node
Returns:
1 if nodes are the same, 0 otherwise

magma_node_t* internal_route_key ( const char *  key,
magma_node_t node,
int  redundant_space 
)

route a key in key space. never use this function directly. use macros route_key() and redundant_route_key()

Parameters:
key pointer to key to be routed
node pointer to node used for operation in this round
redundant_space if true, use redundant key space for routing
Returns:
pointer to owner node, NULL in case of failure.

magma_node_t* internal_route_path ( const char *  path,
int  redundant_space 
)

route a file path in key space. never use this function directly. use macros route_path() and redundant_route_path()

Parameters:
path pointer to path to be routed
redundant_space if true, use redundant key space for routing
Returns:
pointer to owner node, NULL in case of failure.

int is_included ( const char *  key,
magma_node_t node,
int  redundant_space 
)

check if key is hosted on node specified by *node

if redundant_space is true, node->redundant_start_key and node->redundant_stop_key are used instead of main key space node->start_key and node->stop_key.

Parameters:
key the key to be routed
node starting node
redundant_space if true, redundant key space is used
Returns:
0 if key is owned by this node, -1 if owned by previous one and +1 if owned by next one

This file last modified Wednesday, 09-Jan-2008 20:02:41 CET