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
54#define BASE_DEQUE_10BIT 0x0a4
55#define BASE_INDEX_10BIT 0x1c9
56#define BASE_QUEUE_10BIT 0x2b1
57#define BASE_TREE_10BIT 0x254
59#define COMMAND_JUST_THE_KEY 0x000
60#define COMMAND_CHILD_10BIT 0x103
61#define COMMAND_FIRST_10BIT 0x126
62#define COMMAND_GET_10BIT 0x0a7
63#define COMMAND_HIGH_10BIT 0x128
64#define COMMAND_LAST_10BIT 0x02c
65#define COMMAND_LOW_10BIT 0x1ec
66#define COMMAND_NEXT_10BIT 0x0ae
67#define COMMAND_PARENT_10BIT 0x030
68#define COMMAND_PFIRST_10BIT 0x0d0
69#define COMMAND_PLAST_10BIT 0x190
70#define COMMAND_PREV_10BIT 0x250
71#define COMMAND_PUT_10BIT 0x2b0
72#define COMMAND_XHIGH_10BIT 0x118
73#define COMMAND_XLOW_10BIT 0x198
74#define COMMAND_SECOND_ARG 0x3ff
75#define COMMAND_SIZE 0x400
287 int mode = WRITE_AS_BASE_DEFAULT);
311 sprintf(key,
"k%014lx", ++
key_seed);
328 if (p_block->cell_type != CELL_TYPE_TUPLE_ITEM || p_block->size != 2)
329 return SERVICE_ERROR_BAD_BLOCK;
334 if ( p_key->cell_type != CELL_TYPE_STRING || p_val->cell_type != CELL_TYPE_STRING
335 || p_key->rank != 1 || p_val->rank != 1 || p_key->size != p_val->size)
336 return SERVICE_ERROR_BAD_BLOCK;
338 for (
int i = 0; i < p_key->size; i++)
339 index[p_key->get_string(i)] = p_val->get_string(i);
341 return SERVICE_NO_ERROR;
357 HashQueueEntMap::iterator it_queue =
queue_ent.find(ent_hash);
360 return SERVICE_ERROR_ENTITY_NOT_FOUND;
363 EntKeyVolXctMap::iterator it_item =
queue_key.find(ek);
366 if (mode & WRITE_ONLY_IF_NOT_EXISTS)
367 return SERVICE_ERROR_WRITE_FORBIDDEN;
372 if (p_new ==
nullptr)
373 return SERVICE_ERROR_NO_MEM;
378 memcpy(p_new, p_block, p_block->total_bytes);
380 p_item->
status = BLOCK_STATUS_EMPTY;
382 it_queue->second.p_root =
aat_remove(p_item, it_queue->second.p_root);
390 p_item->
status = BLOCK_STATUS_READY;
392 it_queue->second.p_root =
aat_insert(p_item, it_queue->second.p_root);
396 return SERVICE_NO_ERROR;
398 if (mode & WRITE_ONLY_IF_EXISTS)
399 return SERVICE_ERROR_WRITE_FORBIDDEN;
401 if (it_queue->second.queue_use == it_queue->second.queue_size) {
405 return SERVICE_ERROR_LOW_PRIORITY;
414 if (ret != SERVICE_NO_ERROR)
418 if (p_new ==
nullptr) {
421 return SERVICE_ERROR_NO_MEM;
423 memcpy(p_new, p_block, p_block->total_bytes);
434 it_queue->second.queue_use++;
438 return SERVICE_NO_ERROR;
461 if (p_new ==
nullptr) {
464 return SERVICE_ERROR_NO_MEM;
466 memcpy(p_new, p_block, p_block->total_bytes);
469 p_txn->
status = BLOCK_STATUS_READY;
474 if (it_ent->second ==
nullptr) {
479 return SERVICE_NO_ERROR;
493 return SERVICE_NO_ERROR;
502 return SERVICE_NO_ERROR;
520 if ((p_root = it_ent->second) !=
nullptr) {
522 return SERVICE_ERROR_WRITE_FORBIDDEN;
526 EntKeyVolXctMap::iterator it;
529 return SERVICE_ERROR_PARENT_NOT_FOUND;
531 p_parent = it->second;
542 if (p_new ==
nullptr) {
545 return SERVICE_ERROR_NO_MEM;
547 memcpy(p_new, p_block, p_block->total_bytes);
550 p_txn->
status = BLOCK_STATUS_READY;
561 if (p_root ==
nullptr)
566 return SERVICE_NO_ERROR;
583 if (p_new ==
nullptr)
584 return SERVICE_ERROR_NO_MEM;
589 memcpy(p_new, p_block, p_block->total_bytes);
593 return SERVICE_NO_ERROR;
610 if (p_block->cell_type != CELL_TYPE_STRING || p_block->size != 1)
611 return SERVICE_ERROR_BAD_BLOCK;
613 Index::iterator it = index.find(key);
615 if (it == index.end()) {
616 if (mode & WRITE_ONLY_IF_EXISTS)
617 return SERVICE_ERROR_WRITE_FORBIDDEN;
619 index[key] = p_block->get_string(0);
621 return SERVICE_NO_ERROR;
623 if (mode & WRITE_ONLY_IF_NOT_EXISTS)
624 return SERVICE_ERROR_WRITE_FORBIDDEN;
626 index[key] = p_block->get_string(0);
628 return SERVICE_NO_ERROR;
647 case BASE_DEQUE_10BIT: {
648 HashVolXctMap::iterator it_ent =
deque_ent.find(ent_hash);
649 if (p_item == it_ent->second) {
650 if (p_item->
p_next == p_item)
651 it_ent->second =
nullptr;
655 it_ent->second = p_item->
p_next;
667 case BASE_QUEUE_10BIT: {
668 HashQueueEntMap::iterator it_ent =
queue_ent.find(ent_hash);
670 it_ent->second.p_root =
aat_remove(p_item, it_ent->second.p_root);
671 it_ent->second.queue_use--;
679 case BASE_TREE_10BIT:
696 HashNameUseMap::iterator it =
name.find(
hash);
698 if (it !=
name.end())
704 memcpy(&nu.
name, &key,
sizeof(
Name));
719 HashNameUseMap::iterator it =
name.find(
hash);
721 if (it ==
name.end())
751 case BASE_DEQUE_10BIT: {
755 return SERVICE_ERROR_ENTITY_NOT_FOUND;
757 p_root = it_ent->second; }
761 case BASE_INDEX_10BIT: {
765 return SERVICE_ERROR_ENTITY_NOT_FOUND;
767 p_root = it_ent->second; }
771 case BASE_QUEUE_10BIT: {
775 return SERVICE_ERROR_ENTITY_NOT_FOUND;
777 p_root = it_ent->second.p_root; }
781 case BASE_TREE_10BIT: {
785 return SERVICE_ERROR_ENTITY_NOT_FOUND;
787 p_root = it_ent->second; }
792 return SERVICE_ERROR_WRONG_BASE;
795 if (p_root ==
nullptr)
796 return SERVICE_ERROR_EMPTY_ENTITY;
802 return SERVICE_ERROR_PARSING_COMMAND;
805 case COMMAND_JUST_THE_KEY:
807 case BASE_DEQUE_10BIT: {
809 EntKeyVolXctMap::iterator it;
812 return SERVICE_ERROR_BLOCK_NOT_FOUND;
817 return SERVICE_NO_ERROR;
819 case BASE_QUEUE_10BIT: {
821 EntKeyVolXctMap::iterator it;
824 return SERVICE_ERROR_BLOCK_NOT_FOUND;
829 return SERVICE_NO_ERROR;
831 case BASE_TREE_10BIT: {
833 EntKeyVolXctMap::iterator it;
836 return SERVICE_ERROR_BLOCK_NOT_FOUND;
841 return SERVICE_NO_ERROR;
847 return SERVICE_ERROR_BLOCK_NOT_FOUND;
850 p_str = &it->second; }
852 return SERVICE_NO_ERROR;
855 case COMMAND_CHILD_10BIT: {
856 if (base != BASE_TREE_10BIT)
857 return SERVICE_ERROR_PARSING_COMMAND;
860 EntKeyVolXctMap::iterator it;
863 return SERVICE_ERROR_BLOCK_NOT_FOUND;
865 p_txn = it->second->p_child;
867 if (p_txn ==
nullptr)
868 return SERVICE_ERROR_BLOCK_NOT_FOUND;
872 return SERVICE_NO_ERROR;
874 case COMMAND_PARENT_10BIT: {
875 if (base != BASE_TREE_10BIT)
876 return SERVICE_ERROR_PARSING_COMMAND;
879 EntKeyVolXctMap::iterator it;
882 return SERVICE_ERROR_BLOCK_NOT_FOUND;
884 p_txn = it->second->p_parent;
886 if (p_txn ==
nullptr)
887 return SERVICE_ERROR_BLOCK_NOT_FOUND;
891 return SERVICE_NO_ERROR;
893 case COMMAND_NEXT_10BIT: {
895 EntKeyVolXctMap::iterator it;
898 case BASE_TREE_10BIT: {
900 return SERVICE_ERROR_BLOCK_NOT_FOUND;
902 p_txn = it->second->p_next;
904 if (p_txn ==
nullptr)
905 return SERVICE_ERROR_BLOCK_NOT_FOUND;
909 return SERVICE_NO_ERROR;
911 case BASE_DEQUE_10BIT: {
913 return SERVICE_ERROR_BLOCK_NOT_FOUND;
915 p_txn = it->second->p_next;
918 return SERVICE_NO_ERROR;
920 return SERVICE_ERROR_PARSING_COMMAND; }
922 case COMMAND_PREV_10BIT: {
923 if (base != BASE_DEQUE_10BIT)
924 return SERVICE_ERROR_PARSING_COMMAND;
927 EntKeyVolXctMap::iterator it;
930 return SERVICE_ERROR_BLOCK_NOT_FOUND;
932 p_txn = it->second->p_parent;
935 return SERVICE_NO_ERROR;
937 case COMMAND_HIGH_10BIT:
938 case COMMAND_XHIGH_10BIT: {
939 if (base != BASE_QUEUE_10BIT)
940 return SERVICE_ERROR_PARSING_COMMAND;
942 if (p_root ==
nullptr)
943 return SERVICE_ERROR_EMPTY_ENTITY;
948 if (command == COMMAND_XHIGH_10BIT)
951 return SERVICE_NO_ERROR;
953 case COMMAND_LOW_10BIT:
954 case COMMAND_XLOW_10BIT: {
955 if (base != BASE_QUEUE_10BIT)
956 return SERVICE_ERROR_PARSING_COMMAND;
958 if (p_root ==
nullptr)
959 return SERVICE_ERROR_EMPTY_ENTITY;
964 if (command == COMMAND_XLOW_10BIT)
967 return SERVICE_NO_ERROR;
969 case COMMAND_FIRST_10BIT:
970 case COMMAND_PFIRST_10BIT: {
971 if (base != BASE_DEQUE_10BIT && (base != BASE_TREE_10BIT || command == COMMAND_PFIRST_10BIT))
972 return SERVICE_ERROR_PARSING_COMMAND;
974 if (p_root ==
nullptr)
975 return SERVICE_ERROR_EMPTY_ENTITY;
980 if (command == COMMAND_PFIRST_10BIT)
983 return SERVICE_NO_ERROR;
985 case COMMAND_LAST_10BIT:
986 case COMMAND_PLAST_10BIT: {
987 if (base != BASE_DEQUE_10BIT)
988 return SERVICE_ERROR_PARSING_COMMAND;
990 if (p_root ==
nullptr)
991 return SERVICE_ERROR_EMPTY_ENTITY;
996 if (command == COMMAND_PLAST_10BIT)
999 return SERVICE_NO_ERROR;
1001 case COMMAND_GET_10BIT:
1002 if (base != BASE_INDEX_10BIT)
1003 return SERVICE_ERROR_PARSING_COMMAND;
1009 return SERVICE_NO_ERROR;
1012 return SERVICE_ERROR_PARSING_COMMAND;
1030 if (key_in[0] ==
'~') {
1035 case COMMAND_FIRST_10BIT:
1036 case COMMAND_LAST_10BIT:
1039 case COMMAND_PUT_10BIT:
1042 case COMMAND_PFIRST_10BIT:
1043 case COMMAND_PLAST_10BIT:
1044 case COMMAND_HIGH_10BIT:
1045 case COMMAND_LOW_10BIT:
1046 case COMMAND_GET_10BIT:
1047 case COMMAND_XHIGH_10BIT:
1048 case COMMAND_XLOW_10BIT:
1052 if (!is_put || key_in[1] <
'0' || key_in[1] >
'9')
1057 if (sscanf(&key_in[1],
"%d%n", &size, &r_len) != 1 || size <= 0 || key_in[r_len + 1] != 0)
1060 command = COMMAND_SIZE + size;
1065 strcpy(key_out, key_in);
1066 pChar pc = strchr(key_out,
'~');
1068 if (pc ==
nullptr) {
1069 command = COMMAND_JUST_THE_KEY;
1081 command = COMMAND_SECOND_ARG;
1088 case COMMAND_CHILD_10BIT:
1089 case COMMAND_NEXT_10BIT:
1090 case COMMAND_PARENT_10BIT:
1091 case COMMAND_PREV_10BIT:
1107 int len = strnlen(
name,
sizeof(
Name));
1108 int siz =
sizeof(
Name) - len;
1111 memset(&
name[len], 0, siz);
1125 if (p_txn !=
nullptr) {
1142 if (p_txn !=
nullptr) {
1176 if (p_item !=
nullptr) {
1177 while (p_item->
p_next !=
nullptr)
1195 if (p_item !=
nullptr) {
1196 while (p_item->
p_prev !=
nullptr)
1217 if (p_tree->
p_next !=
nullptr) {
1225 if (p_tree->
p_next !=
nullptr)
1241 if (p_tree ==
nullptr || p_item ==
nullptr)
1244 if (p_item == p_tree)
1274 if (p_kill->
p_next !=
nullptr)
1278 if (p_parent == p_tree) {
1292 if (p_parent != p_tree)
1316 if (p_tree ==
nullptr || p_item ==
nullptr)
1319 if (p_item == p_tree) {
1320 if (p_tree->
p_prev ==
nullptr)
1324 if (p_tree->
p_next ==
nullptr)
1352 if (p_item->
p_prev ==
nullptr) {
1353 if (p_item->
p_next ==
nullptr)
1359 if (should_be < p_item->level) {
1360 p_item->
level = should_be;
1362 if (should_be < p_item->p_next->level)
1367 if (p_item->
p_next ==
nullptr) {
1370 if (should_be < p_item->level)
1371 p_item->
level = should_be;
1376 if (should_be < p_item->level) {
1377 p_item->
level = should_be;
1379 if (should_be < p_item->p_next->level)
1420 if ( p_item->
p_next !=
nullptr
1427 p_right->
p_prev = p_item;
1428 if (p_item->
p_prev ==
nullptr && p_item->
p_next ==
nullptr && p_item->
level > 1) {
1461 if (p_tree ==
nullptr) {
A configuration file as a key/value store.
Definition utils.h:217
Container: A Service to manage Jazz blocks. All Jazz blocks are managed by this or a descendant of th...
Definition container.h:282
virtual StatusCode put(pChar p_where, pBlock p_block, int mode=WRITE_AS_BASE_DEFAULT)
Definition container.cpp:1903
virtual StatusCode remove(pChar p_where)
Definition container.cpp:1941
virtual StatusCode locate(Locator &location, pChar p_what)
Definition container.cpp:1833
virtual StatusCode new_entity(pChar p_where)
Definition container.cpp:1922
uint64_t alloc_bytes
The current allocation in bytes.
Definition container.h:600
virtual StatusCode copy(pChar p_where, pChar p_what)
Definition container.cpp:1963
virtual StatusCode get(pTransaction &p_txn, pChar p_what)
Definition container.cpp:1760
pBlock block_malloc(size_t size)
Definition container.h:549
virtual StatusCode header(StaticBlockHeader &hea, pChar p_what)
Definition container.cpp:1854
A simple logger.
Definition utils.h:245
pBlock get_block(int idx)
Definition tuple.h:224
Volatile: A Service to manage data objects in RAM.
Definition volatile.h:244
void aat_decrease_level(pVolatileTransaction p_item)
Definition volatile.h:1350
virtual void destroy_transaction(pTransaction &p_txn)
Definition volatile.cpp:229
void erase_name(uint64_t hash)
Definition volatile.h:717
StatusCode internal_get(pTransaction &p_txn, pString &p_str, uint64_t &pop_ent, Locator &what)
Definition volatile.h:741
StatusCode put_in_deque(HashVolXctMap::iterator it_ent, EntityKeyHash &ek, Name &key, pBlock p_block, bool first=false)
Definition volatile.h:452
pVolatileTransaction aat_split(pVolatileTransaction p_item)
Definition volatile.h:1417
StatusCode new_volatile()
Definition volatile.cpp:117
pVolatileTransaction aat_highest_priority(pVolatileTransaction p_item)
Definition volatile.h:1174
HashQueueEntMap queue_ent
Map of queues.
Definition volatile.h:1488
HashNameUseMap name
Map of names and to do reverse conversion to a hash() (including count of uses)
Definition volatile.h:1487
HashVolXctMap tree_ent
Map of trees.
Definition volatile.h:1490
bool aat_to_left(pVolatileTransaction p_item, pVolatileTransaction p_tree)
Definition volatile.h:1160
pVolatileTransaction aat_remove(pVolatileTransaction p_item, pVolatileTransaction p_tree)
Definition volatile.h:1314
EntKeyVolXctMap tree_key
Map of tree (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:1494
virtual pChar const id()
Definition volatile.cpp:60
virtual StatusCode new_transaction(pTransaction &p_txn)
Definition volatile.cpp:190
virtual StatusCode remove(Locator &where)
Definition volatile.cpp:755
StatusCode shut_down()
Definition volatile.cpp:107
void destroy_tree(uint64_t ent_hash, pVolatileTransaction p_txn)
Definition volatile.h:1140
virtual StatusCode get(pTransaction &p_txn, Locator &what)
Definition volatile.cpp:280
pVolatileTransaction aat_skew(pVolatileTransaction p_item)
Definition volatile.h:1394
uint64_t hash(Name &name)
Definition volatile.h:1105
StatusCode put_replace(pVolatileTransaction p_replace, pBlock p_block)
Definition volatile.h:580
void destroy_item(int base, uint64_t ent_hash, pVolatileTransaction p_item)
Definition volatile.h:641
EntKeyVolXctMap deque_key
Map of deque (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:1492
StatusCode put_in_tree(HashVolXctMap::iterator it_ent, EntityKeyHash &ek, Name &key, Name &parent, pBlock p_block)
Definition volatile.h:516
EntKeyVolXctMap queue_key
Map of queue (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:1493
void new_key(Name &key)
Definition volatile.h:310
pVolatileTransaction aat_insert(pVolatileTransaction p_new, pVolatileTransaction p_tree)
Definition volatile.h:1456
bool aat_is_in_tree(pVolatileTransaction p_item, pVolatileTransaction p_tree)
Definition volatile.h:1239
bool parse_command(Name &key_out, int &command, Name &second, Name key_in, bool is_put)
Definition volatile.h:1029
virtual StatusCode header(StaticBlockHeader &hea, Locator &what)
Definition volatile.cpp:455
virtual StatusCode locate(Locator &location, Locator &what)
Definition volatile.cpp:415
pVolatileTransaction aat_lowest_priority(pVolatileTransaction p_item)
Definition volatile.h:1193
StatusCode populate_index(Index &index, pBlock p_block)
Definition volatile.h:326
pVolatileTransaction aat_rebalance(pVolatileTransaction p_tree)
Definition volatile.h:1212
StatusCode put_index(Index &index, pChar key, pBlock p_block, int mode)
Definition volatile.h:608
StatusCode destroy_volatile()
Definition volatile.cpp:159
HashVolXctMap index_ent
Map of indices.
Definition volatile.h:1491
virtual StatusCode copy(Locator &where, Locator &what)
Definition volatile.cpp:907
virtual StatusCode new_entity(Locator &where)
Definition volatile.cpp:690
void destroy_queue(uint64_t ent_hash, pVolatileTransaction p_txn)
Definition volatile.h:1123
StatusCode start()
Starts the service, checking the configuration and starting the Service.
Definition volatile.cpp:71
pVolatileTransaction aat_remove_deep(pVolatileTransaction p_kill, pVolatileTransaction p_parent, pVolatileTransaction p_tree, pVolatileTransaction &p_deep)
Definition volatile.h:1270
void base_names(BaseNames &base_names)
Definition volatile.cpp:953
virtual StatusCode put(Locator &where, pBlock p_block, int mode=WRITE_AS_BASE_DEFAULT)
Definition volatile.cpp:546
HashVolXctMap deque_ent
Map of deques.
Definition volatile.h:1489
uint64_t add_name(uint64_t hash, Name &key)
Definition volatile.h:694
StatusCode put_queue_insert(uint64_t ent_hash, Name &key, double priority, pBlock p_block, int mode)
Definition volatile.h:356
uint64_t key_seed
Seed to create unique key ids.
Definition volatile.h:1486
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:276
int TenBitsAtAddress(const char *str)
Get ten bits taking the least significant 5 of the first two characters of a string.
Definition utils.h:166
std::map< std::string, std::string > Index
An Index kept in RAM by Volatile implemented as an stdlib map (string, string)
Definition types.h:238
std::map< uint64_t, NameUse > HashNameUseMap
HashNameUseMap: A map from hashes to Name and number of times the name is used.
Definition volatile.h:184
struct VolatileTransaction * pVolatileTransaction
A pointer to a Transaction-descendant wrapper over a Block for Volatile blocks.
Definition volatile.h:80
std::string * pString
A pointer to an std::string.
Definition volatile.h:188
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:160
char * pChar
A pointer to a char buffer.
Definition types.h:185
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:183
std::map< std::string, pContainer > BaseNames
A map of names for the containers (or structure engines like "map" or "tree" inside Volatile).
Definition container.h:152
std::map< uint64_t, pVolatileTransaction > HashVolXctMap
HashVolXctMap: A map from hashes to pointers to VolatileTransaction.
Definition volatile.h:153
int StatusCode
Type returned by the Service API.
Definition utils.h:141
std::map< EntityKeyHash, pVolatileTransaction > EntKeyVolXctMap
EntKeyVolXctMap: A map from (entity, key) hashes to pointers to VolatileTransaction.
Definition volatile.h:167
Volatile * pVolatile
Pointer to Volatile.
Definition volatile.h:1496
EntityKeyHash: A record containing separate hashes for entity and key.
Definition volatile.h:112
bool operator<(const EntityKeyHash &o) const
Constructor for EntityKeyHash.
Definition volatile.h:132
uint64_t ent_hash
The hash of the entity name.
Definition volatile.h:113
bool operator==(const EntityKeyHash &o) const
Constructor for EntityKeyHash.
Definition volatile.h:122
uint64_t key_hash
The hash of the key name.
Definition volatile.h:114
Locator: A minimal structure to define the location of resources inside a Container.
Definition container.h:184
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:185
Name entity
Another abstraction inside node.container.base, like the name of a table in a database.
Definition container.h:186
Name key
A key identifying a block inside the entity.
Definition container.h:187
NameUse: A pair of Name and number of times the name is used.
Definition volatile.h:174
int use
Number of times name is used. Increase by add_name() calls to the same name, decreased/destroyed by e...
Definition volatile.h:175
Name name
The name in plain text.
Definition volatile.h:176
QueueEnt: An entity to store a priority queue.
Definition volatile.h:142
int queue_use
Number of node inserted.
Definition volatile.h:144
int queue_size
The maximum number of nodes supported by the queue.
Definition volatile.h:143
pVolatileTransaction p_root
The root node.
Definition volatile.h:145
Transaction: A wrapper over a Block that defines the communication of a block with a Container.
Definition container.h:162
pBlockHeader p_hea
A pointer to the Block (if status == BLOCK_STATUS_READY) for Index.
Definition container.h:165
int status
The status of the block transaction.
Definition container.h:168
pBlock p_block
A pointer to the Block (if status == BLOCK_STATUS_READY) for Tensor, Kind and Tuple.
Definition container.h:164
VolatileTransaction: A Transaction-descendant wrapper over a Block for Volatile blocks.
Definition volatile.h:87
pVolatileTransaction p_next
Pointer to the next node in a deque or next sibling in a tree.
Definition volatile.h:92
uint64_t key_hash
Node locator hash required to find the ID of a related (next, ...) node.
Definition volatile.h:105
double priority
... or priority value in a queue.
Definition volatile.h:95
pVolatileTransaction p_child
Pointer to the first child in a tree ...
Definition volatile.h:94
int num_visits
... or MCTS tree node number of visits.
Definition volatile.h:103
pVolatileTransaction p_prev
Pointer to the previous node in a deque ...
Definition volatile.h:89
int times_used
Times the block has been reassigned in the queue ...
Definition volatile.h:102
int level
Level in the AA tree (used for auto-balancing) ...
Definition volatile.h:98
pVolatileTransaction p_parent
... or parent node in a tree.
Definition volatile.h:90
int num_wins
... or MCTS tree node number of wins.
Definition volatile.h:99