theLink 10.0
Loading...
Searching...
No Matches
MqContextC_StorageApi_TCL_API

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

+ Collaboration diagram for MqContextC_StorageApi_TCL_API:

Functions

static OT_ProcRet tclmqmsgque_MqContextC_StorageDelete (MqContextC_ARGS)
  Tcl: int32 [$ctx StorageDelete ?*transLIdP_inout:int32=0?] C-API
delete the storage-row identified by the transLIdP_inout
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageImport (MqContextC_ARGS)
  Tcl: int32 [$ctx StorageImport ?*transLIdP_inout:int32=0?] C-API
import the storage-package into the read-data-package
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageClose (MqContextC_ARGS)
  Tcl: $ctx StorageClose C-API
close the storage. …
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageDecrRef (MqContextC_ARGS)
  Tcl: $ctx StorageDecrRef transLId:int32 C-API
decrease the internal refCount lock of the database-entry
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageIncrRef (MqContextC_ARGS)
  Tcl: $ctx StorageIncrRef transLId:int32 C-API
increase the internal refCount lock of the database-entry
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageLog (MqContextC_ARGS)
  Tcl: $ctx StorageLog ?callfunc:string="MK_NULL"? C-API
log the storage the status of the open transactions
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageOpen (MqContextC_ARGS)
  Tcl: $ctx StorageOpen storageFile:string C-API
switch to a file-based-transaction-database
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageCount (MqContextC_ARGS)
  Tcl: int32 [$ctx StorageCount] C-API
count the number of storage-rows
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageErrCnt (MqContextC_ARGS)
  Tcl: int32 [$ctx StorageErrCnt transLId:int32] C-API
increment and return the database row-error-count for the row defined with transLId
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageExport (MqContextC_ARGS)
  Tcl: int32 [$ctx StorageExport] C-API
export the read-data-package into the STORAGE
 
static OT_ProcRet tclmqmsgque_MqContextC_StorageResolve (MqContextC_ARGS)
  Tcl: {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

◆ tclmqmsgque_MqContextC_StorageClose()

static OT_ProcRet tclmqmsgque_MqContextC_StorageClose ( MqContextC_ARGS )
static

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

Definition at line 3444 of file MqContextC_tcl.c.

3444 {
3448 MkErrorC_Check(hdl,MqStorageClose (hdl));
3450 goto end;
3451 error:
3453 end:
3455}
#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(...)

◆ tclmqmsgque_MqContextC_StorageCount()

static OT_ProcRet tclmqmsgque_MqContextC_StorageCount ( MqContextC_ARGS )
static

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

Definition at line 3526 of file MqContextC_tcl.c.

3526 {
3530 MQ_LTR cnt_out;
3531 MkErrorC_Check(hdl,MqStorageCount (hdl, &cnt_out));
3532 OT_retObj_SET_I32(cnt_out);
3533 goto end;
3534 error:
3536 end:
3538}
#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

◆ tclmqmsgque_MqContextC_StorageDecrRef()

static OT_ProcRet tclmqmsgque_MqContextC_StorageDecrRef ( MqContextC_ARGS )
static

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

Definition at line 3458 of file MqContextC_tcl.c.

3458 {
3461 MQ_LTR transLId = 0;
3464 MkErrorC_Check(hdl,MqStorageDecrRef (hdl, transLId));
3466 goto end;
3467 error:
3469 end:
3471}
#define OT_SETUP_ONEARG(d)
#define OT_CHECK_NI4(val)
#define OT_CHECK_REQUIRED(val)
#define StorageDecrRef_doc
#define MqStorageDecrRef(...)

◆ tclmqmsgque_MqContextC_StorageDelete()

static OT_ProcRet tclmqmsgque_MqContextC_StorageDelete ( MqContextC_ARGS )
static

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

Definition at line 3410 of file MqContextC_tcl.c.

3410 {
3413 MQ_LTR transLIdP_inout = 0;
3414 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3416 MkErrorC_Check(hdl,MqStorageDelete (hdl, &transLIdP_inout));
3417 OT_retObj_SET_I32(transLIdP_inout);
3418 goto end;
3419 error:
3421 end:
3423}
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_OPTIONAL(val)
#define StorageDelete_doc
#define MqStorageDelete(...)

◆ tclmqmsgque_MqContextC_StorageErrCnt()

static OT_ProcRet tclmqmsgque_MqContextC_StorageErrCnt ( MqContextC_ARGS )
static

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

Definition at line 3541 of file MqContextC_tcl.c.

3541 {
3544 MQ_LTR transLId = 0;
3547 MK_I32 cnt_out;
3548 MkErrorC_Check(hdl,MqStorageErrCnt (hdl, transLId, &cnt_out));
3549 OT_retObj_SET_I32(cnt_out);
3550 goto end;
3551 error:
3553 end:
3555}
#define StorageErrCnt_doc
signed int MK_I32
#define MqStorageErrCnt(...)

◆ tclmqmsgque_MqContextC_StorageExport()

static OT_ProcRet tclmqmsgque_MqContextC_StorageExport ( MqContextC_ARGS )
static

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

Definition at line 3558 of file MqContextC_tcl.c.

3558 {
3562 MQ_LTR ltid_out;
3563 MkErrorC_Check(hdl,MqStorageExport (hdl, &ltid_out));
3564 OT_retObj_SET_I32(ltid_out);
3565 goto end;
3566 error:
3568 end:
3570}
#define StorageExport_doc
#define MqStorageExport(...)

◆ tclmqmsgque_MqContextC_StorageImport()

static OT_ProcRet tclmqmsgque_MqContextC_StorageImport ( MqContextC_ARGS )
static

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

Definition at line 3426 of file MqContextC_tcl.c.

3426 {
3429 MQ_LTR transLIdP_inout = 0;
3430 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (transLIdP_inout))
3432 MkErrorC_Check(hdl,MqStorageImport (hdl, &transLIdP_inout));
3433 OT_retObj_SET_I32(transLIdP_inout);
3434 goto end;
3435 error:
3437 end:
3439}
#define StorageImport_doc
#define MqStorageImport(...)

◆ tclmqmsgque_MqContextC_StorageIncrRef()

static OT_ProcRet tclmqmsgque_MqContextC_StorageIncrRef ( MqContextC_ARGS )
static

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

Definition at line 3474 of file MqContextC_tcl.c.

3474 {
3477 MQ_LTR transLId = 0;
3480 MkErrorC_Check(hdl,MqStorageIncrRef (hdl, transLId));
3482 goto end;
3483 error:
3485 end:
3487}
#define StorageIncrRef_doc
#define MqStorageIncrRef(...)

◆ tclmqmsgque_MqContextC_StorageLog()

static OT_ProcRet tclmqmsgque_MqContextC_StorageLog ( MqContextC_ARGS )
static

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

Definition at line 3490 of file MqContextC_tcl.c.

3490 {
3493 MK_STRN callfunc = NULL;
3496 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
3497 MkErrorC_Check(hdl,MqStorageLog (hdl, callfunc));
3499 goto end;
3500 error:
3502 end:
3505}
#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(...)

◆ tclmqmsgque_MqContextC_StorageOpen()

static OT_ProcRet tclmqmsgque_MqContextC_StorageOpen ( MqContextC_ARGS )
static

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

Definition at line 3508 of file MqContextC_tcl.c.

3508 {
3511 MK_STRN storageFile = 0;
3512 OT_CHECK_REQUIRED(OT_CHECK_STRN (storageFile))
3514 MkErrorC_Check(hdl,MqStorageOpen (hdl, storageFile));
3516 goto end;
3517 error:
3519 end:
3521}
#define StorageOpen_doc
#define MqStorageOpen(...)

◆ tclmqmsgque_MqContextC_StorageResolve()

static OT_ProcRet tclmqmsgque_MqContextC_StorageResolve ( MqContextC_ARGS )
static

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

Definition at line 3573 of file MqContextC_tcl.c.

3573 {
3577 MQ_CTX otherCtxP_out;
3578 MQ_LTR otherLIdP_out;
3579 MkErrorC_Check(hdl,MqStorageResolve (hdl, &otherCtxP_out, &otherLIdP_out));
3581 OT_retObj_APPEND(OT_TMP_CTX_OBJ(otherCtxP_out));
3582 OT_retObj_APPEND(OT_TMP_I32_OBJ(otherLIdP_out));
3583 goto end;
3584 error:
3586 end:
3588}
#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 tclmqmsgque-specific-data