theLink 10.0
Loading...
Searching...
No Matches
MqContextC_StorageApi_CC_API

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

+ Collaboration diagram for MqContextC_StorageApi_CC_API:

Functions

MQ_LTR ccmqmsgque::MqContextC::StorageDelete (MQ_LTR *transLIdP_inout=0)
  C++: MQ_LTR ctx.StorageDelete(MQ_LTR *transLIdP_inout = 0) C-API
delete the storage-row identified by the transLIdP_inout
 
MQ_LTR ccmqmsgque::MqContextC::StorageImport (MQ_LTR *transLIdP_inout=0)
  C++: MQ_LTR ctx.StorageImport(MQ_LTR *transLIdP_inout = 0) C-API
import the storage-package into the read-data-package
 
void ccmqmsgque::MqContextC::StorageClose ()
  C++: ctx.StorageClose() C-API
close the storage. …
 
void ccmqmsgque::MqContextC::StorageDecrRef (MQ_LTR transLId)
  C++: ctx.StorageDecrRef(MQ_LTR transLId) C-API
decrease the internal refCount lock of the database-entry
 
void ccmqmsgque::MqContextC::StorageIncrRef (MQ_LTR transLId)
  C++: ctx.StorageIncrRef(MQ_LTR transLId) C-API
increase the internal refCount lock of the database-entry
 
void ccmqmsgque::MqContextC::StorageLog (MK_STRN callfunc=__builtin_FUNCTION())
  C++: ctx.StorageLog(MK_STRN callfunc = __builtin_FUNCTION()) C-API
log the storage the status of the open transactions
 
void ccmqmsgque::MqContextC::StorageOpen (MK_STRN storageFile)
  C++: ctx.StorageOpen(MK_STRN storageFile) C-API
switch to a file-based-transaction-database
 
void ccmqmsgque::MqContextC::StorageOpen (const std::string &storageFile)
  C++: ctx.StorageOpen(MK_STRN storageFile) C-API
switch to a file-based-transaction-database
 
MQ_LTR ccmqmsgque::MqContextC::StorageCount ()
  C++: MQ_LTR ctx.StorageCount() C-API
count the number of storage-rows
 
MK_I32 ccmqmsgque::MqContextC::StorageErrCnt (MQ_LTR transLId)
  C++: MK_I32 ctx.StorageErrCnt(MQ_LTR transLId) C-API
increment and return the database row-error-count for the row defined with transLId
 
MQ_LTR ccmqmsgque::MqContextC::StorageExport ()
  C++: MQ_LTR ctx.StorageExport() C-API
export the read-data-package into the STORAGE
 
std::tuple< MqContextC *, MQ_LTRccmqmsgque::MqContextC::StorageResolve ()
  C++: {otherCtxP:MqContextC* otherLIdP:MQ_LTR} 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

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

◆ StorageClose()

void ccmqmsgque::MqContextC::StorageClose ( )
inline

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

Definition at line 2244 of file MqContextC_inline_cc.hh.

2244 {
2245 MK_UNUSED auto ctx = getCTX();
2246 enum MkErrorE errVal = MqStorageClose(ctx);
2247 MkErrorC_Check(ctx, errVal);
2248 }
#define MK_UNUSED
MQ_CTX getCTX() const
return the LibMsgqueObject from current MqContextC instance
#define MqStorageClose(...)

◆ StorageCount()

MQ_LTR ccmqmsgque::MqContextC::StorageCount ( )
inline

C++: MQ_LTR ctx.StorageCount() C-API
count the number of storage-rows

Definition at line 2290 of file MqContextC_inline_cc.hh.

2290 {
2291 MK_UNUSED auto ctx = getCTX();
2292 MQ_LTR cnt_out;
2293 enum MkErrorE errVal = MqStorageCount(ctx, &cnt_out);
2294 MkErrorC_Check(ctx, errVal);
2295 return cnt_out;
2296 }
#define MqStorageCount(...)
int MQ_LTR
32bit longterm transaction token because PHP-32 does NOT support long long
+ Here is the caller graph for this function:

◆ StorageDecrRef()

void ccmqmsgque::MqContextC::StorageDecrRef ( MQ_LTR transLId)
inline

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

Definition at line 2251 of file MqContextC_inline_cc.hh.

2251 {
2252 MK_UNUSED auto ctx = getCTX();
2253 enum MkErrorE errVal = MqStorageDecrRef(ctx, transLId);
2254 MkErrorC_Check(ctx, errVal);
2255 }
#define MqStorageDecrRef(...)
+ Here is the caller graph for this function:

◆ StorageDelete()

MQ_LTR ccmqmsgque::MqContextC::StorageDelete ( MQ_LTR * transLIdP_inout = 0)
inline

C++: MQ_LTR ctx.StorageDelete(MQ_LTR *transLIdP_inout = 0) C-API
delete the storage-row identified by the transLIdP_inout

Definition at line 2222 of file MqContextC_inline_cc.hh.

2222 {
2223 MK_UNUSED auto ctx = getCTX();
2224 MQ_LTR transLIdP_inout_val = transLIdP_inout == NULL ? 0 : (MQ_LTR)(*transLIdP_inout);
2225 enum MkErrorE errVal = MqStorageDelete(ctx, &transLIdP_inout_val);
2226 if (transLIdP_inout != NULL) {*transLIdP_inout = (MQ_LTR)(transLIdP_inout_val);}
2227 MkErrorC_Check(ctx, errVal);
2228 return transLIdP_inout_val;
2229 }
#define MqStorageDelete(...)
+ Here is the caller graph for this function:

◆ StorageErrCnt()

MK_I32 ccmqmsgque::MqContextC::StorageErrCnt ( MQ_LTR transLId)
inline

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

Definition at line 2299 of file MqContextC_inline_cc.hh.

2299 {
2300 MK_UNUSED auto ctx = getCTX();
2301 MK_I32 cnt_out;
2302 enum MkErrorE errVal = MqStorageErrCnt(ctx, transLId, &cnt_out);
2303 MkErrorC_Check(ctx, errVal);
2304 return cnt_out;
2305 }
signed int MK_I32
#define MqStorageErrCnt(...)
+ Here is the caller graph for this function:

◆ StorageExport()

MQ_LTR ccmqmsgque::MqContextC::StorageExport ( )
inline

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

Definition at line 2308 of file MqContextC_inline_cc.hh.

2308 {
2309 MK_UNUSED auto ctx = getCTX();
2310 MQ_LTR ltid_out;
2311 enum MkErrorE errVal = MqStorageExport(ctx, &ltid_out);
2312 MkErrorC_Check(ctx, errVal);
2313 return ltid_out;
2314 }
#define MqStorageExport(...)
+ Here is the caller graph for this function:

◆ StorageImport()

MQ_LTR ccmqmsgque::MqContextC::StorageImport ( MQ_LTR * transLIdP_inout = 0)
inline

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

Definition at line 2232 of file MqContextC_inline_cc.hh.

2232 {
2233 MK_UNUSED auto ctx = getCTX();
2234 MQ_LTR transLIdP_inout_val = transLIdP_inout == NULL ? 0 : (MQ_LTR)(*transLIdP_inout);
2235 enum MkErrorE errVal = MqStorageImport(ctx, &transLIdP_inout_val);
2236 if (transLIdP_inout != NULL) {*transLIdP_inout = (MQ_LTR)(transLIdP_inout_val);}
2237 MkErrorC_Check(ctx, errVal);
2238 return transLIdP_inout_val;
2239 }
#define MqStorageImport(...)
+ Here is the caller graph for this function:

◆ StorageIncrRef()

void ccmqmsgque::MqContextC::StorageIncrRef ( MQ_LTR transLId)
inline

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

Definition at line 2258 of file MqContextC_inline_cc.hh.

2258 {
2259 MK_UNUSED auto ctx = getCTX();
2260 enum MkErrorE errVal = MqStorageIncrRef(ctx, transLId);
2261 MkErrorC_Check(ctx, errVal);
2262 }
#define MqStorageIncrRef(...)

◆ StorageLog()

void ccmqmsgque::MqContextC::StorageLog ( MK_STRN callfunc = __builtin_FUNCTION())
inline

C++: ctx.StorageLog(MK_STRN callfunc = __builtin_FUNCTION()) C-API
log the storage the status of the open transactions

Definition at line 2265 of file MqContextC_inline_cc.hh.

2265 {
2266 MK_UNUSED auto ctx = getCTX();
2267 if (callfunc == NULL) {callfunc = __builtin_FUNCTION();}
2268 enum MkErrorE errVal = MqStorageLog(ctx, callfunc);
2269 MkErrorC_Check(ctx, errVal);
2270 }
#define MqStorageLog(...)

◆ StorageOpen() [1/2]

void ccmqmsgque::MqContextC::StorageOpen ( const std::string & storageFile)
inline

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

Definition at line 2280 of file MqContextC_inline_cc.hh.

2280 {
2281 MK_UNUSED auto ctx = getCTX();
2282 const MK_STRN storageFile_hdl = storageFile.c_str();
2283 enum MkErrorE errVal = MqStorageOpen(ctx, storageFile_hdl);
2284 MkErrorC_Check(ctx, errVal);
2285 }
const MK_STRB * MK_STRN
#define MqStorageOpen(...)

◆ StorageOpen() [2/2]

void ccmqmsgque::MqContextC::StorageOpen ( MK_STRN storageFile)
inline

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

Definition at line 2273 of file MqContextC_inline_cc.hh.

2273 {
2274 MK_UNUSED auto ctx = getCTX();
2275 enum MkErrorE errVal = MqStorageOpen(ctx, storageFile);
2276 MkErrorC_Check(ctx, errVal);
2277 }

◆ StorageResolve()

std::tuple< MqContextC *, MQ_LTR > ccmqmsgque::MqContextC::StorageResolve ( )
inline

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

Definition at line 2317 of file MqContextC_inline_cc.hh.

2317 {
2318 MK_UNUSED auto ctx = getCTX();
2319 MQ_CTX otherCtxP_out;
2320 MQ_LTR otherLIdP_out;
2321 enum MkErrorE errVal = MqStorageResolve(ctx, &otherCtxP_out, &otherLIdP_out);
2322 MkErrorC_Check(ctx, errVal);
2323 std::tuple<MqContextC*,MQ_LTR> __retVal__L = {MqContextC::MqContextC_ObjNew(MK_RT_CALL otherCtxP_out),otherLIdP_out};
2324 return __retVal__L;
2325 }
#define MK_RT_CALL
static MqContextC * MqContextC_ObjNew(MK_RT_ARGS MQ_CTX hdl)
return MqContextC from LibMsgqueObject
struct MqContextS * MQ_CTX
class-shortcut for struct MqContextS *, all shortcut using the XX_YYY syntax (only for public API) …
#define MqStorageResolve(...)