theLink 10.0
Loading...
Searching...
No Matches
MqContextC_StorageApi_ATL_API

MqContextC - setup and manage a storage used to persist data-packagesMore...

+ Collaboration diagram for MqContextC_StorageApi_ATL_API:

Functions

static OT_ProcRet atlmqmsgque_MqContextC_StorageDelete (MqContextC_ARGS)
  Atl: int32 [MqContextC::StorageDelete $ctx ?*transLIdP_inout:int32=0?] C-API
delete the storage-row identified by the transLIdP_inout
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageImport (MqContextC_ARGS)
  Atl: int32 [MqContextC::StorageImport $ctx ?*transLIdP_inout:int32=0?] C-API
import the storage-package into the read-data-package
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageClose (MqContextC_ARGS)
  Atl: MqContextC::StorageClose $ctx C-API
close the storage. …
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageDecrRef (MqContextC_ARGS)
  Atl: MqContextC::StorageDecrRef $ctx transLId:int32 C-API
decrease the internal refCount lock of the database-entry
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageIncrRef (MqContextC_ARGS)
  Atl: MqContextC::StorageIncrRef $ctx transLId:int32 C-API
increase the internal refCount lock of the database-entry
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageLog (MqContextC_ARGS)
  Atl: MqContextC::StorageLog $ctx ?callfunc:string="MK_NULL"? C-API
log the storage the status of the open transactions
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageOpen (MqContextC_ARGS)
  Atl: MqContextC::StorageOpen $ctx storageFile:string C-API
switch to a file-based-transaction-database
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageCount (MqContextC_ARGS)
  Atl: int32 [MqContextC::StorageCount $ctx] C-API
count the number of storage-rows
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageErrCnt (MqContextC_ARGS)
  Atl: int32 [MqContextC::StorageErrCnt $ctx transLId:int32] C-API
increment and return the database row-error-count for the row defined with transLId
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageExport (MqContextC_ARGS)
  Atl: int32 [MqContextC::StorageExport $ctx] C-API
export the read-data-package into the STORAGE
 
static OT_ProcRet atlmqmsgque_MqContextC_StorageResolve (MqContextC_ARGS)
  Atl: {otherCtxP:MqContextC otherLIdP:int32} [MqContextC::StorageResolve $ctx] C-API
extract the context->link.protect.rmtTransLId entry from the database
 

Detailed Description

MqContextC - setup and manage a storage used to persist data-packages

The storage is divided into: INTERNAL and EXTERNAL storage. Only the read-data-package can be stored or dumped into the storage.

The read-data-package is saved into the storage using:

ServiceStorage setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE
StorageExport export the read-data-package into the STORAGE

The read-data-package is restored from the storage using:

StorageImport import the storage-package into the read-data-package
ProxyForward send the entire read-data-package-data to the link-target
All this usually happen in an Event Handler

Some important facts of the storage-feature:

The following internal storages are supported:

default
The default-storage is set with the configuration parameter --storage fileName and defaults to "#memdb#". If a package have to be saved into the storage and the storage is not open the default-storage id used. The open will always be performed. If an explicit storage is required the default can be changed or a storage can explicit be opened with MqStorageOpen. Keep in mind that the default-storage is a per-context configuration but only one storage per process or thread is currently supported.
memdb
This is the default storage and can be set explicitly with MqStorageOpen using the "#memdb#" parameter.
tmpdb
This storage is like an in-memory-storage but export data to the TEMPORARY filesystem if the application run out of memory. This storage can explicit be set with MqStorageOpen with the parameter "#tmpdb#".
filedb
This storage always work on files. Only this storage is persistent and can explicit be set with MqStorageOpen with the storageFile parameter.

Performance analyse:

database performance host crash application crash info
memdb 30.000 data lost data lost non persistent
tempdb < 30.000 data lost data lost uses memory and/or temporary file
filedb (mem) 10.000 data lost data safe in memory filesystem
filedb (disc) 50 data safe data safe disc-speed is the key factor

Function Documentation

◆ atlmqmsgque_MqContextC_StorageClose()

static OT_ProcRet atlmqmsgque_MqContextC_StorageClose ( MqContextC_ARGS )
static

Atl: MqContextC::StorageClose $ctx C-API
close the storage. …

Definition at line 3422 of file MqContextC_atl.c.

3422 {
3426 MkErrorC_Check(hdl,MqStorageClose (hdl));
3428 goto end;
3429 error:
3431 end:
3433}
#define OT_SETUP_NOARG(d)
#define OT_retObj_SET_Error
#define OT_retObj_SET_None
#define OT_retObj_RETURN
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define StorageClose_doc
#define OT_SETUP_hdl
#define error
Definition high_lng.h:339
#define MqStorageClose(...)

◆ atlmqmsgque_MqContextC_StorageCount()

static OT_ProcRet atlmqmsgque_MqContextC_StorageCount ( MqContextC_ARGS )
static

Atl: int32 [MqContextC::StorageCount $ctx] C-API
count the number of storage-rows

Definition at line 3504 of file MqContextC_atl.c.

3504 {
3508 MQ_LTR cnt_out;
3509 MkErrorC_Check(hdl,MqStorageCount (hdl, &cnt_out));
3510 OT_retObj_SET_I32(cnt_out);
3511 goto end;
3512 error:
3514 end:
3516}
#define OT_retObj_SET_I32(nat)
#define StorageCount_doc
#define MqStorageCount(...)
int MQ_LTR
32bit longterm transaction token because PHP-32 does NOT support long long

◆ atlmqmsgque_MqContextC_StorageDecrRef()

static OT_ProcRet atlmqmsgque_MqContextC_StorageDecrRef ( MqContextC_ARGS )
static

Atl: MqContextC::StorageDecrRef $ctx transLId:int32 C-API
decrease the internal refCount lock of the database-entry

Definition at line 3436 of file MqContextC_atl.c.

3436 {
3439 MQ_LTR transLId = 0;
3442 MkErrorC_Check(hdl,MqStorageDecrRef (hdl, transLId));
3444 goto end;
3445 error:
3447 end:
3449}
#define OT_SETUP_ONEARG(d)
#define OT_CHECK_NI4(val)
#define OT_CHECK_REQUIRED(val)
#define StorageDecrRef_doc
#define MqStorageDecrRef(...)

◆ atlmqmsgque_MqContextC_StorageDelete()

static OT_ProcRet atlmqmsgque_MqContextC_StorageDelete ( MqContextC_ARGS )
static

Atl: int32 [MqContextC::StorageDelete $ctx ?*transLIdP_inout:int32=0?] C-API
delete the storage-row identified by the transLIdP_inout

Definition at line 3388 of file MqContextC_atl.c.

3388 {
3391 MQ_LTR transLIdP_inout = 0;
3392 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3394 MkErrorC_Check(hdl,MqStorageDelete (hdl, &transLIdP_inout));
3395 OT_retObj_SET_I32(transLIdP_inout);
3396 goto end;
3397 error:
3399 end:
3401}
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_OPTIONAL(val)
#define StorageDelete_doc
#define MqStorageDelete(...)

◆ atlmqmsgque_MqContextC_StorageErrCnt()

static OT_ProcRet atlmqmsgque_MqContextC_StorageErrCnt ( MqContextC_ARGS )
static

Atl: int32 [MqContextC::StorageErrCnt $ctx transLId:int32] C-API
increment and return the database row-error-count for the row defined with transLId

Definition at line 3519 of file MqContextC_atl.c.

3519 {
3522 MQ_LTR transLId = 0;
3525 MK_I32 cnt_out;
3526 MkErrorC_Check(hdl,MqStorageErrCnt (hdl, transLId, &cnt_out));
3527 OT_retObj_SET_I32(cnt_out);
3528 goto end;
3529 error:
3531 end:
3533}
#define StorageErrCnt_doc
signed int MK_I32
#define MqStorageErrCnt(...)

◆ atlmqmsgque_MqContextC_StorageExport()

static OT_ProcRet atlmqmsgque_MqContextC_StorageExport ( MqContextC_ARGS )
static

Atl: int32 [MqContextC::StorageExport $ctx] C-API
export the read-data-package into the STORAGE

Definition at line 3536 of file MqContextC_atl.c.

3536 {
3540 MQ_LTR ltid_out;
3541 MkErrorC_Check(hdl,MqStorageExport (hdl, &ltid_out));
3542 OT_retObj_SET_I32(ltid_out);
3543 goto end;
3544 error:
3546 end:
3548}
#define StorageExport_doc
#define MqStorageExport(...)

◆ atlmqmsgque_MqContextC_StorageImport()

static OT_ProcRet atlmqmsgque_MqContextC_StorageImport ( MqContextC_ARGS )
static

Atl: int32 [MqContextC::StorageImport $ctx ?*transLIdP_inout:int32=0?] C-API
import the storage-package into the read-data-package

Definition at line 3404 of file MqContextC_atl.c.

3404 {
3407 MQ_LTR transLIdP_inout = 0;
3408 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3410 MkErrorC_Check(hdl,MqStorageImport (hdl, &transLIdP_inout));
3411 OT_retObj_SET_I32(transLIdP_inout);
3412 goto end;
3413 error:
3415 end:
3417}
#define StorageImport_doc
#define MqStorageImport(...)

◆ atlmqmsgque_MqContextC_StorageIncrRef()

static OT_ProcRet atlmqmsgque_MqContextC_StorageIncrRef ( MqContextC_ARGS )
static

Atl: MqContextC::StorageIncrRef $ctx transLId:int32 C-API
increase the internal refCount lock of the database-entry

Definition at line 3452 of file MqContextC_atl.c.

3452 {
3455 MQ_LTR transLId = 0;
3458 MkErrorC_Check(hdl,MqStorageIncrRef (hdl, transLId));
3460 goto end;
3461 error:
3463 end:
3465}
#define StorageIncrRef_doc
#define MqStorageIncrRef(...)

◆ atlmqmsgque_MqContextC_StorageLog()

static OT_ProcRet atlmqmsgque_MqContextC_StorageLog ( MqContextC_ARGS )
static

Atl: MqContextC::StorageLog $ctx ?callfunc:string="MK_NULL"? C-API
log the storage the status of the open transactions

Definition at line 3468 of file MqContextC_atl.c.

3468 {
3471 MK_STRN callfunc = NULL;
3474 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
3475 MkErrorC_Check(hdl,MqStorageLog (hdl, callfunc));
3477 goto end;
3478 error:
3480 end:
3483}
#define OT_FRAME_CLEANUP
#define OT_GET_CALL_PROC
#define OT_CHECK_STRN(val)
#define StorageLog_doc
const MK_STRB * MK_STRN
static bool MkSysStringIsNULL(MK_STRN str)
#define MqStorageLog(...)

◆ atlmqmsgque_MqContextC_StorageOpen()

static OT_ProcRet atlmqmsgque_MqContextC_StorageOpen ( MqContextC_ARGS )
static

Atl: MqContextC::StorageOpen $ctx storageFile:string C-API
switch to a file-based-transaction-database

Definition at line 3486 of file MqContextC_atl.c.

3486 {
3489 MK_STRN storageFile = 0;
3490 OT_CHECK_REQUIRED(OT_CHECK_STRN (storageFile))
3492 MkErrorC_Check(hdl,MqStorageOpen (hdl, storageFile));
3494 goto end;
3495 error:
3497 end:
3499}
#define StorageOpen_doc
#define MqStorageOpen(...)

◆ atlmqmsgque_MqContextC_StorageResolve()

static OT_ProcRet atlmqmsgque_MqContextC_StorageResolve ( MqContextC_ARGS )
static

Atl: {otherCtxP:MqContextC otherLIdP:int32} [MqContextC::StorageResolve $ctx] C-API
extract the context->link.protect.rmtTransLId entry from the database

Definition at line 3551 of file MqContextC_atl.c.

3551 {
3555 MQ_CTX otherCtxP_out;
3556 MQ_LTR otherLIdP_out;
3557 MkErrorC_Check(hdl,MqStorageResolve (hdl, &otherCtxP_out, &otherLIdP_out));
3559 OT_retObj_APPEND(OT_TMP_CTX_OBJ(otherCtxP_out));
3560 OT_retObj_APPEND(OT_TMP_I32_OBJ(otherLIdP_out));
3561 goto end;
3562 error:
3564 end:
3566}
#define OT_retObj_SET_List
#define OT_TMP_I32_OBJ(val)
#define OT_retObj_APPEND(var)
#define OT_TMP_CTX_OBJ(nat)
#define StorageResolve_doc
#define MqStorageResolve(...)
PUBLIC data structure for the atlmqmsgque-specific-data