35#include "src/jazz_elements/channel.h"
38#ifndef INCLUDED_JAZZ_CATCH2
39#define INCLUDED_JAZZ_CATCH2
41#include "src/catch2/catch.hpp"
47#ifndef INCLUDED_JAZZ_ELEMENTS_VOLATILE
48#define INCLUDED_JAZZ_ELEMENTS_VOLATILE
53#define BASE_DEQUE_10BIT 0x0a4
54#define BASE_INDEX_10BIT 0x1c9
55#define BASE_QUEUE_10BIT 0x2b1
56#define BASE_TREE_10BIT 0x254
58#define COMMAND_JUST_THE_KEY 0x000
59#define COMMAND_CHILD_10BIT 0x103
60#define COMMAND_FIRST_10BIT 0x126
61#define COMMAND_GET_10BIT 0x0a7
62#define COMMAND_HIGH_10BIT 0x128
63#define COMMAND_LAST_10BIT 0x02c
64#define COMMAND_LOW_10BIT 0x1ec
65#define COMMAND_NEXT_10BIT 0x0ae
66#define COMMAND_PARENT_10BIT 0x030
67#define COMMAND_PFIRST_10BIT 0x0d0
68#define COMMAND_PLAST_10BIT 0x190
69#define COMMAND_PREV_10BIT 0x250
70#define COMMAND_PUT_10BIT 0x2b0
71#define COMMAND_XHIGH_10BIT 0x118
72#define COMMAND_XLOW_10BIT 0x198
73#define COMMAND_SECOND_ARG 0x3ff
74#define COMMAND_SIZE 0x400
286 int mode = WRITE_AS_BASE_DEFAULT);
310 sprintf(key,
"k%014lx", ++
key_seed);
327 if (p_block->cell_type != CELL_TYPE_TUPLE || p_block->size != 2)
return SERVICE_ERROR_BAD_BLOCK;
332 if ( p_key->cell_type != CELL_TYPE_STRING || p_val->cell_type != CELL_TYPE_STRING
333 || p_key->rank != 1 || p_val->rank != 1 || p_key->size != p_val->size)
return SERVICE_ERROR_BAD_BLOCK;
335 for (
int i = 0; i < p_key->size; i++)
336 index[p_key->get_string(i)] = p_val->get_string(i);
338 return SERVICE_NO_ERROR;
354 HashQueueEntMap::iterator it_queue =
queue_ent.find(ent_hash);
356 if (it_queue ==
queue_ent.end())
return SERVICE_ERROR_ENTITY_NOT_FOUND;
359 EntKeyVolXctMap::iterator it_item =
queue_key.find(ek);
362 if (mode & WRITE_ONLY_IF_NOT_EXISTS)
return SERVICE_ERROR_WRITE_FORBIDDEN;
367 if (p_new ==
nullptr)
return SERVICE_ERROR_NO_MEM;
372 memcpy(p_new, p_block, p_block->total_bytes);
374 p_item->
status = BLOCK_STATUS_EMPTY;
376 it_queue->second.p_root =
aat_remove(p_item, it_queue->second.p_root);
384 p_item->
status = BLOCK_STATUS_READY;
386 it_queue->second.p_root =
aat_insert(p_item, it_queue->second.p_root);
390 return SERVICE_NO_ERROR;
392 if (mode & WRITE_ONLY_IF_EXISTS)
return SERVICE_ERROR_WRITE_FORBIDDEN;
394 if (it_queue->second.queue_use == it_queue->second.queue_size) {
397 if (p_lowest->
priority >= priority)
return SERVICE_ERROR_LOW_PRIORITY;
406 if (ret != SERVICE_NO_ERROR)
return ret;
409 if (p_new ==
nullptr) {
412 return SERVICE_ERROR_NO_MEM;
414 memcpy(p_new, p_block, p_block->total_bytes);
425 it_queue->second.queue_use++;
429 return SERVICE_NO_ERROR;
451 if (p_new ==
nullptr) {
454 return SERVICE_ERROR_NO_MEM;
456 memcpy(p_new, p_block, p_block->total_bytes);
459 p_txn->
status = BLOCK_STATUS_READY;
464 if (it_ent->second ==
nullptr) {
469 return SERVICE_NO_ERROR;
483 return SERVICE_NO_ERROR;
492 return SERVICE_NO_ERROR;
510 if ((p_root = it_ent->second) !=
nullptr) {
511 if (
tree_key.find(ek) !=
tree_key.end())
return SERVICE_ERROR_WRITE_FORBIDDEN;
515 EntKeyVolXctMap::iterator it;
517 if ((it =
tree_key.find(parent_ek)) ==
tree_key.end())
return SERVICE_ERROR_PARENT_NOT_FOUND;
519 p_parent = it->second;
529 if (p_new ==
nullptr) {
532 return SERVICE_ERROR_NO_MEM;
534 memcpy(p_new, p_block, p_block->total_bytes);
537 p_txn->
status = BLOCK_STATUS_READY;
548 if (p_root ==
nullptr)
553 return SERVICE_NO_ERROR;
571 if (p_new ==
nullptr)
return SERVICE_ERROR_NO_MEM;
576 memcpy(p_new, p_block, p_block->total_bytes);
580 return SERVICE_NO_ERROR;
597 if (p_block->cell_type != CELL_TYPE_STRING || p_block->size != 1)
return SERVICE_ERROR_BAD_BLOCK;
599 Index::iterator it = index.find(key);
601 if (it == index.end()) {
602 if (mode & WRITE_ONLY_IF_EXISTS)
return SERVICE_ERROR_WRITE_FORBIDDEN;
604 index[key] = p_block->get_string(0);
606 return SERVICE_NO_ERROR;
608 if (mode & WRITE_ONLY_IF_NOT_EXISTS)
return SERVICE_ERROR_WRITE_FORBIDDEN;
610 index[key] = p_block->get_string(0);
612 return SERVICE_NO_ERROR;
631 case BASE_DEQUE_10BIT: {
632 HashVolXctMap::iterator it_ent =
deque_ent.find(ent_hash);
633 if (p_item == it_ent->second) {
634 if (p_item->
p_next == p_item)
635 it_ent->second =
nullptr;
639 it_ent->second = p_item->
p_next;
651 case BASE_QUEUE_10BIT: {
652 HashQueueEntMap::iterator it_ent =
queue_ent.find(ent_hash);
654 it_ent->second.p_root =
aat_remove(p_item, it_ent->second.p_root);
655 it_ent->second.queue_use--;
663 case BASE_TREE_10BIT:
680 HashNameUseMap::iterator it =
name.find(
hash);
682 if (it !=
name.end())
688 memcpy(&nu.
name, &key,
sizeof(
Name));
703 HashNameUseMap::iterator it =
name.find(
hash);
705 if (it ==
name.end())
return;
734 case BASE_DEQUE_10BIT: {
737 if (it_ent ==
deque_ent.end())
return SERVICE_ERROR_ENTITY_NOT_FOUND;
739 p_root = it_ent->second; }
743 case BASE_INDEX_10BIT: {
746 if (it_ent ==
index_ent.end())
return SERVICE_ERROR_ENTITY_NOT_FOUND;
748 p_root = it_ent->second; }
752 case BASE_QUEUE_10BIT: {
755 if (it_ent ==
queue_ent.end())
return SERVICE_ERROR_ENTITY_NOT_FOUND;
757 p_root = it_ent->second.p_root; }
761 case BASE_TREE_10BIT: {
764 if (it_ent ==
tree_ent.end())
return SERVICE_ERROR_ENTITY_NOT_FOUND;
766 p_root = it_ent->second; }
771 return SERVICE_ERROR_WRONG_BASE;
774 if (p_root ==
nullptr)
return SERVICE_ERROR_EMPTY_ENTITY;
780 return SERVICE_ERROR_PARSING_COMMAND;
783 case COMMAND_JUST_THE_KEY:
785 case BASE_DEQUE_10BIT: {
787 EntKeyVolXctMap::iterator it;
789 if ((it =
deque_key.find(ek)) ==
deque_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
794 return SERVICE_NO_ERROR;
796 case BASE_QUEUE_10BIT: {
798 EntKeyVolXctMap::iterator it;
800 if ((it =
queue_key.find(ek)) ==
queue_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
805 return SERVICE_NO_ERROR;
807 case BASE_TREE_10BIT: {
809 EntKeyVolXctMap::iterator it;
811 if ((it =
tree_key.find(ek)) ==
tree_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
816 return SERVICE_NO_ERROR;
821 if ((it = p_root->
p_hea->
index.find(key)) == p_root->
p_hea->
index.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
824 p_str = &it->second; }
826 return SERVICE_NO_ERROR;
829 case COMMAND_CHILD_10BIT: {
830 if (base != BASE_TREE_10BIT)
return SERVICE_ERROR_PARSING_COMMAND;
833 EntKeyVolXctMap::iterator it;
835 if ((it =
tree_key.find(ek)) ==
tree_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
837 p_txn = it->second->p_child;
839 if (p_txn ==
nullptr)
return SERVICE_ERROR_BLOCK_NOT_FOUND;
843 return SERVICE_NO_ERROR;
845 case COMMAND_PARENT_10BIT: {
846 if (base != BASE_TREE_10BIT)
return SERVICE_ERROR_PARSING_COMMAND;
849 EntKeyVolXctMap::iterator it;
851 if ((it =
tree_key.find(ek)) ==
tree_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
853 p_txn = it->second->p_parent;
855 if (p_txn ==
nullptr)
return SERVICE_ERROR_BLOCK_NOT_FOUND;
859 return SERVICE_NO_ERROR;
861 case COMMAND_NEXT_10BIT: {
863 EntKeyVolXctMap::iterator it;
866 case BASE_TREE_10BIT: {
867 if ((it =
tree_key.find(ek)) ==
tree_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
869 p_txn = it->second->p_next;
871 if (p_txn ==
nullptr)
return SERVICE_ERROR_BLOCK_NOT_FOUND;
875 return SERVICE_NO_ERROR;
877 case BASE_DEQUE_10BIT: {
878 if ((it =
deque_key.find(ek)) ==
deque_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
880 p_txn = it->second->p_next;
883 return SERVICE_NO_ERROR;
885 return SERVICE_ERROR_PARSING_COMMAND; }
887 case COMMAND_PREV_10BIT: {
888 if (base != BASE_DEQUE_10BIT)
return SERVICE_ERROR_PARSING_COMMAND;
891 EntKeyVolXctMap::iterator it;
893 if ((it =
deque_key.find(ek)) ==
deque_key.end())
return SERVICE_ERROR_BLOCK_NOT_FOUND;
895 p_txn = it->second->p_parent;
898 return SERVICE_NO_ERROR;
900 case COMMAND_HIGH_10BIT:
901 case COMMAND_XHIGH_10BIT: {
902 if (base != BASE_QUEUE_10BIT)
return SERVICE_ERROR_PARSING_COMMAND;
904 if (p_root ==
nullptr)
return SERVICE_ERROR_EMPTY_ENTITY;
909 if (command == COMMAND_XHIGH_10BIT)
912 return SERVICE_NO_ERROR;
914 case COMMAND_LOW_10BIT:
915 case COMMAND_XLOW_10BIT: {
916 if (base != BASE_QUEUE_10BIT)
return SERVICE_ERROR_PARSING_COMMAND;
918 if (p_root ==
nullptr)
return SERVICE_ERROR_EMPTY_ENTITY;
923 if (command == COMMAND_XLOW_10BIT)
926 return SERVICE_NO_ERROR;
928 case COMMAND_FIRST_10BIT:
929 case COMMAND_PFIRST_10BIT: {
930 if ( (base != BASE_DEQUE_10BIT)
931 && (base != BASE_TREE_10BIT || command == COMMAND_PFIRST_10BIT))
return SERVICE_ERROR_PARSING_COMMAND;
933 if (p_root ==
nullptr)
return SERVICE_ERROR_EMPTY_ENTITY;
938 if (command == COMMAND_PFIRST_10BIT)
941 return SERVICE_NO_ERROR;
943 case COMMAND_LAST_10BIT:
944 case COMMAND_PLAST_10BIT: {
945 if (base != BASE_DEQUE_10BIT)
return SERVICE_ERROR_PARSING_COMMAND;
947 if (p_root ==
nullptr)
return SERVICE_ERROR_EMPTY_ENTITY;
952 if (command == COMMAND_PLAST_10BIT)
955 return SERVICE_NO_ERROR;
960 if (base != BASE_INDEX_10BIT)
return SERVICE_ERROR_PARSING_COMMAND;
966 return SERVICE_NO_ERROR;
984 if (key_in[0] ==
'~') {
989 case COMMAND_FIRST_10BIT:
990 case COMMAND_LAST_10BIT:
993 case COMMAND_PUT_10BIT:
996 case COMMAND_PFIRST_10BIT:
997 case COMMAND_PLAST_10BIT:
998 case COMMAND_HIGH_10BIT:
999 case COMMAND_LOW_10BIT:
1000 case COMMAND_GET_10BIT:
1001 case COMMAND_XHIGH_10BIT:
1002 case COMMAND_XLOW_10BIT:
1006 if (!is_put || key_in[1] <
'0' || key_in[1] >
'9')
return false;
1010 if (sscanf(&key_in[1],
"%d%n", &size, &r_len) != 1 || size <= 0 || key_in[r_len + 1] != 0)
return false;
1012 command = COMMAND_SIZE + size;
1017 strcpy(key_out, key_in);
1018 pChar pc = strchr(key_out,
'~');
1020 if (pc ==
nullptr) {
1021 command = COMMAND_JUST_THE_KEY;
1033 command = COMMAND_SECOND_ARG;
1040 case COMMAND_CHILD_10BIT:
1041 case COMMAND_NEXT_10BIT:
1042 case COMMAND_PARENT_10BIT:
1043 case COMMAND_PREV_10BIT:
1059 int len = strnlen(
name,
sizeof(
Name));
1060 int siz =
sizeof(
Name) - len;
1063 memset(&
name[len], 0, siz);
1077 if (p_txn !=
nullptr) {
1094 if (p_txn !=
nullptr) {
1128 if (p_item !=
nullptr) {
1129 while (p_item->
p_next !=
nullptr)
1147 if (p_item !=
nullptr) {
1148 while (p_item->
p_prev !=
nullptr)
1169 if (p_tree->
p_next !=
nullptr) {
1177 if (p_tree->
p_next !=
nullptr)
1193 if (p_tree ==
nullptr || p_item ==
nullptr)
return false;
1195 if (p_item == p_tree)
return true;
1223 if (p_kill->
p_next !=
nullptr)
1227 if (p_parent == p_tree) {
1264 if (p_tree ==
nullptr || p_item ==
nullptr)
return p_tree;
1266 if (p_item == p_tree) {
1297 if (p_item->
p_prev ==
nullptr) {
1298 if (p_item->
p_next ==
nullptr)
1304 if (should_be < p_item->level)
1305 p_item->
level = should_be;
1308 if (p_item->
p_next ==
nullptr) {
1311 if (should_be < p_item->level)
1312 p_item->
level = should_be;
1317 if (should_be < p_item->level) {
1318 p_item->
level = should_be;
1320 if (should_be < p_item->p_next->level)
1361 if ( p_item->
p_next !=
nullptr
1368 p_right->
p_prev = p_item;
1369 if (p_item->
p_prev ==
nullptr && p_item->
p_next ==
nullptr && p_item->
level > 1) {
1402 if (p_tree ==
nullptr) {
A configuration file as a key/value store.
Definition utils.h:218
Container: A Service to manage Jazz blocks. All Jazz blocks are managed by this or a descendant of th...
Definition container.h:287
virtual StatusCode put(pChar p_where, pBlock p_block, int mode=WRITE_AS_BASE_DEFAULT)
Definition container.cpp:1927
virtual StatusCode remove(pChar p_where)
Definition container.cpp:1965
virtual StatusCode locate(Locator &location, pChar p_what)
Definition container.cpp:1857
virtual StatusCode new_entity(pChar p_where)
Definition container.cpp:1946
uint64_t alloc_bytes
The current allocation in bytes.
Definition container.h:627
virtual StatusCode copy(pChar p_where, pChar p_what)
Definition container.cpp:1987
virtual StatusCode get(pTransaction &p_txn, pChar p_what)
Definition container.cpp:1784
pBlock block_malloc(size_t size)
Definition container.h:570
virtual StatusCode header(StaticBlockHeader &hea, pChar p_what)
Definition container.cpp:1878
A simple logger.
Definition utils.h:248
pBlock get_block(int idx)
Definition tuple.h:221
Volatile: A Service to manage data objects in RAM.
Definition volatile.h:243
void aat_decrease_level(pVolatileTransaction p_item)
Definition volatile.h:1295
virtual void destroy_transaction(pTransaction &p_txn)
Definition volatile.cpp:224
void erase_name(uint64_t hash)
Definition volatile.h:701
StatusCode internal_get(pTransaction &p_txn, pString &p_str, uint64_t &pop_ent, Locator &what)
Definition volatile.h:724
StatusCode put_in_deque(HashVolXctMap::iterator it_ent, EntityKeyHash &ek, Name &key, pBlock p_block, bool first=false)
Definition volatile.h:443
pVolatileTransaction aat_split(pVolatileTransaction p_item)
Definition volatile.h:1358
StatusCode new_volatile()
Definition volatile.cpp:116
pVolatileTransaction aat_highest_priority(pVolatileTransaction p_item)
Definition volatile.h:1126
HashQueueEntMap queue_ent
Map of queues.
Definition volatile.h:1429
HashNameUseMap name
Map of names and to do reverse conversion to a hash() (including count of uses)
Definition volatile.h:1428
HashVolXctMap tree_ent
Map of trees.
Definition volatile.h:1431
bool aat_to_left(pVolatileTransaction p_item, pVolatileTransaction p_tree)
Definition volatile.h:1112
pVolatileTransaction aat_remove(pVolatileTransaction p_item, pVolatileTransaction p_tree)
Definition volatile.h:1262
EntKeyVolXctMap tree_key
Map of tree (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:1435
virtual pChar const id()
Definition volatile.cpp:59
virtual StatusCode new_transaction(pTransaction &p_txn)
Definition volatile.cpp:185
virtual StatusCode remove(Locator &where)
Definition volatile.cpp:728
StatusCode shut_down()
Definition volatile.cpp:106
void destroy_tree(uint64_t ent_hash, pVolatileTransaction p_txn)
Definition volatile.h:1092
virtual StatusCode get(pTransaction &p_txn, Locator &what)
Definition volatile.cpp:275
pVolatileTransaction aat_skew(pVolatileTransaction p_item)
Definition volatile.h:1335
uint64_t hash(Name &name)
Definition volatile.h:1057
StatusCode put_replace(pVolatileTransaction p_replace, pBlock p_block)
Definition volatile.h:567
void destroy_item(int base, uint64_t ent_hash, pVolatileTransaction p_item)
Definition volatile.h:625
EntKeyVolXctMap deque_key
Map of deque (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:1433
StatusCode put_in_tree(HashVolXctMap::iterator it_ent, EntityKeyHash &ek, Name &key, Name &parent, pBlock p_block)
Definition volatile.h:506
EntKeyVolXctMap queue_key
Map of queue (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:1434
void new_key(Name &key)
Definition volatile.h:309
pVolatileTransaction aat_insert(pVolatileTransaction p_new, pVolatileTransaction p_tree)
Definition volatile.h:1397
bool aat_is_in_tree(pVolatileTransaction p_item, pVolatileTransaction p_tree)
Definition volatile.h:1191
bool parse_command(Name &key_out, int &command, Name &second, Name key_in, bool is_put)
Definition volatile.h:983
virtual StatusCode header(StaticBlockHeader &hea, Locator &what)
Definition volatile.cpp:449
virtual StatusCode locate(Locator &location, Locator &what)
Definition volatile.cpp:409
pVolatileTransaction aat_lowest_priority(pVolatileTransaction p_item)
Definition volatile.h:1145
StatusCode populate_index(Index &index, pBlock p_block)
Definition volatile.h:325
pVolatileTransaction aat_rebalance(pVolatileTransaction p_tree)
Definition volatile.h:1164
StatusCode put_index(Index &index, pChar key, pBlock p_block, int mode)
Definition volatile.h:595
StatusCode destroy_volatile()
Definition volatile.cpp:154
HashVolXctMap index_ent
Map of indices.
Definition volatile.h:1432
virtual StatusCode copy(Locator &where, Locator &what)
Definition volatile.cpp:873
virtual StatusCode new_entity(Locator &where)
Definition volatile.cpp:668
void destroy_queue(uint64_t ent_hash, pVolatileTransaction p_txn)
Definition volatile.h:1075
StatusCode start()
Starts the service, checking the configuration and starting the Service.
Definition volatile.cpp:70
pVolatileTransaction aat_remove_deep(pVolatileTransaction p_kill, pVolatileTransaction p_parent, pVolatileTransaction p_tree, pVolatileTransaction &p_deep)
Definition volatile.h:1219
void base_names(BaseNames &base_names)
Definition volatile.cpp:916
virtual StatusCode put(Locator &where, pBlock p_block, int mode=WRITE_AS_BASE_DEFAULT)
Definition volatile.cpp:539
HashVolXctMap deque_ent
Map of deques.
Definition volatile.h:1430
uint64_t add_name(uint64_t hash, Name &key)
Definition volatile.h:678
StatusCode put_queue_insert(uint64_t ent_hash, Name &key, double priority, pBlock p_block, int mode)
Definition volatile.h:353
uint64_t key_seed
Seed to create unique key ids.
Definition volatile.h:1427
The namespace for Jazz Utils, Blocks, Kinds, Tuples, Containers, etc.
Definition block.cpp:39
Tuple * pTuple
A pointer to a Tuple object.
Definition tuple.h:273
std::string String
A standard string used in many other places in Jazz.
Definition types.h:239
String * pString
A pointer to an String.
Definition volatile.h:187
int TenBitsAtAddress(const char *str)
Get ten bits taking the least significant 5 of the first two characters of a string.
Definition utils.h:167
std::map< uint64_t, NameUse > HashNameUseMap
HashNameUseMap: A map from hashes to Name and number of times the name is used.
Definition volatile.h:183
struct VolatileTransaction * pVolatileTransaction
A pointer to a Transaction-descendant wrapper over a Block for Volatile blocks.
Definition volatile.h:79
std::map< String, pContainer > BaseNames
A map of names for the containers (or structure engines like "map" or "tree" inside Volatile).
Definition container.h:157
uint64_t MurmurHash64A(const void *key, int len)
MurmurHash2, 64-bit versions, by Austin Appleby.
Definition utils.cpp:250
std::map< uint64_t, QueueEnt > HashQueueEntMap
HashQueueEntMap: A map from hashes to QueueEnt.
Definition volatile.h:159
char * pChar
A pointer to a char buffer.
Definition types.h:189
class Block * pBlock
A (forward defined) pointer to a Block.
Definition block.h:66
char Name[NAME_SIZE]
A short identifier used in Blocks, Containers and API.
Definition types.h:187
std::map< uint64_t, pVolatileTransaction > HashVolXctMap
HashVolXctMap: A map from hashes to pointers to VolatileTransaction.
Definition volatile.h:152
int StatusCode
Type returned by the Service API.
Definition utils.h:142
std::map< EntityKeyHash, pVolatileTransaction > EntKeyVolXctMap
EntKeyVolXctMap: A map from (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:166
Volatile * pVolatile
Pointer to Volatile.
Definition volatile.h:1437
std::map< String, String > Index
An Index kept in RAM by Volatile implemented as an stdlib map (string, string)
Definition types.h:243
EntityKeyHash: A record containing separate hashes for entity and key.
Definition volatile.h:111
bool operator<(const EntityKeyHash &o) const
Constructor for EntityKeyHash.
Definition volatile.h:131
uint64_t ent_hash
The hash of the entity name.
Definition volatile.h:112
bool operator==(const EntityKeyHash &o) const
Constructor for EntityKeyHash.
Definition volatile.h:121
uint64_t key_hash
The hash of the key name.
Definition volatile.h:113
Locator: A minimal structure to define the location of resources inside a Container.
Definition container.h:189
char base[SHORT_NAME_SIZE]
A Jazz node level unique name to locate a Container and possibly a type of service inside it.
Definition container.h:190
Name entity
Another abstraction inside node.container.base, like the name of a table in a database.
Definition container.h:191
Name key
A key identifying a block inside the entity.
Definition container.h:192
NameUse: A pair of Name and number of times the name is used.
Definition volatile.h:173
int use
Number of times name is used. Increase by add_name() calls to the same name, decreased/destroyed by e...
Definition volatile.h:174
Name name
The name in plain text.
Definition volatile.h:175
QueueEnt: An entity to store a priority queue.
Definition volatile.h:141
int queue_use
Number of node inserted.
Definition volatile.h:143
int queue_size
The maximum number of nodes supported by the queue.
Definition volatile.h:142
pVolatileTransaction p_root
The root node.
Definition volatile.h:144
Transaction: A wrapper over a Block that defines the communication of a block with a Container.
Definition container.h:167
pBlockHeader p_hea
A pointer to the Block (if status == BLOCK_STATUS_READY) for Index.
Definition container.h:170
int status
The status of the block transaction.
Definition container.h:173
pBlock p_block
A pointer to the Block (if status == BLOCK_STATUS_READY) for Tensor, Kind and Tuple.
Definition container.h:169
VolatileTransaction: A Transaction-descendant wrapper over a Block for Volatile blocks.
Definition volatile.h:86
pVolatileTransaction p_next
Pointer to the next node in a deque or next sibling in a tree.
Definition volatile.h:91
uint64_t key_hash
Node locator hash required to find the ID of a related (next, ...) node.
Definition volatile.h:104
double priority
... or priority value in a queue.
Definition volatile.h:94
pVolatileTransaction p_child
Pointer to the first child in a tree ...
Definition volatile.h:93
int num_visits
... or MCTS tree node number of visits.
Definition volatile.h:102
pVolatileTransaction p_prev
Pointer to the previous node in a deque ...
Definition volatile.h:88
int times_used
Times the block has been reassigned in the queue ...
Definition volatile.h:101
int level
Level in the AA tree (used for auto-balancing) ...
Definition volatile.h:97
pVolatileTransaction p_parent
... or parent node in a tree.
Definition volatile.h:89
int num_wins
... or MCTS tree node number of wins.
Definition volatile.h:98