Jazz 1.25.+
Loading...
Searching...
No Matches
base_api.h
1/* Jazz (c) 2018-2025 kaalam.ai (The Authors of Jazz), using (under the same license):
2
3 1. Biomodelling - The AATBlockQueue class (c) Jacques BasaldĂșa, 2009-2012 licensed
4 exclusively for the use in the Jazz server software.
5
6 Copyright 2009-2012 Jacques BasaldĂșa
7
8 2. BBVA - Jazz: A lightweight analytical web server for data-driven applications.
9
10 Copyright 2016-2017 Banco Bilbao Vizcaya Argentaria, S.A.
11
12 This product includes software developed at
13
14 BBVA (https://www.bbva.com/)
15
16 3. LMDB, Copyright 2011-2017 Howard Chu, Symas Corp. All rights reserved.
17
18 Licensed under http://www.OpenLDAP.org/license.html
19
20
21 Licensed under the Apache License, Version 2.0 (the "License");
22 you may not use this file except in compliance with the License.
23 You may obtain a copy of the License at
24
25 http://www.apache.org/licenses/LICENSE-2.0
26
27 Unless required by applicable law or agreed to in writing, software
28 distributed under the License is distributed on an "AS IS" BASIS,
29 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 See the License for the specific language governing permissions and
31 limitations under the License.
32*/
33
34
35#include "src/include/jazz_elements.h"
36
37#if defined CATCH_TEST
38#ifndef INCLUDED_JAZZ_CATCH2
39#define INCLUDED_JAZZ_CATCH2
40
41#include "src/catch2/catch.hpp"
42
43#endif
44#endif
45
46
47#ifndef INCLUDED_JAZZ_BEBOP_BASE_API
48#define INCLUDED_JAZZ_BEBOP_BASE_API
49
50
57namespace jazz_bebop
58{
59
60using namespace jazz_elements;
61
62#define SIZE_OF_BASE_ENT_KEY (sizeof(Locator) - sizeof(pExtraLocator))
63
64#define RESULT_BUFFER_SIZE 4096
65#define SIZE_BUFFER_REMOTE_CALL 2048
66
67#define BASE_API_GET 3
68#define BASE_API_PUT 4
69#define BASE_API_DELETE 5
70
72
73#define PSTATE_INITIAL 0
74#define PSTATE_DONE_NODE 1
75#define PSTATE_NODE0 2
76#define PSTATE_IN_NODE 3
77#define PSTATE_BASE0 4
78#define PSTATE_IN_BASE 5
79#define PSTATE_ENTITY0 6
80#define PSTATE_IN_ENTITY 7
81#define PSTATE_KEY0 8
82#define PSTATE_IN_KEY 9
83#define PSTATE_INFO_SWITCH 10
84#define PSTATE_BASE_SWITCH 11
85#define PSTATE_ENT_SWITCH 12
86#define PSTATE_KEY_SWITCH 13
87#define PSTATE_FAILED 98
88#define PSTATE_COMPLETE_OK 99
89
90// BaseAPI.move_const() return values
91
92#define RET_MV_CONST_FAILED -1
93#define RET_MV_CONST_NOTHING 0
94#define RET_MV_CONST_NEW_ENTITY 1
95
96
100 int state;
101 int apply;
102
103 char l_node [NAME_SIZE];
104 char r_node [NAME_SIZE];
105 char base [SHORT_NAME_SIZE];
106 char entity [NAME_SIZE];
107 char key [NAME_SIZE];
108 char name [NAME_SIZE];
109 char url [MAX_FILE_OR_URL_SIZE];
110
113};
114
115
122class BaseAPI : public Container {
123
124 public:
125
126 BaseAPI(pLogger a_logger, pConfigFile a_config, pChannels a_channels, pVolatile a_volatile, pPersisted a_persisted);
127 ~BaseAPI();
128
129 virtual pChar const id();
130
131 StatusCode start ();
133
134 // Parsing method
135
136 bool parse (ApiQueryState &q_state,
137 pChar p_url,
138 int method,
139 bool recurse = false);
140
141 bool block_from_const (pTransaction &p_txn,
142 pChar p_const,
143 bool make_tuple = false);
144
145 // API Container interface
146
147 virtual StatusCode header (StaticBlockHeader &hea,
148 ApiQueryState &what);
149 virtual StatusCode get (pTransaction &p_txn,
150 ApiQueryState &what);
151 virtual StatusCode put (ApiQueryState &where,
152 pBlock p_block,
153 int mode = WRITE_AS_BASE_DEFAULT);
154 virtual StatusCode remove (ApiQueryState &what);
155
156 // Access to the individual Containers
157
163 return p_channels;
164 }
165
171 return p_volatile;
172 }
173
179 return p_persisted;
180 }
181
182 // The base_server is public to support objects using this to see what Containers are available.
183
185
186#ifndef CATCH_TEST
187 protected:
188#endif
189
190 bool parse_locator (Locator &loc,
191 pChar p_url);
192
207 inline int move_const(pChar p_buff, int buff_size, pChar p_url, pChar p_base = nullptr) {
208
209 if (*(p_url++) != '&')
210 return RET_MV_CONST_FAILED;
211
212 int url_len = strlen(p_url) - 1;
213
214 pChar p_end = p_url + url_len;
215
216 int ret = RET_MV_CONST_NOTHING;
217
218 if (*p_end == 'w') {
219 if ((*(--p_end) != 'e') || (*(--p_end) != 'n') || (*(--p_end) != '.') || (*(--p_end) != ';'))
220 return RET_MV_CONST_FAILED;
221
222 ret = RET_MV_CONST_NEW_ENTITY;
223 url_len -= 4;
224 }
225
226 if (*p_end != ';' && *p_end != ']' && *p_end != ')')
227 return RET_MV_CONST_FAILED;
228
229 if (*p_buff != 0)
230 return ret;
231
232 if (p_base != nullptr) {
233 if (buff_size < 4 + SHORT_NAME_SIZE)
234 return RET_MV_CONST_FAILED;
235
236 *(p_buff++) = '/';
237 *(p_buff++) = '/';
238
239 buff_size -= 2;
240
241 for (int i = 0; i < SHORT_NAME_SIZE; i++) {
242 char c = *(p_base++);
243
244 buff_size--;
245
246 if (c == 0) {
247 *(p_buff++) = '/';
248 break;
249 }
250 *(p_buff++) = c;
251 }
252 }
253
254 if (url_len >= buff_size)
255 return RET_MV_CONST_FAILED;
256
257 memcpy(p_buff, p_url, url_len);
258
259 p_buff += url_len;
260
261 *(p_buff) = 0;
262
263 return ret;
264 }
265
279
280 pTransaction p_aux;
281 pContainer p_container, p_aux_cont;
282
283 if (q_state.apply == APPLY_ASSIGN_CONST)
284 return block_from_const(p_txn, q_state.url) ? SERVICE_NO_ERROR : SERVICE_ERROR_WRONG_ARGUMENTS;
285
286 p_container = (pContainer) base_server[TenBitsAtAddress(q_state.r_value.base)];
287
288 if (p_container == nullptr)
289 return SERVICE_ERROR_WRONG_BASE;
290
291 switch (q_state.apply) {
292 case APPLY_ASSIGN_NOTHING:
293 return p_container->get(p_txn, q_state.r_value);
294
295 case APPLY_ASSIGN_NAME:
296 return p_container->get(p_txn, q_state.r_value, q_state.name);
297
298 case APPLY_ASSIGN_URL:
299 return p_container->get(p_txn, (pChar) q_state.url);
300
301 case APPLY_ASSIGN_FUNCTION:
302 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.rr_value.base)];
303
304 if (p_aux_cont == nullptr)
305 return SERVICE_ERROR_WRONG_BASE;
306
307 if (p_aux_cont->get(p_aux, q_state.rr_value) != SERVICE_NO_ERROR)
308 return SERVICE_ERROR_BLOCK_NOT_FOUND;
309
310 if (q_state.r_value.key[0] == 0) {
311 if (p_container->modify(q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
312 p_aux_cont->destroy_transaction(p_aux);
313
314 return SERVICE_ERROR_IO_ERROR;
315 }
316 Name ent = {"result"};
317 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
318 p_aux_cont->destroy_transaction(p_aux);
319
320 return SERVICE_ERROR_IO_ERROR;
321 }
322 } else {
323 if (p_container->exec(p_txn, q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
324 p_aux_cont->destroy_transaction(p_aux);
325
326 return SERVICE_ERROR_IO_ERROR;
327 }
328 }
329 p_aux_cont->destroy_transaction(p_aux);
330
331 return SERVICE_NO_ERROR;
332
333 case APPLY_ASSIGN_FUNCT_CONST:
334 if (!block_from_const(p_aux, q_state.url, q_state.r_value.key[0] == 0))
335 return SERVICE_ERROR_WRONG_ARGUMENTS;
336
337 if (q_state.r_value.key[0] == 0) {
338 if (p_container->modify(q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
339 destroy_transaction(p_aux);
340
341 return SERVICE_ERROR_IO_ERROR;
342 }
343 Name ent = {"result"};
344 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
345 destroy_transaction(p_aux);
346
347 return SERVICE_ERROR_IO_ERROR;
348 }
349 } else {
350 if (p_container->exec(p_txn, q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
351 destroy_transaction(p_aux);
352
353 return SERVICE_ERROR_IO_ERROR;
354 }
355 }
356 destroy_transaction(p_aux);
357
358 return SERVICE_NO_ERROR;
359
360 case APPLY_ASSIGN_FILTER:
361 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.rr_value.base)];
362
363 if (p_aux_cont == nullptr)
364 return SERVICE_ERROR_WRONG_BASE;
365
366 if (p_aux_cont->get(p_aux, q_state.rr_value) != SERVICE_NO_ERROR)
367 return SERVICE_ERROR_BLOCK_NOT_FOUND;
368
369 if (p_container->get(p_txn, q_state.r_value, p_aux->p_block) != SERVICE_NO_ERROR) {
370 p_aux_cont->destroy_transaction(p_aux);
371
372 return SERVICE_ERROR_IO_ERROR;
373 }
374 p_aux_cont->destroy_transaction(p_aux);
375
376 return SERVICE_NO_ERROR;
377
378 case APPLY_ASSIGN_FILT_CONST:
379 if (!block_from_const(p_aux, q_state.url))
380 return SERVICE_ERROR_WRONG_ARGUMENTS;
381
382 if (p_container->get(p_txn, q_state.r_value, p_aux->p_block) != SERVICE_NO_ERROR) {
383 destroy_transaction(p_aux);
384
385 return SERVICE_ERROR_IO_ERROR;
386 }
387 destroy_transaction(p_aux);
388
389 return SERVICE_NO_ERROR;
390
391 case APPLY_ASSIGN_RAW:
392 if (p_container->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
393 return SERVICE_ERROR_BLOCK_NOT_FOUND;
394
395 if (new_block(p_txn, p_aux->p_block, CELL_TYPE_UNDEFINED) != SERVICE_NO_ERROR) {
396 p_container->destroy_transaction(p_aux);
397
398 return SERVICE_ERROR_IO_ERROR;
399 }
400 p_container->destroy_transaction(p_aux);
401
402 return SERVICE_NO_ERROR;
403
404 case APPLY_ASSIGN_TEXT:
405 if (p_container->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
406 return SERVICE_ERROR_BLOCK_NOT_FOUND;
407
408 if (new_block(p_txn, p_aux->p_block, (pChar) nullptr, true) != SERVICE_NO_ERROR) {
409 p_container->destroy_transaction(p_aux);
410
411 return SERVICE_ERROR_IO_ERROR;
412 }
413 p_container->destroy_transaction(p_aux);
414
415 return SERVICE_NO_ERROR;
416 }
417 return SERVICE_ERROR_MISC_SERVER;
418 }
419
432
433 char buffer_2k[SIZE_BUFFER_REMOTE_CALL];
434
435 switch (q_state.apply) {
436 case APPLY_ASSIGN_NOTHING:
437 sprintf(buffer_2k, "//%s/%s/%s", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key);
438 break;
439 case APPLY_ASSIGN_NAME:
440 sprintf(buffer_2k, "//%s/%s/%s:%s", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key, q_state.name);
441 break;
442 case APPLY_ASSIGN_URL:
443 sprintf(buffer_2k, "//%s&%s;", q_state.r_value.base, q_state.url);
444 break;
445 case APPLY_ASSIGN_FUNCTION:
446 sprintf(buffer_2k, "//%s/%s/%s(//%s/%s/%s)", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key,
447 q_state.rr_value.base, q_state.rr_value.entity, q_state.rr_value.key);
448 break;
449 case APPLY_ASSIGN_FUNCT_CONST:
450 sprintf(buffer_2k, "//%s/%s/%s(&%s)", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key, q_state.url);
451 break;
452 case APPLY_ASSIGN_FILTER:
453 sprintf(buffer_2k, "//%s/%s/%s[//%s/%s/%s]", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key,
454 q_state.rr_value.base, q_state.rr_value.entity, q_state.rr_value.key);
455 break;
456 case APPLY_ASSIGN_FILT_CONST:
457 sprintf(buffer_2k, "//%s/%s/%s[&%s]", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key, q_state.url);
458 break;
459 case APPLY_ASSIGN_RAW:
460 sprintf(buffer_2k, "//%s/%s/%s.raw", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key);
461 break;
462 case APPLY_ASSIGN_TEXT:
463 sprintf(buffer_2k, "//%s/%s/%s.text", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key);
464 break;
465 default:
466 return SERVICE_ERROR_WRONG_ARGUMENTS;
467 }
468 return p_channels->forward_get(p_txn, q_state.r_node, buffer_2k);
469 }
470
482
483 Locator loc;
484 pTransaction p_aux;
485 pContainer p_container, p_aux_cont;
486
487 p_container = (pContainer) base_server[TenBitsAtAddress(q_state.base)];
488
489 if (p_container == nullptr)
490 return SERVICE_ERROR_WRONG_BASE;
491
492 switch (q_state.apply) {
493 case APPLY_NOTHING:
494 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
495 return p_container->get(p_txn, loc);
496
497 case APPLY_NAME:
498 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
499 return p_container->get(p_txn, loc, q_state.name);
500
501 case APPLY_URL:
502 return p_container->get(p_txn, (pChar) q_state.url);
503
504 case APPLY_FUNCTION:
505 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.r_value.base)];
506
507 if (p_aux_cont == nullptr)
508 return SERVICE_ERROR_WRONG_BASE;
509
510 if (p_aux_cont->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
511 return SERVICE_ERROR_BLOCK_NOT_FOUND;
512
513 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
514 if (q_state.key[0] == 0) {
515 if (p_container->modify(loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
516 p_aux_cont->destroy_transaction(p_aux);
517
518 return SERVICE_ERROR_IO_ERROR;
519 }
520 Name ent = {"result"};
521 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
522 p_aux_cont->destroy_transaction(p_aux);
523
524 return SERVICE_ERROR_IO_ERROR;
525 }
526 } else {
527 if (p_container->exec(p_txn, loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
528 p_aux_cont->destroy_transaction(p_aux);
529
530 return SERVICE_ERROR_IO_ERROR;
531 }
532 }
533 p_aux_cont->destroy_transaction(p_aux);
534
535 return SERVICE_NO_ERROR;
536
537 case APPLY_FUNCT_CONST:
538 if (!block_from_const(p_aux, q_state.url, q_state.key[0] == 0))
539 return SERVICE_ERROR_WRONG_ARGUMENTS;
540
541 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
542 if (q_state.key[0] == 0) {
543 if (p_container->modify(loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
544 destroy_transaction(p_aux);
545
546 return SERVICE_ERROR_IO_ERROR;
547 }
548 Name ent = {"result"};
549 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
550 destroy_transaction(p_aux);
551
552 return SERVICE_ERROR_IO_ERROR;
553 }
554 } else {
555 if (p_container->exec(p_txn, loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
556 destroy_transaction(p_aux);
557
558 return SERVICE_ERROR_IO_ERROR;
559 }
560 }
561 destroy_transaction(p_aux);
562
563 return SERVICE_NO_ERROR;
564
565 case APPLY_FILTER:
566 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.r_value.base)];
567
568 if (p_aux_cont == nullptr)
569 return SERVICE_ERROR_WRONG_BASE;
570
571 if (p_aux_cont->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
572 return SERVICE_ERROR_BLOCK_NOT_FOUND;
573
574 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
575 if (p_container->get(p_txn, loc, p_aux->p_block) != SERVICE_NO_ERROR) {
576 p_aux_cont->destroy_transaction(p_aux);
577
578 return SERVICE_ERROR_IO_ERROR;
579 }
580 p_aux_cont->destroy_transaction(p_aux);
581
582 return SERVICE_NO_ERROR;
583
584 case APPLY_FILT_CONST:
585 if (!block_from_const(p_aux, q_state.url))
586 return SERVICE_ERROR_WRONG_ARGUMENTS;
587
588 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
589 if (p_container->get(p_txn, loc, p_aux->p_block) != SERVICE_NO_ERROR) {
590 destroy_transaction(p_aux);
591
592 return SERVICE_ERROR_IO_ERROR;
593 }
594 destroy_transaction(p_aux);
595
596 return SERVICE_NO_ERROR;
597
598 case APPLY_RAW:
599 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
600 if (p_container->get(p_aux, loc) != SERVICE_NO_ERROR)
601 return SERVICE_ERROR_BLOCK_NOT_FOUND;
602
603 if (new_block(p_txn, p_aux->p_block, CELL_TYPE_UNDEFINED) != SERVICE_NO_ERROR) {
604 p_container->destroy_transaction(p_aux);
605
606 return SERVICE_ERROR_IO_ERROR;
607 }
608 p_container->destroy_transaction(p_aux);
609
610 return SERVICE_NO_ERROR;
611
612 case APPLY_TEXT:
613 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
614 if (p_container->get(p_aux, loc) != SERVICE_NO_ERROR)
615 return SERVICE_ERROR_BLOCK_NOT_FOUND;
616
617 if (new_block(p_txn, p_aux->p_block) != SERVICE_NO_ERROR) {
618 p_container->destroy_transaction(p_aux);
619
620 return SERVICE_ERROR_IO_ERROR;
621 }
622 p_container->destroy_transaction(p_aux);
623
624 return SERVICE_NO_ERROR;
625 }
626 return SERVICE_ERROR_MISC_SERVER;
627 }
628
639 inline StatusCode put_left_local(ApiQueryState &q_state, pBlock p_block) {
640
641 pContainer p_container = (pContainer) base_server[TenBitsAtAddress(q_state.base)];
642
643 if (p_container == nullptr)
644 return SERVICE_ERROR_WRONG_BASE;
645
646 Locator where;
647
648 memcpy(&where, &q_state.base, SIZE_OF_BASE_ENT_KEY);
649
650 return p_container->put(where, p_block);
651 }
652
656};
658
659#ifdef CATCH_TEST
660
661// Instancing BaseAPI
662// ------------------
663
664extern BaseAPI BAPI;
665
666#endif
667
668} // namespace jazz_bebop
669
670#endif // ifndef INCLUDED_JAZZ_BEBOP_BASE_API
BaseAPI: The parent of API and Core.
Definition base_api.h:122
pPersisted get_persisted()
Definition base_api.h:178
StatusCode start()
Definition base_api.cpp:143
pChannels get_channels()
Definition base_api.h:162
StatusCode get_left_local(pTransaction &p_txn, ApiQueryState &q_state)
Definition base_api.h:481
StatusCode get_right_remote(pTransaction &p_txn, ApiQueryState &q_state)
Definition base_api.h:431
virtual pChar const id()
Definition base_api.cpp:133
pVolatile get_volatile()
Definition base_api.h:170
pPersisted p_persisted
The Persisted container.
Definition base_api.h:655
TenBitPtrLUT base_server
A LUT to convert TenBitsAtAddress(base) into a pContainer.
Definition base_api.h:184
virtual StatusCode get(pTransaction &p_txn, ApiQueryState &what)
Definition base_api.cpp:697
bool block_from_const(pTransaction &p_txn, pChar p_const, bool make_tuple=false)
Definition base_api.cpp:950
StatusCode put_left_local(ApiQueryState &q_state, pBlock p_block)
Definition base_api.h:639
pChannels p_channels
The Channels container.
Definition base_api.h:653
pVolatile p_volatile
The Volatile container.
Definition base_api.h:654
virtual StatusCode header(StaticBlockHeader &hea, ApiQueryState &what)
Definition base_api.cpp:637
virtual StatusCode put(ApiQueryState &where, pBlock p_block, int mode=WRITE_AS_BASE_DEFAULT)
Definition base_api.cpp:840
int move_const(pChar p_buff, int buff_size, pChar p_url, pChar p_base=nullptr)
Definition base_api.h:207
bool parse(ApiQueryState &q_state, pChar p_url, int method, bool recurse=false)
Definition base_api.cpp:202
bool parse_locator(Locator &loc, pChar p_url)
Definition base_api.cpp:553
virtual StatusCode remove(ApiQueryState &what)
Definition base_api.cpp:913
StatusCode get_right_local(pTransaction &p_txn, ApiQueryState &q_state)
Definition base_api.h:278
StatusCode shut_down()
Definition base_api.cpp:177
Channels: A Container doing block transactions across media (files, folders, shell,...
Definition channel.h:227
MHD_StatusCode forward_get(pTransaction &p_txn, Name node, pChar p_url)
Definition channel.cpp:1063
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
StatusCode new_block(pTransaction &p_txn, int cell_type, int *dim, int fill_tensor=FILL_NEW_DONT_FILL, int stringbuff_size=0, const char *p_text=nullptr, char eol='\n', AttributeMap *att=nullptr)
Definition container.cpp:573
virtual void destroy_transaction(pTransaction &p_txn)
Definition container.cpp:493
A simple logger.
Definition utils.h:245
Persisted: A Service to manage data objects in LMDB.
Definition persisted.h:93
Tuple: A Jazz Block with multiple Tensors.
Definition tuple.h:94
Volatile: A Service to manage data objects in RAM.
Definition volatile.h:244
A language to access any container by base using locators.
Definition base_api.cpp:39
BaseAPI * pBaseAPI
A pointer to a BaseAPI.
Definition base_api.h:657
The namespace for Jazz Utils, Blocks, Kinds, Tuples, Containers, etc.
Definition block.cpp:39
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
char * pChar
A pointer to a char buffer.
Definition types.h:186
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:184
void * TenBitPtrLUT[TENBITS_LUT_SIZE]
A lookup table for all the possible results of a TenBitsAtAddress() call -> pointer.
Definition utils.h:156
class Container * pContainer
A (forward defined) pointer to a Container.
Definition container.h:148
int StatusCode
Type returned by the Service API.
Definition utils.h:141
A buffer to keep the state while parsing/executing a query.
Definition base_api.h:99
Locator rr_value
Parsed //r_base/r_entity/r_key(//rr_base/rr_entity/rr_key)
Definition base_api.h:112
char l_node[NAME_SIZE]
An optional name of a Jazz node that is either the only one or the left of assignment.
Definition base_api.h:103
char key[NAME_SIZE]
A Locator compatible key for the l_value.
Definition base_api.h:107
char url[MAX_FILE_OR_URL_SIZE]
The endpoint (an URL, file name, folder name, bash script)
Definition base_api.h:109
char name[NAME_SIZE]
A possible item name.
Definition base_api.h:108
char entity[NAME_SIZE]
A Locator compatible entity for the l_value.
Definition base_api.h:106
char r_node[NAME_SIZE]
An additional optional name of a Jazz node for the right part in an assignment.
Definition base_api.h:104
int apply
APPLY_NOTHING, APPLY_NAME, APPLY_URL, APPLY_FUNCTION, .. APPLY_ASSIGN_CONST.
Definition base_api.h:101
int state
The parser state from PSTATE_INITIAL to PSTATE_COMPLETE_OK.
Definition base_api.h:100
Locator r_value
Parsed //r_base/r_entity/r_key.
Definition base_api.h:111
char base[SHORT_NAME_SIZE]
A Locator compatible base for the l_value.
Definition base_api.h:105
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
A Binary Compatible BlockHeader without Index (and therefore constructors/destructors)
Definition types.h:266
Transaction: A wrapper over a Block that defines the communication of a block with a Container.
Definition container.h:162
pBlock p_block
A pointer to the Block (if status == BLOCK_STATUS_READY) for Tensor, Kind and Tuple.
Definition container.h:164