theLink 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
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 py_mqmsgque_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 py_mqmsgque_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 py_mqmsgque_MqContextC_StorageClose (MqContextC_ARGS)
  Python: ctx.StorageClose() C-API
close the storage. …
 
static OT_ProcRet py_mqmsgque_MqContextC_StorageDecrRef (MqContextC_ARGS)
  Python: ctx.StorageDecrRef(transLId:int32) C-API
decrease the internal refCount lock of the database-entry
 
static OT_ProcRet py_mqmsgque_MqContextC_StorageIncrRef (MqContextC_ARGS)
  Python: ctx.StorageIncrRef(transLId:int32) C-API
increase the internal refCount lock of the database-entry
 
static OT_ProcRet py_mqmsgque_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 py_mqmsgque_MqContextC_StorageOpen (MqContextC_ARGS)
  Python: ctx.StorageOpen(storageFile:string) C-API
switch to a file-based-transaction-database
 
static OT_ProcRet py_mqmsgque_MqContextC_StorageCount (MqContextC_ARGS)
  Python: int32 ctx.StorageCount() C-API
count the number of storage-rows
 
static OT_ProcRet py_mqmsgque_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 py_mqmsgque_MqContextC_StorageExport (MqContextC_ARGS)
  Python: int32 ctx.StorageExport() C-API
export the read-data-package into the STORAGE
 
static OT_ProcRet py_mqmsgque_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

◆ py_mqmsgque_MqContextC_StorageClose()

static OT_ProcRet py_mqmsgque_MqContextC_StorageClose ( MqContextC_ARGS )
static

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

Definition at line 3389 of file MqContextC_py.c.

3389 {
3391 OT_SETUP_NOARG(StorageClose_doc)
3392 OT_CHECK_NOARGS
3393 MkErrorC_Check(hdl,MqStorageClose (hdl));
3394 OT_retObj_SET_None
3395 goto end;
3396 error:
3397 OT_retObj_SET_Error
3398 end:
3400}
#define StorageClose_doc
#define OT_SETUP_hdl
#define OT_retObj_RETURN
#define error
#define MqStorageClose(...)

◆ py_mqmsgque_MqContextC_StorageCount()

static OT_ProcRet py_mqmsgque_MqContextC_StorageCount ( MqContextC_ARGS )
static

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

Definition at line 3471 of file MqContextC_py.c.

3471 {
3473 OT_SETUP_NOARG(StorageCount_doc)
3474 OT_CHECK_NOARGS
3475 MQ_LTR cnt_out;
3476 MkErrorC_Check(hdl,MqStorageCount (hdl, &cnt_out));
3477 OT_retObj_SET_I32(cnt_out)
3478 goto end;
3479 error:
3480 OT_retObj_SET_Error
3481 end:
3483}
#define StorageCount_doc
#define MqStorageCount(...)
int MQ_LTR
32bit longterm transaction token because PHP-32 does NOT support long long

◆ py_mqmsgque_MqContextC_StorageDecrRef()

static OT_ProcRet py_mqmsgque_MqContextC_StorageDecrRef ( MqContextC_ARGS )
static

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

Definition at line 3403 of file MqContextC_py.c.

3403 {
3405 OT_SETUP_ONEARG(StorageDecrRef_doc)
3406 MQ_LTR transLId = 0;
3407 OT_CHECK_REQUIRED(OT_CHECK_NI4 (transLId))
3408 OT_CHECK_NOARGS
3409 MkErrorC_Check(hdl,MqStorageDecrRef (hdl, transLId));
3410 OT_retObj_SET_None
3411 goto end;
3412 error:
3413 OT_retObj_SET_Error
3414 end:
3416}
#define StorageDecrRef_doc
#define MqStorageDecrRef(...)

◆ py_mqmsgque_MqContextC_StorageDelete()

static OT_ProcRet py_mqmsgque_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 3355 of file MqContextC_py.c.

3355 {
3357 OT_SETUP_VARARGS(0,1,StorageDelete_doc)
3358 MQ_LTR transLIdP_inout = 0;
3359 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3360 OT_CHECK_NOARGS
3361 MkErrorC_Check(hdl,MqStorageDelete (hdl, &transLIdP_inout));
3362 OT_retObj_SET_I32(transLIdP_inout)
3363 goto end;
3364 error:
3365 OT_retObj_SET_Error
3366 end:
3368}
#define StorageDelete_doc
#define MqStorageDelete(...)

◆ py_mqmsgque_MqContextC_StorageErrCnt()

static OT_ProcRet py_mqmsgque_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 3486 of file MqContextC_py.c.

3486 {
3488 OT_SETUP_ONEARG(StorageErrCnt_doc)
3489 MQ_LTR transLId = 0;
3490 OT_CHECK_REQUIRED(OT_CHECK_NI4 (transLId))
3491 OT_CHECK_NOARGS
3492 MK_I32 cnt_out;
3493 MkErrorC_Check(hdl,MqStorageErrCnt (hdl, transLId, &cnt_out));
3494 OT_retObj_SET_I32(cnt_out)
3495 goto end;
3496 error:
3497 OT_retObj_SET_Error
3498 end:
3500}
#define StorageErrCnt_doc
signed int MK_I32
#define MqStorageErrCnt(...)

◆ py_mqmsgque_MqContextC_StorageExport()

static OT_ProcRet py_mqmsgque_MqContextC_StorageExport ( MqContextC_ARGS )
static

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

Definition at line 3503 of file MqContextC_py.c.

3503 {
3505 OT_SETUP_NOARG(StorageExport_doc)
3506 OT_CHECK_NOARGS
3507 MQ_LTR ltid_out;
3508 MkErrorC_Check(hdl,MqStorageExport (hdl, &ltid_out));
3509 OT_retObj_SET_I32(ltid_out)
3510 goto end;
3511 error:
3512 OT_retObj_SET_Error
3513 end:
3515}
#define StorageExport_doc
#define MqStorageExport(...)

◆ py_mqmsgque_MqContextC_StorageImport()

static OT_ProcRet py_mqmsgque_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 3371 of file MqContextC_py.c.

3371 {
3373 OT_SETUP_VARARGS(0,1,StorageImport_doc)
3374 MQ_LTR transLIdP_inout = 0;
3375 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3376 OT_CHECK_NOARGS
3377 MkErrorC_Check(hdl,MqStorageImport (hdl, &transLIdP_inout));
3378 OT_retObj_SET_I32(transLIdP_inout)
3379 goto end;
3380 error:
3381 OT_retObj_SET_Error
3382 end:
3384}
#define StorageImport_doc
#define MqStorageImport(...)

◆ py_mqmsgque_MqContextC_StorageIncrRef()

static OT_ProcRet py_mqmsgque_MqContextC_StorageIncrRef ( MqContextC_ARGS )
static

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

Definition at line 3419 of file MqContextC_py.c.

3419 {
3421 OT_SETUP_ONEARG(StorageIncrRef_doc)
3422 MQ_LTR transLId = 0;
3423 OT_CHECK_REQUIRED(OT_CHECK_NI4 (transLId))
3424 OT_CHECK_NOARGS
3425 MkErrorC_Check(hdl,MqStorageIncrRef (hdl, transLId));
3426 OT_retObj_SET_None
3427 goto end;
3428 error:
3429 OT_retObj_SET_Error
3430 end:
3432}
#define StorageIncrRef_doc
#define MqStorageIncrRef(...)

◆ py_mqmsgque_MqContextC_StorageLog()

static OT_ProcRet py_mqmsgque_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 3435 of file MqContextC_py.c.

3435 {
3437 OT_SETUP_VARARGS(0,1,StorageLog_doc)
3438 MK_STRN callfunc = NULL;
3439 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
3440 OT_CHECK_NOARGS
3441 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
3442 OT_FRAME_CLEANUP;
3443 MkErrorC_Check(hdl,MqStorageLog (hdl, callfunc));
3444 OT_retObj_SET_None
3445 goto end;
3446 error:
3447 OT_retObj_SET_Error
3448 end:
3450}
#define StorageLog_doc
const MK_STRB * MK_STRN
bool MkSysStringIsNULL(MK_STRN str)
#define MqStorageLog(...)

◆ py_mqmsgque_MqContextC_StorageOpen()

static OT_ProcRet py_mqmsgque_MqContextC_StorageOpen ( MqContextC_ARGS )
static

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

Definition at line 3453 of file MqContextC_py.c.

3453 {
3455 OT_SETUP_ONEARG(StorageOpen_doc)
3456 MK_STRN storageFile = 0;
3457 OT_CHECK_REQUIRED(OT_CHECK_STRN (storageFile))
3458 OT_CHECK_NOARGS
3459 MkErrorC_Check(hdl,MqStorageOpen (hdl, storageFile));
3460 OT_retObj_SET_None
3461 goto end;
3462 error:
3463 OT_retObj_SET_Error
3464 end:
3466}
#define StorageOpen_doc
#define MqStorageOpen(...)

◆ py_mqmsgque_MqContextC_StorageResolve()

static OT_ProcRet py_mqmsgque_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 3518 of file MqContextC_py.c.

3518 {
3520 OT_SETUP_NOARG(StorageResolve_doc)
3521 OT_CHECK_NOARGS
3522 MQ_CTX otherCtxP_out;
3523 MQ_LTR otherLIdP_out;
3524 MkErrorC_Check(hdl,MqStorageResolve (hdl, &otherCtxP_out, &otherLIdP_out));
3525 OT_retObj_SET_List
3526 OT_retObj_APPEND(OT_TMP_CTX_OBJ(otherCtxP_out))
3527 OT_retObj_APPEND(OT_TMP_I32_OBJ(otherLIdP_out))
3528 goto end;
3529 error:
3530 OT_retObj_SET_Error
3531 end:
3533}
#define StorageResolve_doc
#define MqStorageResolve(...)
PUBLIC data structure for the pymqmsgque-specific-data