theLink 10.0
Loading...
Searching...
No Matches
MqContextC_StorageApi_PY_API

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

+ Collaboration diagram for MqContextC_StorageApi_PY_API:

Functions

static OT_ProcRet pymqmsgque_MqContextC_StorageDelete (MqContextC_ARGS)
  Python: int32 ctx.StorageDelete(?*transLIdP_inout:int32=0?) C-API
delete the storage-row identified by the transLIdP_inout
 
static OT_ProcRet pymqmsgque_MqContextC_StorageImport (MqContextC_ARGS)
  Python: int32 ctx.StorageImport(?*transLIdP_inout:int32=0?) C-API
import the storage-package into the read-data-package
 
static OT_ProcRet pymqmsgque_MqContextC_StorageClose (MqContextC_ARGS)
  Python: ctx.StorageClose() C-API
close the storage. …
 
static OT_ProcRet pymqmsgque_MqContextC_StorageDecrRef (MqContextC_ARGS)
  Python: ctx.StorageDecrRef(transLId:int32) C-API
decrease the internal refCount lock of the database-entry
 
static OT_ProcRet pymqmsgque_MqContextC_StorageIncrRef (MqContextC_ARGS)
  Python: ctx.StorageIncrRef(transLId:int32) C-API
increase the internal refCount lock of the database-entry
 
static OT_ProcRet pymqmsgque_MqContextC_StorageLog (MqContextC_ARGS)
  Python: ctx.StorageLog(?callfunc:string="MK_NULL"?) C-API
log the storage the status of the open transactions
 
static OT_ProcRet pymqmsgque_MqContextC_StorageOpen (MqContextC_ARGS)
  Python: ctx.StorageOpen(storageFile:string) C-API
switch to a file-based-transaction-database
 
static OT_ProcRet pymqmsgque_MqContextC_StorageCount (MqContextC_ARGS)
  Python: int32 ctx.StorageCount() C-API
count the number of storage-rows
 
static OT_ProcRet pymqmsgque_MqContextC_StorageErrCnt (MqContextC_ARGS)
  Python: int32 ctx.StorageErrCnt(transLId:int32) C-API
increment and return the database row-error-count for the row defined with transLId
 
static OT_ProcRet pymqmsgque_MqContextC_StorageExport (MqContextC_ARGS)
  Python: int32 ctx.StorageExport() C-API
export the read-data-package into the STORAGE
 
static OT_ProcRet pymqmsgque_MqContextC_StorageResolve (MqContextC_ARGS)
  Python: {otherCtxP:MqContextC otherLIdP:int32} ctx.StorageResolve() 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

◆ pymqmsgque_MqContextC_StorageClose()

static OT_ProcRet pymqmsgque_MqContextC_StorageClose ( MqContextC_ARGS )
static

Python: ctx.StorageClose() C-API
close the storage. …

Definition at line 3391 of file MqContextC_py.c.

3391 {
3395 MkErrorC_Check(hdl,MqStorageClose (hdl));
3397 goto end;
3398 error:
3400 end:
3402}
#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(...)

◆ pymqmsgque_MqContextC_StorageCount()

static OT_ProcRet pymqmsgque_MqContextC_StorageCount ( MqContextC_ARGS )
static

Python: int32 ctx.StorageCount() C-API
count the number of storage-rows

Definition at line 3473 of file MqContextC_py.c.

3473 {
3477 MQ_LTR cnt_out;
3478 MkErrorC_Check(hdl,MqStorageCount (hdl, &cnt_out));
3479 OT_retObj_SET_I32(cnt_out);
3480 goto end;
3481 error:
3483 end:
3485}
#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

◆ pymqmsgque_MqContextC_StorageDecrRef()

static OT_ProcRet pymqmsgque_MqContextC_StorageDecrRef ( MqContextC_ARGS )
static

Python: ctx.StorageDecrRef(transLId:int32) C-API
decrease the internal refCount lock of the database-entry

Definition at line 3405 of file MqContextC_py.c.

3405 {
3408 MQ_LTR transLId = 0;
3411 MkErrorC_Check(hdl,MqStorageDecrRef (hdl, transLId));
3413 goto end;
3414 error:
3416 end:
3418}
#define OT_SETUP_ONEARG(d)
#define OT_CHECK_NI4(val)
#define OT_CHECK_REQUIRED(val)
#define StorageDecrRef_doc
#define MqStorageDecrRef(...)

◆ pymqmsgque_MqContextC_StorageDelete()

static OT_ProcRet pymqmsgque_MqContextC_StorageDelete ( MqContextC_ARGS )
static

Python: int32 ctx.StorageDelete(?*transLIdP_inout:int32=0?) C-API
delete the storage-row identified by the transLIdP_inout

Definition at line 3357 of file MqContextC_py.c.

3357 {
3360 MQ_LTR transLIdP_inout = 0;
3361 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3363 MkErrorC_Check(hdl,MqStorageDelete (hdl, &transLIdP_inout));
3364 OT_retObj_SET_I32(transLIdP_inout);
3365 goto end;
3366 error:
3368 end:
3370}
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_OPTIONAL(val)
#define StorageDelete_doc
#define MqStorageDelete(...)

◆ pymqmsgque_MqContextC_StorageErrCnt()

static OT_ProcRet pymqmsgque_MqContextC_StorageErrCnt ( MqContextC_ARGS )
static

Python: int32 ctx.StorageErrCnt(transLId:int32) C-API
increment and return the database row-error-count for the row defined with transLId

Definition at line 3488 of file MqContextC_py.c.

3488 {
3491 MQ_LTR transLId = 0;
3494 MK_I32 cnt_out;
3495 MkErrorC_Check(hdl,MqStorageErrCnt (hdl, transLId, &cnt_out));
3496 OT_retObj_SET_I32(cnt_out);
3497 goto end;
3498 error:
3500 end:
3502}
#define StorageErrCnt_doc
signed int MK_I32
#define MqStorageErrCnt(...)

◆ pymqmsgque_MqContextC_StorageExport()

static OT_ProcRet pymqmsgque_MqContextC_StorageExport ( MqContextC_ARGS )
static

Python: int32 ctx.StorageExport() C-API
export the read-data-package into the STORAGE

Definition at line 3505 of file MqContextC_py.c.

3505 {
3509 MQ_LTR ltid_out;
3510 MkErrorC_Check(hdl,MqStorageExport (hdl, &ltid_out));
3511 OT_retObj_SET_I32(ltid_out);
3512 goto end;
3513 error:
3515 end:
3517}
#define StorageExport_doc
#define MqStorageExport(...)

◆ pymqmsgque_MqContextC_StorageImport()

static OT_ProcRet pymqmsgque_MqContextC_StorageImport ( MqContextC_ARGS )
static

Python: int32 ctx.StorageImport(?*transLIdP_inout:int32=0?) C-API
import the storage-package into the read-data-package

Definition at line 3373 of file MqContextC_py.c.

3373 {
3376 MQ_LTR transLIdP_inout = 0;
3377 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3379 MkErrorC_Check(hdl,MqStorageImport (hdl, &transLIdP_inout));
3380 OT_retObj_SET_I32(transLIdP_inout);
3381 goto end;
3382 error:
3384 end:
3386}
#define StorageImport_doc
#define MqStorageImport(...)

◆ pymqmsgque_MqContextC_StorageIncrRef()

static OT_ProcRet pymqmsgque_MqContextC_StorageIncrRef ( MqContextC_ARGS )
static

Python: ctx.StorageIncrRef(transLId:int32) C-API
increase the internal refCount lock of the database-entry

Definition at line 3421 of file MqContextC_py.c.

3421 {
3424 MQ_LTR transLId = 0;
3427 MkErrorC_Check(hdl,MqStorageIncrRef (hdl, transLId));
3429 goto end;
3430 error:
3432 end:
3434}
#define StorageIncrRef_doc
#define MqStorageIncrRef(...)

◆ pymqmsgque_MqContextC_StorageLog()

static OT_ProcRet pymqmsgque_MqContextC_StorageLog ( MqContextC_ARGS )
static

Python: ctx.StorageLog(?callfunc:string="MK_NULL"?) C-API
log the storage the status of the open transactions

Definition at line 3437 of file MqContextC_py.c.

3437 {
3440 MK_STRN callfunc = NULL;
3443 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
3444 MkErrorC_Check(hdl,MqStorageLog (hdl, callfunc));
3446 goto end;
3447 error:
3449 end:
3452}
#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(...)

◆ pymqmsgque_MqContextC_StorageOpen()

static OT_ProcRet pymqmsgque_MqContextC_StorageOpen ( MqContextC_ARGS )
static

Python: ctx.StorageOpen(storageFile:string) C-API
switch to a file-based-transaction-database

Definition at line 3455 of file MqContextC_py.c.

3455 {
3458 MK_STRN storageFile = 0;
3459 OT_CHECK_REQUIRED(OT_CHECK_STRN (storageFile))
3461 MkErrorC_Check(hdl,MqStorageOpen (hdl, storageFile));
3463 goto end;
3464 error:
3466 end:
3468}
#define StorageOpen_doc
#define MqStorageOpen(...)

◆ pymqmsgque_MqContextC_StorageResolve()

static OT_ProcRet pymqmsgque_MqContextC_StorageResolve ( MqContextC_ARGS )
static

Python: {otherCtxP:MqContextC otherLIdP:int32} ctx.StorageResolve() C-API
extract the context->link.protect.rmtTransLId entry from the database

Definition at line 3520 of file MqContextC_py.c.

3520 {
3524 MQ_CTX otherCtxP_out;
3525 MQ_LTR otherLIdP_out;
3526 MkErrorC_Check(hdl,MqStorageResolve (hdl, &otherCtxP_out, &otherLIdP_out));
3528 OT_retObj_APPEND(OT_TMP_CTX_OBJ(otherCtxP_out));
3529 OT_retObj_APPEND(OT_TMP_I32_OBJ(otherLIdP_out));
3530 goto end;
3531 error:
3533 end:
3535}
#define OT_retObj_SET_List
#define OT_TMP_I32_OBJ(val)
#define OT_retObj_APPEND(var)
#define OT_TMP_CTX_OBJ(val)
#define StorageResolve_doc
#define MqStorageResolve(...)
PUBLIC data structure for the pymqmsgque-specific-data