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
121class BaseAPI : public Container {
122
123 public:
124
125 BaseAPI(pLogger a_logger, pConfigFile a_config, pChannels a_channels, pVolatile a_volatile, pPersisted a_persisted);
126 ~BaseAPI();
127
128 virtual pChar const id();
129
130 StatusCode start ();
132
133 // Parsing method
134
135 bool parse (ApiQueryState &q_state,
136 pChar p_url,
137 int method,
138 bool recurse = false);
139
140 bool block_from_const (pTransaction &p_txn,
141 pChar p_const,
142 bool make_tuple = false);
143
144 // API Container interface
145
146 virtual StatusCode header (StaticBlockHeader &hea,
147 ApiQueryState &what);
148 virtual StatusCode get (pTransaction &p_txn,
149 ApiQueryState &what);
150 virtual StatusCode put (ApiQueryState &where,
151 pBlock p_block,
152 int mode = WRITE_AS_BASE_DEFAULT);
153 virtual StatusCode remove (ApiQueryState &what);
154
155 // Access to the individual Containers
156
162 return p_channels;
163 }
164
170 return p_volatile;
171 }
172
178 return p_persisted;
179 }
180
181 // The base_server is public to support objects using this to see what Containers are available.
182
184
185#ifndef CATCH_TEST
186 protected:
187#endif
188
189 bool parse_locator (Locator &loc,
190 pChar p_url);
191
206 inline int move_const(pChar p_buff, int buff_size, pChar p_url, pChar p_base = nullptr) {
207
208 if (*(p_url++) != '&')
209 return RET_MV_CONST_FAILED;
210
211 int url_len = strlen(p_url) - 1;
212
213 pChar p_end = p_url + url_len;
214
215 int ret = RET_MV_CONST_NOTHING;
216
217 if (*p_end == 'w') {
218 if ((*(--p_end) != 'e') || (*(--p_end) != 'n') || (*(--p_end) != '.') || (*(--p_end) != ';'))
219 return RET_MV_CONST_FAILED;
220
221 ret = RET_MV_CONST_NEW_ENTITY;
222 url_len -= 4;
223 }
224
225 if (*p_end != ';' && *p_end != ']' && *p_end != ')')
226 return RET_MV_CONST_FAILED;
227
228 if (*p_buff != 0)
229 return ret;
230
231 if (p_base != nullptr) {
232 if (buff_size < 4 + SHORT_NAME_SIZE)
233 return RET_MV_CONST_FAILED;
234
235 *(p_buff++) = '/';
236 *(p_buff++) = '/';
237
238 buff_size -= 2;
239
240 for (int i = 0; i < SHORT_NAME_SIZE; i++) {
241 char c = *(p_base++);
242
243 buff_size--;
244
245 if (c == 0) {
246 *(p_buff++) = '/';
247 break;
248 }
249 *(p_buff++) = c;
250 }
251 }
252
253 if (url_len >= buff_size)
254 return RET_MV_CONST_FAILED;
255
256 memcpy(p_buff, p_url, url_len);
257
258 p_buff += url_len;
259
260 *(p_buff) = 0;
261
262 return ret;
263 }
264
278
279 pTransaction p_aux;
280 pContainer p_container, p_aux_cont;
281
282 if (q_state.apply == APPLY_ASSIGN_CONST)
283 return block_from_const(p_txn, q_state.url) ? SERVICE_NO_ERROR : SERVICE_ERROR_WRONG_ARGUMENTS;
284
285 p_container = (pContainer) base_server[TenBitsAtAddress(q_state.r_value.base)];
286
287 if (p_container == nullptr)
288 return SERVICE_ERROR_WRONG_BASE;
289
290 switch (q_state.apply) {
291 case APPLY_ASSIGN_NOTHING:
292 return p_container->get(p_txn, q_state.r_value);
293
294 case APPLY_ASSIGN_NAME:
295 return p_container->get(p_txn, q_state.r_value, q_state.name);
296
297 case APPLY_ASSIGN_URL:
298 return p_container->get(p_txn, (pChar) q_state.url);
299
300 case APPLY_ASSIGN_FUNCTION:
301 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.rr_value.base)];
302
303 if (p_aux_cont == nullptr)
304 return SERVICE_ERROR_WRONG_BASE;
305
306 if (p_aux_cont->get(p_aux, q_state.rr_value) != SERVICE_NO_ERROR)
307 return SERVICE_ERROR_BLOCK_NOT_FOUND;
308
309 if (q_state.r_value.key[0] == 0) {
310 if (p_container->modify(q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
311 p_aux_cont->destroy_transaction(p_aux);
312
313 return SERVICE_ERROR_IO_ERROR;
314 }
315 Name ent = {"result"};
316 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
317 p_aux_cont->destroy_transaction(p_aux);
318
319 return SERVICE_ERROR_IO_ERROR;
320 }
321 } else {
322 if (p_container->exec(p_txn, q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
323 p_aux_cont->destroy_transaction(p_aux);
324
325 return SERVICE_ERROR_IO_ERROR;
326 }
327 }
328 p_aux_cont->destroy_transaction(p_aux);
329
330 return SERVICE_NO_ERROR;
331
332 case APPLY_ASSIGN_FUNCT_CONST:
333 if (!block_from_const(p_aux, q_state.url, q_state.r_value.key[0] == 0))
334 return SERVICE_ERROR_WRONG_ARGUMENTS;
335
336 if (q_state.r_value.key[0] == 0) {
337 if (p_container->modify(q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
338 destroy_transaction(p_aux);
339
340 return SERVICE_ERROR_IO_ERROR;
341 }
342 Name ent = {"result"};
343 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
344 destroy_transaction(p_aux);
345
346 return SERVICE_ERROR_IO_ERROR;
347 }
348 } else {
349 if (p_container->exec(p_txn, q_state.r_value, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
350 destroy_transaction(p_aux);
351
352 return SERVICE_ERROR_IO_ERROR;
353 }
354 }
355 destroy_transaction(p_aux);
356
357 return SERVICE_NO_ERROR;
358
359 case APPLY_ASSIGN_FILTER:
360 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.rr_value.base)];
361
362 if (p_aux_cont == nullptr)
363 return SERVICE_ERROR_WRONG_BASE;
364
365 if (p_aux_cont->get(p_aux, q_state.rr_value) != SERVICE_NO_ERROR)
366 return SERVICE_ERROR_BLOCK_NOT_FOUND;
367
368 if (p_container->get(p_txn, q_state.r_value, p_aux->p_block) != SERVICE_NO_ERROR) {
369 p_aux_cont->destroy_transaction(p_aux);
370
371 return SERVICE_ERROR_IO_ERROR;
372 }
373 p_aux_cont->destroy_transaction(p_aux);
374
375 return SERVICE_NO_ERROR;
376
377 case APPLY_ASSIGN_FILT_CONST:
378 if (!block_from_const(p_aux, q_state.url))
379 return SERVICE_ERROR_WRONG_ARGUMENTS;
380
381 if (p_container->get(p_txn, q_state.r_value, p_aux->p_block) != SERVICE_NO_ERROR) {
382 destroy_transaction(p_aux);
383
384 return SERVICE_ERROR_IO_ERROR;
385 }
386 destroy_transaction(p_aux);
387
388 return SERVICE_NO_ERROR;
389
390 case APPLY_ASSIGN_RAW:
391 if (p_container->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
392 return SERVICE_ERROR_BLOCK_NOT_FOUND;
393
394 if (new_block(p_txn, p_aux->p_block, CELL_TYPE_UNDEFINED) != SERVICE_NO_ERROR) {
395 p_container->destroy_transaction(p_aux);
396
397 return SERVICE_ERROR_IO_ERROR;
398 }
399 p_container->destroy_transaction(p_aux);
400
401 return SERVICE_NO_ERROR;
402
403 case APPLY_ASSIGN_TEXT:
404 if (p_container->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
405 return SERVICE_ERROR_BLOCK_NOT_FOUND;
406
407 if (new_block(p_txn, p_aux->p_block, (pChar) nullptr, true) != SERVICE_NO_ERROR) {
408 p_container->destroy_transaction(p_aux);
409
410 return SERVICE_ERROR_IO_ERROR;
411 }
412 p_container->destroy_transaction(p_aux);
413
414 return SERVICE_NO_ERROR;
415 }
416 return SERVICE_ERROR_MISC_SERVER;
417 }
418
431
432 char buffer_2k[SIZE_BUFFER_REMOTE_CALL];
433
434 switch (q_state.apply) {
435 case APPLY_ASSIGN_NOTHING:
436 sprintf(buffer_2k, "//%s/%s/%s", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key);
437 break;
438 case APPLY_ASSIGN_NAME:
439 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);
440 break;
441 case APPLY_ASSIGN_URL:
442 sprintf(buffer_2k, "//%s&%s;", q_state.r_value.base, q_state.url);
443 break;
444 case APPLY_ASSIGN_FUNCTION:
445 sprintf(buffer_2k, "//%s/%s/%s(//%s/%s/%s)", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key,
446 q_state.rr_value.base, q_state.rr_value.entity, q_state.rr_value.key);
447 break;
448 case APPLY_ASSIGN_FUNCT_CONST:
449 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);
450 break;
451 case APPLY_ASSIGN_FILTER:
452 sprintf(buffer_2k, "//%s/%s/%s[//%s/%s/%s]", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key,
453 q_state.rr_value.base, q_state.rr_value.entity, q_state.rr_value.key);
454 break;
455 case APPLY_ASSIGN_FILT_CONST:
456 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);
457 break;
458 case APPLY_ASSIGN_RAW:
459 sprintf(buffer_2k, "//%s/%s/%s.raw", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key);
460 break;
461 case APPLY_ASSIGN_TEXT:
462 sprintf(buffer_2k, "//%s/%s/%s.text", q_state.r_value.base, q_state.r_value.entity, q_state.r_value.key);
463 break;
464 default:
465 return SERVICE_ERROR_WRONG_ARGUMENTS;
466 }
467 return p_channels->forward_get(p_txn, q_state.r_node, buffer_2k);
468 }
469
481
482 Locator loc;
483 pTransaction p_aux;
484 pContainer p_container, p_aux_cont;
485
486 p_container = (pContainer) base_server[TenBitsAtAddress(q_state.base)];
487
488 if (p_container == nullptr)
489 return SERVICE_ERROR_WRONG_BASE;
490
491 switch (q_state.apply) {
492 case APPLY_NOTHING:
493 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
494 return p_container->get(p_txn, loc);
495
496 case APPLY_NAME:
497 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
498 return p_container->get(p_txn, loc, q_state.name);
499
500 case APPLY_URL:
501 return p_container->get(p_txn, (pChar) q_state.url);
502
503 case APPLY_FUNCTION:
504 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.r_value.base)];
505
506 if (p_aux_cont == nullptr)
507 return SERVICE_ERROR_WRONG_BASE;
508
509 if (p_aux_cont->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
510 return SERVICE_ERROR_BLOCK_NOT_FOUND;
511
512 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
513 if (q_state.key[0] == 0) {
514 if (p_container->modify(loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
515 p_aux_cont->destroy_transaction(p_aux);
516
517 return SERVICE_ERROR_IO_ERROR;
518 }
519 Name ent = {"result"};
520 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
521 p_aux_cont->destroy_transaction(p_aux);
522
523 return SERVICE_ERROR_IO_ERROR;
524 }
525 } else {
526 if (p_container->exec(p_txn, loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
527 p_aux_cont->destroy_transaction(p_aux);
528
529 return SERVICE_ERROR_IO_ERROR;
530 }
531 }
532 p_aux_cont->destroy_transaction(p_aux);
533
534 return SERVICE_NO_ERROR;
535
536 case APPLY_FUNCT_CONST:
537 if (!block_from_const(p_aux, q_state.url, q_state.key[0] == 0))
538 return SERVICE_ERROR_WRONG_ARGUMENTS;
539
540 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
541 if (q_state.key[0] == 0) {
542 if (p_container->modify(loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
543 destroy_transaction(p_aux);
544
545 return SERVICE_ERROR_IO_ERROR;
546 }
547 Name ent = {"result"};
548 if (new_block(p_txn, (pTuple) p_aux->p_block, ent) != SERVICE_NO_ERROR) {
549 destroy_transaction(p_aux);
550
551 return SERVICE_ERROR_IO_ERROR;
552 }
553 } else {
554 if (p_container->exec(p_txn, loc, (pTuple) p_aux->p_block) != SERVICE_NO_ERROR) {
555 destroy_transaction(p_aux);
556
557 return SERVICE_ERROR_IO_ERROR;
558 }
559 }
560 destroy_transaction(p_aux);
561
562 return SERVICE_NO_ERROR;
563
564 case APPLY_FILTER:
565 p_aux_cont = (pContainer) base_server[TenBitsAtAddress(q_state.r_value.base)];
566
567 if (p_aux_cont == nullptr)
568 return SERVICE_ERROR_WRONG_BASE;
569
570 if (p_aux_cont->get(p_aux, q_state.r_value) != SERVICE_NO_ERROR)
571 return SERVICE_ERROR_BLOCK_NOT_FOUND;
572
573 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
574 if (p_container->get(p_txn, loc, p_aux->p_block) != SERVICE_NO_ERROR) {
575 p_aux_cont->destroy_transaction(p_aux);
576
577 return SERVICE_ERROR_IO_ERROR;
578 }
579 p_aux_cont->destroy_transaction(p_aux);
580
581 return SERVICE_NO_ERROR;
582
583 case APPLY_FILT_CONST:
584 if (!block_from_const(p_aux, q_state.url))
585 return SERVICE_ERROR_WRONG_ARGUMENTS;
586
587 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
588 if (p_container->get(p_txn, loc, p_aux->p_block) != SERVICE_NO_ERROR) {
589 destroy_transaction(p_aux);
590
591 return SERVICE_ERROR_IO_ERROR;
592 }
593 destroy_transaction(p_aux);
594
595 return SERVICE_NO_ERROR;
596
597 case APPLY_RAW:
598 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
599 if (p_container->get(p_aux, loc) != SERVICE_NO_ERROR)
600 return SERVICE_ERROR_BLOCK_NOT_FOUND;
601
602 if (new_block(p_txn, p_aux->p_block, CELL_TYPE_UNDEFINED) != SERVICE_NO_ERROR) {
603 p_container->destroy_transaction(p_aux);
604
605 return SERVICE_ERROR_IO_ERROR;
606 }
607 p_container->destroy_transaction(p_aux);
608
609 return SERVICE_NO_ERROR;
610
611 case APPLY_TEXT:
612 memcpy(&loc, &q_state.base, SIZE_OF_BASE_ENT_KEY);
613 if (p_container->get(p_aux, loc) != SERVICE_NO_ERROR)
614 return SERVICE_ERROR_BLOCK_NOT_FOUND;
615
616 if (new_block(p_txn, p_aux->p_block) != SERVICE_NO_ERROR) {
617 p_container->destroy_transaction(p_aux);
618
619 return SERVICE_ERROR_IO_ERROR;
620 }
621 p_container->destroy_transaction(p_aux);
622
623 return SERVICE_NO_ERROR;
624 }
625 return SERVICE_ERROR_MISC_SERVER;
626 }
627
638 inline StatusCode put_left_local(ApiQueryState &q_state, pBlock p_block) {
639
640 pContainer p_container = (pContainer) base_server[TenBitsAtAddress(q_state.base)];
641
642 if (p_container == nullptr)
643 return SERVICE_ERROR_WRONG_BASE;
644
645 Locator where;
646
647 memcpy(&where, &q_state.base, SIZE_OF_BASE_ENT_KEY);
648
649 return p_container->put(where, p_block);
650 }
651
655};
657
658#ifdef CATCH_TEST
659
660// Instancing BaseAPI
661// ------------------
662
663extern BaseAPI BAPI;
664
665#endif
666
667} // namespace jazz_bebop
668
669#endif // ifndef INCLUDED_JAZZ_BEBOP_BASE_API
BaseAPI: The parent of API and Core.
Definition base_api.h:121
pPersisted get_persisted()
Definition base_api.h:177
StatusCode start()
Definition base_api.cpp:143
pChannels get_channels()
Definition base_api.h:161
StatusCode get_left_local(pTransaction &p_txn, ApiQueryState &q_state)
Definition base_api.h:480
StatusCode get_right_remote(pTransaction &p_txn, ApiQueryState &q_state)
Definition base_api.h:430
virtual pChar const id()
Definition base_api.cpp:133
pVolatile get_volatile()
Definition base_api.h:169
pPersisted p_persisted
The Persisted container.
Definition base_api.h:654
TenBitPtrLUT base_server
A LUT to convert TenBitsAtAddress(base) into a pContainer.
Definition base_api.h:183
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:638
pChannels p_channels
The Channels container.
Definition base_api.h:652
pVolatile p_volatile
The Volatile container.
Definition base_api.h:653
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:206
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:277
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:656
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: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
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:265
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