An extensible data structure for massive streaming graphs
|
#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_t * | stinger_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. |
#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 struct stinger_physmap stinger_physmap_t |
stinger_physmap_t* stinger_physmap_create | ( | ) |
Allocate and initialize a new physical mapper.
The user is responsible for freeing via stinger_physmap_delete().
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.
map | The physical mapper. |
string | The binary or character data string. |
length | The length of the string. |
References insertIntoTree(), MARKERINT, and MAX_VTXID.
void stinger_physmap_delete | ( | stinger_physmap_t * | map | ) |
Free a physical mapper.
map | The 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.
map | The physical mapper. |
outbuffer | A buffer to store the output string. |
outbufferlength | The length of the buffer. |
vertexID | The vertex ID to reverse lookup. |
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.
map | The physical mapper. |
string | The binary or character data string. |
length | The length of the string. |
comments powered by Disqus