theLink 10.0
Loading...
Searching...
No Matches
MqContextC_StorageApi_JV_API

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

+ Collaboration diagram for MqContextC_StorageApi_JV_API:

Functions

native int jvmqmsgque.MqContextC.StorageDelete (int transLIdP_inout)
  Java: int ctx.StorageDelete(?int transLIdP_inout = 0?) C-API
delete the storage-row identified by the transLIdP_inout
 
int jvmqmsgque.MqContextC.StorageDelete ()
  Java: int ctx.StorageDelete(?int transLIdP_inout = 0?) C-API
delete the storage-row identified by the transLIdP_inout
 
native int jvmqmsgque.MqContextC.StorageImport (int transLIdP_inout)
  Java: int ctx.StorageImport(?int transLIdP_inout = 0?) C-API
import the storage-package into the read-data-package
 
int jvmqmsgque.MqContextC.StorageImport ()
  Java: int ctx.StorageImport(?int transLIdP_inout = 0?) C-API
import the storage-package into the read-data-package
 
native void jvmqmsgque.MqContextC.StorageClose ()
  Java: ctx.StorageClose() C-API
close the storage. …
 
native void jvmqmsgque.MqContextC.StorageDecrRef (int transLId)
  Java: ctx.StorageDecrRef(int transLId) C-API
decrease the internal refCount lock of the database-entry
 
native void jvmqmsgque.MqContextC.StorageIncrRef (int transLId)
  Java: ctx.StorageIncrRef(int transLId) C-API
increase the internal refCount lock of the database-entry
 
native void jvmqmsgque.MqContextC.StorageLog (String callfunc)
  Java: ctx.StorageLog(?String callfunc = null?) C-API
log the storage the status of the open transactions
 
void jvmqmsgque.MqContextC.StorageLog ()
  Java: ctx.StorageLog(?String callfunc = null?) C-API
log the storage the status of the open transactions
 
native void jvmqmsgque.MqContextC.StorageOpen (String storageFile)
  Java: ctx.StorageOpen(String storageFile) C-API
switch to a file-based-transaction-database
 
native int jvmqmsgque.MqContextC.StorageCount ()
  Java: int ctx.StorageCount() C-API
count the number of storage-rows
 
native int jvmqmsgque.MqContextC.StorageErrCnt (int transLId)
  Java: int ctx.StorageErrCnt(int transLId) C-API
increment and return the database row-error-count for the row defined with transLId
 
native int jvmqmsgque.MqContextC.StorageExport ()
  Java: int ctx.StorageExport() C-API
export the read-data-package into the STORAGE
 
native String[] jvmqmsgque.MqContextC.StorageResolve ()
  Java: {otherCtxP:MqContextC otherLIdP:int} ctx.StorageResolve() C-API
extract the context->link.protect.rmtTransLId entry from the database
 
JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageDelete (JNIEnv *env, jobject self, jint transLIdP_inout)
  Java: int ctx.StorageDelete(?int transLIdP_inout = 0?) C-API
delete the storage-row identified by the transLIdP_inout
 
JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageImport (JNIEnv *env, jobject self, jint transLIdP_inout)
  Java: int ctx.StorageImport(?int transLIdP_inout = 0?) C-API
import the storage-package into the read-data-package
 
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageClose (JNIEnv *env, jobject self)
  Java: ctx.StorageClose() C-API
close the storage. …
 
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageDecrRef (JNIEnv *env, jobject self, jint transLId)
  Java: ctx.StorageDecrRef(int transLId) C-API
decrease the internal refCount lock of the database-entry
 
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageIncrRef (JNIEnv *env, jobject self, jint transLId)
  Java: ctx.StorageIncrRef(int transLId) C-API
increase the internal refCount lock of the database-entry
 
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageLog (JNIEnv *env, jobject self, jstring callfunc)
  Java: ctx.StorageLog(?String callfunc = null?) C-API
log the storage the status of the open transactions
 
JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageOpen (JNIEnv *env, jobject self, jstring storageFile)
  Java: ctx.StorageOpen(String storageFile) C-API
switch to a file-based-transaction-database
 
JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageCount (JNIEnv *env, jobject self)
  Java: int ctx.StorageCount() C-API
count the number of storage-rows
 
JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageErrCnt (JNIEnv *env, jobject self, jint transLId)
  Java: int ctx.StorageErrCnt(int transLId) C-API
increment and return the database row-error-count for the row defined with transLId
 
JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageExport (JNIEnv *env, jobject self)
  Java: int ctx.StorageExport() C-API
export the read-data-package into the STORAGE
 
JNIEXPORT jobjectArray JNICALL Java_jvmqmsgque_MqContextC_StorageResolve (JNIEnv *env, jobject self)
  Java: {otherCtxP:MqContextC otherLIdP:int} 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

◆ Java_jvmqmsgque_MqContextC_StorageClose()

JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageClose ( JNIEnv * env,
jobject self )

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

Definition at line 2535 of file MqContextC_jv.c.

2535 {
2536 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2537 JavaErrorCheck;
2538 MkRtSetup_X(hdl);
2539 enum MkErrorE errVal = MqStorageClose(hdl);
2540 MkErrorC_Check(hdl, errVal)
2541error:
2542 return;
2543}
MkErrorE
#define MkRtSetup_X(x)
struct MqContextS * MQ_CTX
class-shortcut for struct MqContextS *, all shortcut using the XX_YYY syntax (only for public API) …
#define MqStorageClose(...)
PUBLIC data structure for the jvmqmsgque-specific-data

◆ Java_jvmqmsgque_MqContextC_StorageCount()

JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageCount ( JNIEnv * env,
jobject self )

Java: int ctx.StorageCount() C-API
count the number of storage-rows

Definition at line 2602 of file MqContextC_jv.c.

2602 {
2603 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2604 JavaErrorCheck;
2605 MkRtSetup_X(hdl);
2606 MQ_LTR cnt_out;
2607 enum MkErrorE errVal = MqStorageCount(hdl, &cnt_out);
2608 MkErrorC_Check(hdl, errVal)
2609 jint __retVal__S = cnt_out;
2610 return __retVal__S;
2611error:
2612 return 0;
2613}
#define MqStorageCount(...)
int MQ_LTR
32bit longterm transaction token because PHP-32 does NOT support long long

◆ Java_jvmqmsgque_MqContextC_StorageDecrRef()

JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageDecrRef ( JNIEnv * env,
jobject self,
jint transLId )

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

Definition at line 2546 of file MqContextC_jv.c.

2546 {
2547 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2548 JavaErrorCheck;
2549 MkRtSetup_X(hdl);
2550 enum MkErrorE errVal = MqStorageDecrRef(hdl, transLId);
2551 MkErrorC_Check(hdl, errVal)
2552error:
2553 return;
2554}
#define MqStorageDecrRef(...)

◆ Java_jvmqmsgque_MqContextC_StorageDelete()

JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageDelete ( JNIEnv * env,
jobject self,
jint transLIdP_inout )

Java: int ctx.StorageDelete(?int transLIdP_inout = 0?) C-API
delete the storage-row identified by the transLIdP_inout

Definition at line 2507 of file MqContextC_jv.c.

2507 {
2508 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2509 JavaErrorCheck;
2510 MkRtSetup_X(hdl);
2511 enum MkErrorE errVal = MqStorageDelete(hdl, &transLIdP_inout);
2512 MkErrorC_Check(hdl, errVal)
2513 jint __retVal__S = transLIdP_inout;
2514 return __retVal__S;
2515error:
2516 return 0;
2517}
#define MqStorageDelete(...)

◆ Java_jvmqmsgque_MqContextC_StorageErrCnt()

JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageErrCnt ( JNIEnv * env,
jobject self,
jint transLId )

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

Definition at line 2616 of file MqContextC_jv.c.

2616 {
2617 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2618 JavaErrorCheck;
2619 MkRtSetup_X(hdl);
2620 MK_I32 cnt_out;
2621 enum MkErrorE errVal = MqStorageErrCnt(hdl, transLId, &cnt_out);
2622 MkErrorC_Check(hdl, errVal)
2623 jint __retVal__S = cnt_out;
2624 return __retVal__S;
2625error:
2626 return 0;
2627}
signed int MK_I32
#define MqStorageErrCnt(...)

◆ Java_jvmqmsgque_MqContextC_StorageExport()

JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageExport ( JNIEnv * env,
jobject self )

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

Definition at line 2630 of file MqContextC_jv.c.

2630 {
2631 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2632 JavaErrorCheck;
2633 MkRtSetup_X(hdl);
2634 MQ_LTR ltid_out;
2635 enum MkErrorE errVal = MqStorageExport(hdl, &ltid_out);
2636 MkErrorC_Check(hdl, errVal)
2637 jint __retVal__S = ltid_out;
2638 return __retVal__S;
2639error:
2640 return 0;
2641}
#define MqStorageExport(...)

◆ Java_jvmqmsgque_MqContextC_StorageImport()

JNIEXPORT jint JNICALL Java_jvmqmsgque_MqContextC_StorageImport ( JNIEnv * env,
jobject self,
jint transLIdP_inout )

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

Definition at line 2520 of file MqContextC_jv.c.

2520 {
2521 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2522 JavaErrorCheck;
2523 MkRtSetup_X(hdl);
2524 enum MkErrorE errVal = MqStorageImport(hdl, &transLIdP_inout);
2525 MkErrorC_Check(hdl, errVal)
2526 jint __retVal__S = transLIdP_inout;
2527 return __retVal__S;
2528error:
2529 return 0;
2530}
#define MqStorageImport(...)

◆ Java_jvmqmsgque_MqContextC_StorageIncrRef()

JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageIncrRef ( JNIEnv * env,
jobject self,
jint transLId )

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

Definition at line 2557 of file MqContextC_jv.c.

2557 {
2558 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2559 JavaErrorCheck;
2560 MkRtSetup_X(hdl);
2561 enum MkErrorE errVal = MqStorageIncrRef(hdl, transLId);
2562 MkErrorC_Check(hdl, errVal)
2563error:
2564 return;
2565}
#define MqStorageIncrRef(...)

◆ Java_jvmqmsgque_MqContextC_StorageLog()

JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageLog ( JNIEnv * env,
jobject self,
jstring callfunc )

Java: ctx.StorageLog(?String callfunc = null?) C-API
log the storage the status of the open transactions

Definition at line 2568 of file MqContextC_jv.c.

2568 {
2569 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2570 JavaErrorCheck;
2571 MkRtSetup_X(hdl);
2572 if (callfunc == NULL) {
2573 (*env)->CallStaticVoidMethod(env,MK(Class_MkKernel),MK(MID_MkKernel_getCallerStack));
2574 }
2575 if (callfunc == NULL) {callfunc = MK(pGetCallerProc)(env);}
2576 MK_STRN callfunc_ptr = (callfunc?(*env)->GetStringUTFChars(env,callfunc,NULL):NULL);
2577 JavaErrorCheck;
2578 enum MkErrorE errVal = MqStorageLog(hdl, callfunc_ptr);
2579 MkErrorC_Check(hdl, errVal)
2580 if (callfunc_ptr) (*env)->ReleaseStringUTFChars(env,callfunc,callfunc_ptr);
2581error:
2582 return;
2583}
const MK_STRB * MK_STRN
#define MqStorageLog(...)

◆ Java_jvmqmsgque_MqContextC_StorageOpen()

JNIEXPORT void JNICALL Java_jvmqmsgque_MqContextC_StorageOpen ( JNIEnv * env,
jobject self,
jstring storageFile )

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

Definition at line 2586 of file MqContextC_jv.c.

2586 {
2587 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2588 JavaErrorCheck;
2589 MkRtSetup_X(hdl);
2590 MK_STRN storageFile_ptr = (storageFile?(*env)->GetStringUTFChars(env,storageFile,NULL):NULL);
2591 JavaErrorCheck;
2592 enum MkErrorE errVal = MqStorageOpen(hdl, storageFile_ptr);
2593 MkErrorC_Check(hdl, errVal)
2594 if (storageFile_ptr) (*env)->ReleaseStringUTFChars(env,storageFile,storageFile_ptr);
2595error:
2596 return;
2597}
#define MqStorageOpen(...)

◆ Java_jvmqmsgque_MqContextC_StorageResolve()

JNIEXPORT jobjectArray JNICALL Java_jvmqmsgque_MqContextC_StorageResolve ( JNIEnv * env,
jobject self )

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

Definition at line 2644 of file MqContextC_jv.c.

2644 {
2645 MQ_CTX hdl = (MQ_CTX)pObj2Hdl(env,"MqContextC",self);
2646 JavaErrorCheck;
2647 MkRtSetup_X(hdl);
2648 MQ_CTX otherCtxP_out;
2649 MQ_LTR otherLIdP_out;
2650 enum MkErrorE errVal = MqStorageResolve(hdl, &otherCtxP_out, &otherLIdP_out);
2651 MkErrorC_Check(hdl, errVal)
2652 jobjectArray __retVal__L = (jobjectArray)(*env)->NewObjectArray(env,2,MK(Class_Object),NULL);
2653 (*env)->SetObjectArrayElement(env,__retVal__L,0,MQ(MqContextC_ObjNew)(MK_RT_CALL env,otherCtxP_out));
2654 (*env)->SetObjectArrayElement(env,__retVal__L,1,pNewIntObj(env,otherLIdP_out));
2655 jobjectArray __retVal__S = __retVal__L;
2656 return __retVal__S;
2657error:
2658 return 0;
2659}
#define MK_RT_CALL
#define MqStorageResolve(...)

◆ StorageClose()

native void jvmqmsgque.MqContextC.StorageClose ( )

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

◆ StorageCount()

native int jvmqmsgque.MqContextC.StorageCount ( )

Java: int ctx.StorageCount() C-API
count the number of storage-rows

◆ StorageDecrRef()

native void jvmqmsgque.MqContextC.StorageDecrRef ( int transLId)

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

◆ StorageDelete() [1/2]

int jvmqmsgque.MqContextC.StorageDelete ( )

Java: int ctx.StorageDelete(?int transLIdP_inout = 0?) C-API
delete the storage-row identified by the transLIdP_inout

Definition at line 1088 of file MqContextC.java.

1088 {
1089 return StorageDelete (0);
1090 }
int StorageDelete()
Java: int ctx.StorageDelete(?int transLIdP_inout = 0?) → C-API delete the storage-row identifie...
+ Here is the caller graph for this function:

◆ StorageDelete() [2/2]

native int jvmqmsgque.MqContextC.StorageDelete ( int transLIdP_inout)

Java: int ctx.StorageDelete(?int transLIdP_inout = 0?) C-API
delete the storage-row identified by the transLIdP_inout

◆ StorageErrCnt()

native int jvmqmsgque.MqContextC.StorageErrCnt ( int transLId)

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

◆ StorageExport()

native int jvmqmsgque.MqContextC.StorageExport ( )

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

◆ StorageImport() [1/2]

int jvmqmsgque.MqContextC.StorageImport ( )

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

Definition at line 1096 of file MqContextC.java.

1096 {
1097 return StorageImport (0);
1098 }
int StorageImport()
Java: int ctx.StorageImport(?int transLIdP_inout = 0?) → C-API import the storage-package into ...
+ Here is the caller graph for this function:

◆ StorageImport() [2/2]

native int jvmqmsgque.MqContextC.StorageImport ( int transLIdP_inout)

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

◆ StorageIncrRef()

native void jvmqmsgque.MqContextC.StorageIncrRef ( int transLId)

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

◆ StorageLog() [1/2]

void jvmqmsgque.MqContextC.StorageLog ( )

Java: ctx.StorageLog(?String callfunc = null?) C-API
log the storage the status of the open transactions

Definition at line 1115 of file MqContextC.java.

1115 {
1116 StorageLog (null);
1117 }
void StorageLog()
Java: ctx.StorageLog(?String callfunc = null?) → C-API log the storage the status of the open t...
+ Here is the caller graph for this function:

◆ StorageLog() [2/2]

native void jvmqmsgque.MqContextC.StorageLog ( String callfunc)

Java: ctx.StorageLog(?String callfunc = null?) C-API
log the storage the status of the open transactions

◆ StorageOpen()

native void jvmqmsgque.MqContextC.StorageOpen ( String storageFile)

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

◆ StorageResolve()

native String[] jvmqmsgque.MqContextC.StorageResolve ( )

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