|
hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
|
#include "citrusleaf.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <sys/shm.h>
Go to the source code of this file.
Classes | |
| struct | cl_shm_ninfo |
| struct | cl_shm |
| struct | cl_shm_info |
Macros | |
| #define | NUM_NODES 128 |
| #define | NUM_NAMESPACES 10 |
| #define | CL_SHM_ERROR -1 |
| #define | CL_SHM_OK 0 |
| #define | SZ_NODE_IP 32 |
| #define | SZ_NAMESPACE 32 |
| #define | SZ_PARTITION_ID 4 |
| #define | MAX_NEIGHBORS (NUM_NODES-1) |
| #define | NUM_PARTITIONS 4096 |
| #define | MAX_ADDRESSES_PER_NODE 4 |
| #define | SZ_FIELD_NEIGHBORS (MAX_NEIGHBORS * SZ_NODE_IP + 1) |
| #define | SZ_OVERHEAD ((3 * 32) + 20) |
| #define | SZ_BITMAP ((NUM_PARTITIONS + 7) / 8) |
| #define | SZ_ENCODED_BITMAP (((SZ_BITMAP + 2) / 3) * 4) |
| #define | SZ_NS_ENCODED_BITMAP (64 + SZ_ENCODED_BITMAP + 1) |
| #define | SZ_REPLICAS_TEXT (SZ_OVERHEAD + (NUM_NAMESPACES * 2 * SZ_NS_ENCODED_BITMAP)) |
| #define | SHMMAX_SYS_FILE "/proc/sys/kernel/shmmax" |
| #define | DEFAULT_NUM_NODES_FOR_SHM 64 |
| #define | DEFAULT_SHM_KEY 229857887 |
Functions | |
| int | citrusleaf_use_shm (int num_nodes, key_t key) |
| int | citrusleaf_shm_free () |
| int | cl_shm_get_partition_count () |
| cl_shm_ninfo * | cl_shm_find_node_from_name (const char *node_name) |
| cl_shm_ninfo * | cl_shm_find_node_from_address (struct sockaddr_in *sa_in) |
| int | cl_shm_node_lock (cl_shm_ninfo *shared_node) |
| void | cl_shm_node_unlock (cl_shm_ninfo *shared_node) |
Variables | |
| bool | g_shared_memory |
| #define SZ_BITMAP ((NUM_PARTITIONS + 7) / 8) |
| #define SZ_FIELD_NEIGHBORS (MAX_NEIGHBORS * SZ_NODE_IP + 1) |
| #define SZ_NS_ENCODED_BITMAP (64 + SZ_ENCODED_BITMAP + 1) |
| #define SZ_REPLICAS_TEXT (SZ_OVERHEAD + (NUM_NAMESPACES * 2 * SZ_NS_ENCODED_BITMAP)) |
| int citrusleaf_shm_free | ( | ) |
| int citrusleaf_use_shm | ( | int | num_nodes, |
| key_t | key | ||
| ) |
| cl_shm_ninfo* cl_shm_find_node_from_address | ( | struct sockaddr_in * | sa_in | ) |
| cl_shm_ninfo* cl_shm_find_node_from_name | ( | const char * | node_name | ) |
| int cl_shm_get_partition_count | ( | ) |
| int cl_shm_node_lock | ( | cl_shm_ninfo * | shared_node | ) |
| void cl_shm_node_unlock | ( | cl_shm_ninfo * | shared_node | ) |
| bool g_shared_memory |