An extensible data structure for massive streaming graphs
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
stinger-physmap.h File Reference
#include <stdint.h>

Macros

#define MAX_VTXID   0xFFFFF
 Maximum number of vertices the physical mapper can support. Note: If the physical mapper produces errors, increase this number.
#define MAX_NODES   0xFFFFF
 Maximum number internal nodes that the physical mapper can support. Note: If the physical mapper produces errors, increase this number.

Typedefs

typedef struct stinger_physmap stinger_physmap_t

Functions

stinger_physmap_tstinger_physmap_create ()
 Allocate and initialize a new physical mapper.
void stinger_physmap_delete (stinger_physmap_t *map)
 Free a physical mapper.
uint64_t stinger_physmap_create_mapping (stinger_physmap_t *map, char *string, uint64_t length)
 Create a new mapping from a binary data string to a vertex ID.
uint64_t stinger_physmap_get_mapping (stinger_physmap_t *map, char *string, uint64_t length)
 Lookup a mapping from a binary data string to a vertex ID.
int stinger_physmap_get_key (stinger_physmap_t *map, char **outbuffer, uint64_t *outbufferlength, uint64_t vertexID)
 Lookup the string mapped to a particular vertex ID.

Macro Definition Documentation

#define MAX_NODES   0xFFFFF

Maximum number internal nodes that the physical mapper can support. Note: If the physical mapper produces errors, increase this number.

Referenced by allocateTreeNode().

#define MAX_VTXID   0xFFFFF

Maximum number of vertices the physical mapper can support. Note: If the physical mapper produces errors, increase this number.

Referenced by stinger_physmap_create_mapping().

Typedef Documentation

typedef struct stinger_physmap stinger_physmap_t

Function Documentation

stinger_physmap_t* stinger_physmap_create ( )

Allocate and initialize a new physical mapper.

The user is responsible for freeing via stinger_physmap_delete().

Returns
A new physical mapper.

References allocateTreeNode().

uint64_t stinger_physmap_create_mapping ( stinger_physmap_t map,
char *  string,
uint64_t  length 
)

Create a new mapping from a binary data string to a vertex ID.

This function will uniquely map an arbitrary binary string or character string to a vertex ID in the space of 0 to NV where NV is the number of unique strings that have been mapped thus far (in other words the vertex ID space is compact). It will return -1 on error or if the mapping already exists. It is safe to call this function in parallel with any other physical mapper function. To determine if a -1 result is from an error, call stinger_physmap_get_mapping() on the same string. If it also returns -1, then an error has occurred.

Parameters
mapThe physical mapper.
stringThe binary or character data string.
lengthThe length of the string.
Returns
A unique vertex ID or -1 if the mapping exists or an error occurs.

References insertIntoTree(), MARKERINT, and MAX_VTXID.

void stinger_physmap_delete ( stinger_physmap_t map)

Free a physical mapper.

Parameters
mapThe physical mapper to be freed.
int stinger_physmap_get_key ( stinger_physmap_t map,
char **  outbuffer,
uint64_t *  outbufferlength,
uint64_t  vertexID 
)

Lookup the string mapped to a particular vertex ID.

This function will lookup and return a previously created mapping. It will return -1 no mapping exists or a reallocation of the output buffer fails. If the output buffer is not long enough, this function will reallocate the buffer and update the output buffer length. It is safe to call this function in parallel with any other physical mapper function.

Parameters
mapThe physical mapper.
outbufferA buffer to store the output string.
outbufferlengthThe length of the buffer.
vertexIDThe vertex ID to reverse lookup.
Returns
0 on success, -1 on failure.
uint64_t stinger_physmap_get_mapping ( stinger_physmap_t map,
char *  string,
uint64_t  length 
)

Lookup a mapping from a binary data string to a vertex ID.

This function will lookup and return a previously created mapping. It will return -1 if no mapping exists. It is safe to call this function in parallel with any other physical mapper function.

Parameters
mapThe physical mapper.
stringThe binary or character data string.
lengthThe length of the string.
Returns
A unique vertex ID or -1 if the mapping does not exist.

 

comments powered by Disqus