Added dbRebuild method to DbSystem class.
git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@751 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
@@ -78,16 +78,6 @@ static jfieldID LockUser_fidTime = NULL;
|
||||
#define THIS_FDB() \
|
||||
((IF_Db *)(FLMUINT)lThis)
|
||||
|
||||
FSTATIC RCODE getUniString(
|
||||
JNIEnv * pEnv,
|
||||
jstring sStr,
|
||||
F_DynaBuf * pDynaBuf);
|
||||
|
||||
FSTATIC RCODE getUTF8String(
|
||||
JNIEnv * pEnv,
|
||||
jstring sStr,
|
||||
F_DynaBuf * pDynaBuf);
|
||||
|
||||
FSTATIC RCODE getDictName(
|
||||
IF_Db * pDb,
|
||||
FLMUINT uiDictType,
|
||||
@@ -1174,7 +1164,7 @@ Exit:
|
||||
/****************************************************************************
|
||||
Desc:
|
||||
****************************************************************************/
|
||||
FSTATIC RCODE getUniString(
|
||||
RCODE getUniString(
|
||||
JNIEnv * pEnv,
|
||||
jstring sStr,
|
||||
F_DynaBuf * pDynaBuf)
|
||||
@@ -1215,7 +1205,7 @@ Exit:
|
||||
/****************************************************************************
|
||||
Desc:
|
||||
****************************************************************************/
|
||||
FSTATIC RCODE getUTF8String(
|
||||
RCODE getUTF8String(
|
||||
JNIEnv * pEnv,
|
||||
jstring sStr,
|
||||
F_DynaBuf * pDynaBuf)
|
||||
|
||||
@@ -31,7 +31,22 @@
|
||||
|
||||
#define THIS_DBSYS() \
|
||||
((F_DbSystem *)(FLMUINT)lThis)
|
||||
|
||||
// Field IDs for the CREATEOPTS class.
|
||||
|
||||
static jfieldID CREATEOPTS_fidBlockSize = NULL;
|
||||
static jfieldID CREATEOPTS_fidVersionNum = NULL;
|
||||
static jfieldID CREATEOPTS_fidMinRflFileSize = NULL;
|
||||
static jfieldID CREATEOPTS_fidMaxRflFileSize = NULL;
|
||||
static jfieldID CREATEOPTS_fidKeepRflFiles = NULL;
|
||||
static jfieldID CREATEOPTS_fidLogAbortedTransToRfl = NULL;
|
||||
static jfieldID CREATEOPTS_fidDefaultLanguage = NULL;
|
||||
|
||||
FSTATIC void getCreateOpts(
|
||||
JNIEnv * pEnv,
|
||||
jobject createOpts,
|
||||
XFLM_CREATE_OPTS * pCreateOpts);
|
||||
|
||||
/****************************************************************************
|
||||
Desc:
|
||||
****************************************************************************/
|
||||
@@ -49,6 +64,81 @@ JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1createDbSystem(
|
||||
return( (jlong)(FLMUINT)pDbSystem);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Desc:
|
||||
****************************************************************************/
|
||||
JNIEXPORT void JNICALL Java_xflaim_CREATEOPTS_initIDs(
|
||||
JNIEnv * pEnv,
|
||||
jclass jCREATEOPTSClass)
|
||||
{
|
||||
|
||||
// Get the field IDs for the fields in the class.
|
||||
|
||||
if ((CREATEOPTS_fidBlockSize = pEnv->GetFieldID( jCREATEOPTSClass,
|
||||
"iBlockSize", "I")) == NULL)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
if ((CREATEOPTS_fidVersionNum = pEnv->GetFieldID( jCREATEOPTSClass,
|
||||
"iVersionNum", "I")) == NULL)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
if ((CREATEOPTS_fidMinRflFileSize = pEnv->GetFieldID( jCREATEOPTSClass,
|
||||
"iMinRflFileSize", "I")) == NULL)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
if ((CREATEOPTS_fidMaxRflFileSize = pEnv->GetFieldID( jCREATEOPTSClass,
|
||||
"iMaxRflFileSize", "I")) == NULL)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
if ((CREATEOPTS_fidKeepRflFiles = pEnv->GetFieldID( jCREATEOPTSClass,
|
||||
"bKeepRflFiles", "Z")) == NULL)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
if ((CREATEOPTS_fidLogAbortedTransToRfl = pEnv->GetFieldID( jCREATEOPTSClass,
|
||||
"bLogAbortedTransToRfl", "Z")) == NULL)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
if ((CREATEOPTS_fidDefaultLanguage = pEnv->GetFieldID( jCREATEOPTSClass,
|
||||
"iDefaultLanguage", "I")) == NULL)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Exit:
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Desc: Get create options from the CREATEOPTS Java object.
|
||||
****************************************************************************/
|
||||
FSTATIC void getCreateOpts(
|
||||
JNIEnv * pEnv,
|
||||
jobject createOpts,
|
||||
XFLM_CREATE_OPTS * pCreateOpts)
|
||||
{
|
||||
pCreateOpts->uiBlockSize = (FLMUINT)pEnv->GetIntField( createOpts,
|
||||
CREATEOPTS_fidBlockSize);
|
||||
pCreateOpts->uiVersionNum = (FLMUINT)pEnv->GetIntField( createOpts,
|
||||
CREATEOPTS_fidVersionNum);
|
||||
pCreateOpts->uiMinRflFileSize = (FLMUINT)pEnv->GetIntField( createOpts,
|
||||
CREATEOPTS_fidMinRflFileSize);
|
||||
pCreateOpts->uiMaxRflFileSize = (FLMUINT)pEnv->GetIntField( createOpts,
|
||||
CREATEOPTS_fidMaxRflFileSize);
|
||||
pCreateOpts->bKeepRflFiles = (FLMBOOL)(pEnv->GetBooleanField( createOpts,
|
||||
CREATEOPTS_fidKeepRflFiles) ? TRUE : FALSE);
|
||||
pCreateOpts->bLogAbortedTransToRfl = (FLMBOOL)(pEnv->GetBooleanField( createOpts,
|
||||
CREATEOPTS_fidLogAbortedTransToRfl) ? TRUE : FALSE);
|
||||
pCreateOpts->uiDefaultLanguage = (FLMUINT)pEnv->GetIntField( createOpts,
|
||||
CREATEOPTS_fidDefaultLanguage);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Desc:
|
||||
****************************************************************************/
|
||||
@@ -66,7 +156,7 @@ JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1dbCreate(
|
||||
RCODE rc = NE_XFLM_OK;
|
||||
F_Db * pDb = NULL;
|
||||
XFLM_CREATE_OPTS Opts;
|
||||
XFLM_CREATE_OPTS * pOpts = &Opts;
|
||||
XFLM_CREATE_OPTS * pOpts;
|
||||
char * pszFilePath = NULL;
|
||||
char * pszDataDir = NULL;
|
||||
char * pszRflDir = NULL;
|
||||
@@ -102,32 +192,8 @@ JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1dbCreate(
|
||||
}
|
||||
else
|
||||
{
|
||||
jclass class_CREATEOPTS = pEnv->FindClass( "xflaim/CREATEOPTS");
|
||||
|
||||
Opts.uiBlockSize = pEnv->GetIntField( CreateOpts,
|
||||
pEnv->GetFieldID( class_CREATEOPTS, "iBlockSize", "I"));
|
||||
|
||||
Opts.uiVersionNum = pEnv->GetIntField( CreateOpts,
|
||||
pEnv->GetFieldID( class_CREATEOPTS, "iVersionNum", "I"));
|
||||
|
||||
Opts.uiMinRflFileSize = pEnv->GetIntField( CreateOpts,
|
||||
pEnv->GetFieldID( class_CREATEOPTS, "iMinRflFileSize", "I"));
|
||||
|
||||
Opts.uiMaxRflFileSize = pEnv->GetIntField( CreateOpts,
|
||||
pEnv->GetFieldID( class_CREATEOPTS, "iMaxRflFileSize", "I"));
|
||||
|
||||
Opts.bKeepRflFiles = pEnv->GetBooleanField( CreateOpts,
|
||||
pEnv->GetFieldID( class_CREATEOPTS, "bKeepRflFiles", "Z"))
|
||||
? TRUE
|
||||
: FALSE;
|
||||
|
||||
Opts.bLogAbortedTransToRfl = pEnv->GetBooleanField( CreateOpts,
|
||||
pEnv->GetFieldID( class_CREATEOPTS, "bLogAbortedTransToRfl", "Z"))
|
||||
? TRUE
|
||||
: FALSE;
|
||||
|
||||
Opts.uiDefaultLanguage = pEnv->GetIntField( CreateOpts,
|
||||
pEnv->GetFieldID( class_CREATEOPTS, "iDefaultLanguage", "I"));
|
||||
getCreateOpts( pEnv, CreateOpts, &Opts);
|
||||
pOpts = &Opts;
|
||||
}
|
||||
|
||||
if (RC_BAD( rc = THIS_DBSYS()->dbCreate( pszFilePath, pszDataDir,
|
||||
@@ -721,3 +787,228 @@ Exit:
|
||||
|
||||
return( (jlong)(FLMUINT)ifpDataVector);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Desc: Rebuild status callback
|
||||
****************************************************************************/
|
||||
class JavaDbRebuildStatus : public IF_DbRebuildStatus
|
||||
{
|
||||
public:
|
||||
|
||||
JavaDbRebuildStatus(
|
||||
JNIEnv * pEnv,
|
||||
jobject jDbRebuildStatusObject)
|
||||
{
|
||||
m_pEnv = pEnv;
|
||||
|
||||
// Get a global reference to keep the object from being garbage
|
||||
// collected, and to allow it to be called across invocations into
|
||||
// the native interface. Otherwise, the reference will be lost and
|
||||
// cannot be used by the callback function.
|
||||
|
||||
m_jDbRebuildStatusObject = pEnv->NewGlobalRef( jDbRebuildStatusObject);
|
||||
m_jReportRebuildMethodId = pEnv->GetMethodID( pEnv->GetObjectClass( jDbRebuildStatusObject),
|
||||
"reportRebuild",
|
||||
"(IVLLLLL)I");
|
||||
m_jReportRebuildErrMethodId = pEnv->GetMethodID( pEnv->GetObjectClass( jDbRebuildStatusObject),
|
||||
"reportRebuildErr",
|
||||
"(IIIIIIIIL)I");
|
||||
}
|
||||
|
||||
virtual ~JavaDbRebuildStatus()
|
||||
{
|
||||
if (m_jDbRebuildStatusObject)
|
||||
{
|
||||
m_pEnv->DeleteGlobalRef( m_jDbRebuildStatusObject);
|
||||
}
|
||||
}
|
||||
|
||||
RCODE FLMAPI reportRebuild(
|
||||
XFLM_REBUILD_INFO * pRebuild)
|
||||
{
|
||||
|
||||
// VERY IMPORTANT NOTE! m_pEnv points to the environment that was
|
||||
// passed in when this object was set up. It is thread-specific, so
|
||||
// it is important that the callback happen inside the same thread
|
||||
// where the setIndexingStatusObject method was called. It will not
|
||||
// work to set the index status object in one thread, but then do
|
||||
// the index operation in another thread.
|
||||
|
||||
return( (RCODE)m_pEnv->CallIntMethod( m_jDbRebuildStatusObject,
|
||||
m_jReportRebuildMethodId,
|
||||
(jint)pRebuild->iDoingFlag,
|
||||
(jboolean)(pRebuild->bStartFlag ? JNI_TRUE : JNI_FALSE),
|
||||
(jlong)pRebuild->ui64FileSize,
|
||||
(jlong)pRebuild->ui64BytesExamined,
|
||||
(jlong)pRebuild->ui64TotNodes,
|
||||
(jlong)pRebuild->ui64NodesRecov,
|
||||
(jlong)pRebuild->ui64DiscardedDocs));
|
||||
}
|
||||
|
||||
RCODE FLMAPI reportRebuildErr(
|
||||
XFLM_CORRUPT_INFO * pCorruptInfo)
|
||||
{
|
||||
return( (RCODE)m_pEnv->CallIntMethod( m_jDbRebuildStatusObject,
|
||||
m_jReportRebuildErrMethodId,
|
||||
(jint)pCorruptInfo->iErrCode,
|
||||
(jint)pCorruptInfo->uiErrLocale,
|
||||
(jint)pCorruptInfo->uiErrLfNumber,
|
||||
(jint)pCorruptInfo->uiErrLfType,
|
||||
(jint)pCorruptInfo->uiErrBTreeLevel,
|
||||
(jint)pCorruptInfo->uiErrBlkAddress,
|
||||
(jint)pCorruptInfo->uiErrParentBlkAddress,
|
||||
(jint)pCorruptInfo->uiErrElmOffset,
|
||||
(jlong)pCorruptInfo->ui64ErrNodeId));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
JNIEnv * m_pEnv;
|
||||
jobject m_jDbRebuildStatusObject;
|
||||
jmethodID m_jReportRebuildMethodId;
|
||||
jmethodID m_jReportRebuildErrMethodId;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
Desc:
|
||||
****************************************************************************/
|
||||
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1dbRebuild(
|
||||
JNIEnv * pEnv,
|
||||
jobject, // obj,
|
||||
jlong lThis,
|
||||
jstring sSourceDbPath,
|
||||
jstring sSourceDataDir,
|
||||
jstring sDestDbPath,
|
||||
jstring sDestDataDir,
|
||||
jstring sDestRflDir,
|
||||
jstring sDictPath,
|
||||
jstring sPassword,
|
||||
jobject createOpts,
|
||||
jobject jDbRebuildStatusObj)
|
||||
{
|
||||
RCODE rc = NE_XFLM_OK;
|
||||
JavaDbRebuildStatus * pDbRebuildStatusObj = NULL;
|
||||
F_DbSystem * pDbSystem = THIS_DBSYS();
|
||||
XFLM_CREATE_OPTS createOptions;
|
||||
XFLM_CREATE_OPTS * pCreateOptions;
|
||||
FLMUINT64 ui64TotNodes;
|
||||
FLMUINT64 ui64NodesRecov;
|
||||
FLMUINT64 ui64DiscardedDocs;
|
||||
FLMBYTE ucSourceDbPath [F_PATH_MAX_SIZE];
|
||||
F_DynaBuf sourceDbPathBuf( ucSourceDbPath, sizeof( ucSourceDbPath));
|
||||
FLMBYTE ucSourceDataDir [F_PATH_MAX_SIZE];
|
||||
F_DynaBuf sourceDataDirBuf( ucSourceDataDir, sizeof( ucSourceDataDir));
|
||||
FLMBYTE ucDestDbPath [F_PATH_MAX_SIZE];
|
||||
F_DynaBuf destDbPathBuf( ucDestDbPath, sizeof( ucDestDbPath));
|
||||
FLMBYTE ucDestDataDir [F_PATH_MAX_SIZE];
|
||||
F_DynaBuf destDataDirBuf( ucDestDataDir, sizeof( ucDestDataDir));
|
||||
FLMBYTE ucDestRflDir [F_PATH_MAX_SIZE];
|
||||
F_DynaBuf destRflDirBuf( ucDestRflDir, sizeof( ucDestRflDir));
|
||||
FLMBYTE ucDictPath [F_PATH_MAX_SIZE];
|
||||
F_DynaBuf dictPathBuf( ucDictPath, sizeof( ucDictPath));
|
||||
FLMBYTE ucPassword [100];
|
||||
F_DynaBuf passwordBuf( ucPassword, sizeof( ucPassword));
|
||||
|
||||
// Get all of the string parameters into buffers.
|
||||
|
||||
if (RC_BAD( rc = getUTF8String( pEnv, sSourceDbPath, &sourceDbPathBuf)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
if (RC_BAD( rc = getUTF8String( pEnv, sSourceDataDir, &sourceDataDirBuf)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
if (RC_BAD( rc = getUTF8String( pEnv, sDestDbPath, &destDbPathBuf)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
if (RC_BAD( rc = getUTF8String( pEnv, sDestDataDir, &destDataDirBuf)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
if (RC_BAD( rc = getUTF8String( pEnv, sDestRflDir, &destRflDirBuf)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
if (RC_BAD( rc = getUTF8String( pEnv, sDictPath, &dictPathBuf)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
if (RC_BAD( rc = getUTF8String( pEnv, sPassword, &passwordBuf)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Setup callback object, if one was passed in
|
||||
|
||||
if (jDbRebuildStatusObj)
|
||||
{
|
||||
if ((pDbRebuildStatusObj = f_new JavaDbRebuildStatus( pEnv,
|
||||
jDbRebuildStatusObj)) == NULL)
|
||||
{
|
||||
rc = RC_SET( NE_XFLM_MEM);
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the create options.
|
||||
|
||||
if (!createOpts)
|
||||
{
|
||||
pCreateOptions = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
getCreateOpts( pEnv, createOpts, &createOptions);
|
||||
pCreateOptions = &createOptions;
|
||||
}
|
||||
|
||||
// Call the rebuild function.
|
||||
|
||||
if (RC_BAD( rc = pDbSystem->dbRebuild(
|
||||
(const char *)sourceDbPathBuf.getBufferPtr(),
|
||||
sourceDataDirBuf.getDataLength() > 1
|
||||
? (const char *)sourceDataDirBuf.getBufferPtr()
|
||||
: (const char *)NULL,
|
||||
(const char *)destDbPathBuf.getBufferPtr(),
|
||||
destDataDirBuf.getDataLength() > 1
|
||||
? (const char *)destDataDirBuf.getBufferPtr()
|
||||
: (const char *)NULL,
|
||||
destRflDirBuf.getDataLength() > 1
|
||||
? (const char *)destRflDirBuf.getBufferPtr()
|
||||
: (const char *)NULL,
|
||||
dictPathBuf.getDataLength() > 1
|
||||
? (const char *)dictPathBuf.getBufferPtr()
|
||||
: (const char *)NULL,
|
||||
passwordBuf.getDataLength() > 1
|
||||
? (const char *)passwordBuf.getBufferPtr()
|
||||
: (const char *)NULL,
|
||||
pCreateOptions,
|
||||
&ui64TotNodes,
|
||||
&ui64NodesRecov,
|
||||
&ui64DiscardedDocs,
|
||||
pDbRebuildStatusObj)))
|
||||
{
|
||||
ThrowError( rc, pEnv);
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Exit:
|
||||
|
||||
if (pDbRebuildStatusObj)
|
||||
{
|
||||
pDbRebuildStatusObj->Release();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,4 +38,14 @@
|
||||
RCODE rc,
|
||||
JNIEnv * pEnv);
|
||||
|
||||
RCODE getUniString(
|
||||
JNIEnv * pEnv,
|
||||
jstring sStr,
|
||||
F_DynaBuf * pDynaBuf);
|
||||
|
||||
RCODE getUTF8String(
|
||||
JNIEnv * pEnv,
|
||||
jstring sStr,
|
||||
F_DynaBuf * pDynaBuf);
|
||||
|
||||
#endif // JNIFTK_H
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: xflaim_CREATEOPTS
|
||||
* Method: initIDs
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_xflaim_CREATEOPTS_initIDs
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -111,6 +111,14 @@ JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1openFileIStream
|
||||
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1createJDataVector
|
||||
(JNIEnv *, jobject, jlong);
|
||||
|
||||
/*
|
||||
* Class: xflaim_DbSystem
|
||||
* Method: _dbRebuild
|
||||
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lxflaim/CREATEOPTS;Lxflaim/RebuildStatus;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1dbRebuild
|
||||
(JNIEnv *, jobject, jlong, jstring, jstring, jstring, jstring, jstring, jstring, jstring, jobject, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
13
xflaim/java/jni/xflaim_RebuildStatus.h
Normal file
13
xflaim/java/jni/xflaim_RebuildStatus.h
Normal file
@@ -0,0 +1,13 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class xflaim_RebuildStatus */
|
||||
|
||||
#ifndef _Included_xflaim_RebuildStatus
|
||||
#define _Included_xflaim_RebuildStatus
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -48,4 +48,5 @@ public final class CREATEOPTS
|
||||
bLogAbortedTransToRfl = false;
|
||||
iDefaultLanguage = 0;
|
||||
}
|
||||
private static native void initIDs();
|
||||
}
|
||||
|
||||
@@ -365,24 +365,28 @@ public class DbSystem
|
||||
bOverwriteDestOk, Status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
public void dbRebuild(
|
||||
String sSourceDbPath,
|
||||
String sSourceDataDir,
|
||||
String sDestDbPath,
|
||||
String sDestDataDir,
|
||||
String sDestRflDir,
|
||||
String sDictPath,
|
||||
String sPassword,
|
||||
CREATEOPTS createOpts,
|
||||
RebuildStatus rebuildStatus) throws XFlaimException
|
||||
{
|
||||
_dbRebuild( m_this, sSourceDbPath, sSourceDataDir, sDestDbPath,
|
||||
sDestDataDir, sDestRflDir, sDictPath, sPassword,
|
||||
createOpts, rebuildStatus);
|
||||
}
|
||||
|
||||
private native long _createDbSystem();
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native void _init( long lThis);
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native void _exit( long lThis);
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native long _dbCreate(
|
||||
long lThis,
|
||||
String DbFileName,
|
||||
@@ -400,9 +404,6 @@ public class DbSystem
|
||||
String Password,
|
||||
boolean bAllowLimited);
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native void _dbRemove(
|
||||
long lThis,
|
||||
String DbFileName,
|
||||
@@ -410,9 +411,6 @@ public class DbSystem
|
||||
String RflDir,
|
||||
boolean bRemoveRflFiles);
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native long _dbCheck(
|
||||
long lThis,
|
||||
String sDbFileName,
|
||||
@@ -422,9 +420,6 @@ public class DbSystem
|
||||
int iFlags,
|
||||
DbCheckStatus Status) throws XFlaimException;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native void _dbCopy(
|
||||
long lThis,
|
||||
String sSrcDbName,
|
||||
@@ -435,9 +430,6 @@ public class DbSystem
|
||||
String sDestRflDir,
|
||||
DbCopyStatus Status) throws XFlaimException;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native void _dbRestore(
|
||||
long lThis,
|
||||
String sDbPath,
|
||||
@@ -448,9 +440,6 @@ public class DbSystem
|
||||
RestoreClient RestoreClient,
|
||||
RestoreStatus RestoreStatus) throws XFlaimException;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native void _dbRename(
|
||||
long lThis,
|
||||
String sDbName,
|
||||
@@ -460,25 +449,288 @@ public class DbSystem
|
||||
boolean bOverwriteDestOk,
|
||||
DbRenameStatus Status) throws XFlaimException;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native long _openBufferIStream(
|
||||
long lThis,
|
||||
String sBuffer) throws XFlaimException;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native long _openFileIStream(
|
||||
long lThis,
|
||||
String sPath);
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*/
|
||||
private native long _createJDataVector(
|
||||
long lRef);
|
||||
|
||||
private native void _dbRebuild(
|
||||
long lThis,
|
||||
String sSourceDbPath,
|
||||
String sSourceDataDir,
|
||||
String sDestDbPath,
|
||||
String sDestDataDir,
|
||||
String sDestRflDir,
|
||||
String sDictPath,
|
||||
String sPassword,
|
||||
CREATEOPTS createOpts,
|
||||
RebuildStatus rebuildStatus) throws XFlaimException;
|
||||
|
||||
private long m_this;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
METHODS NOT YET IMPLEMENTED
|
||||
|
||||
virtual RCODE FLMAPI updateIniFile(
|
||||
const char * pszParamName,
|
||||
const char * pszValue) = 0;
|
||||
|
||||
virtual void FLMAPI getFileSystem(
|
||||
IF_FileSystem ** ppFileSystem) = 0;
|
||||
|
||||
virtual RCODE FLMAPI dbDup(
|
||||
IF_Db * pDb,
|
||||
IF_Db ** ppDb) = 0;
|
||||
|
||||
virtual const char * FLMAPI checkErrorToStr(
|
||||
FLMINT iCheckErrorCode) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openMultiFileIStream(
|
||||
const char * pszDirectory,
|
||||
const char * pszBaseName,
|
||||
IF_IStream ** ppIStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openBufferedIStream(
|
||||
IF_IStream * pIStream,
|
||||
FLMUINT uiBufferSize,
|
||||
IF_IStream ** ppIStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openUncompressingIStream(
|
||||
IF_IStream * pIStream,
|
||||
IF_IStream ** ppIStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openFileOStream(
|
||||
const char * pszFileName,
|
||||
FLMBOOL bTruncateIfExists,
|
||||
IF_OStream ** ppOStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openMultiFileOStream(
|
||||
const char * pszDirectory,
|
||||
const char * pszBaseName,
|
||||
FLMUINT uiMaxFileSize,
|
||||
FLMBOOL bOkToOverwrite,
|
||||
IF_OStream ** ppStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI removeMultiFileStream(
|
||||
const char * pszDirectory,
|
||||
const char * pszBaseName) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openBufferedOStream(
|
||||
IF_OStream * pOStream,
|
||||
FLMUINT uiBufferSize,
|
||||
IF_OStream ** ppOStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openCompressingOStream(
|
||||
IF_OStream * pOStream,
|
||||
IF_OStream ** ppOStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI writeToOStream(
|
||||
IF_IStream * pIStream,
|
||||
IF_OStream * pOStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openBase64Encoder(
|
||||
IF_IStream * pInputStream,
|
||||
FLMBOOL bInsertLineBreaks,
|
||||
IF_IStream ** ppEncodedStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI openBase64Decoder(
|
||||
IF_IStream * pInputStream,
|
||||
IF_IStream ** ppDecodedStream) = 0;
|
||||
|
||||
virtual RCODE FLMAPI createIFDataVector(
|
||||
IF_DataVector ** ifppDV) = 0;
|
||||
|
||||
virtual RCODE FLMAPI createIFResultSet(
|
||||
IF_ResultSet ** ifppResultSet) = 0;
|
||||
|
||||
virtual RCODE FLMAPI createIFQuery(
|
||||
IF_Query ** ifppQuery) = 0;
|
||||
|
||||
virtual void FLMAPI freeMem(
|
||||
void ** ppMem) = 0;
|
||||
|
||||
virtual RCODE FLMAPI setDynamicMemoryLimit(
|
||||
FLMUINT uiCacheAdjustPercent,
|
||||
FLMUINT uiCacheAdjustMin,
|
||||
FLMUINT uiCacheAdjustMax,
|
||||
FLMUINT uiCacheAdjustMinToLeave) = 0;
|
||||
|
||||
virtual RCODE FLMAPI setHardMemoryLimit(
|
||||
FLMUINT uiPercent,
|
||||
FLMBOOL bPercentOfAvail,
|
||||
FLMUINT uiMin,
|
||||
FLMUINT uiMax,
|
||||
FLMUINT uiMinToLeave,
|
||||
FLMBOOL bPreallocate = FALSE) = 0;
|
||||
|
||||
virtual FLMBOOL FLMAPI getDynamicCacheSupported( void) = 0;
|
||||
|
||||
virtual void FLMAPI getCacheInfo(
|
||||
XFLM_CACHE_INFO * pCacheInfo) = 0;
|
||||
|
||||
virtual void FLMAPI enableCacheDebug(
|
||||
FLMBOOL bDebug) = 0;
|
||||
|
||||
virtual FLMBOOL FLMAPI cacheDebugEnabled( void) = 0;
|
||||
|
||||
virtual RCODE FLMAPI closeUnusedFiles(
|
||||
FLMUINT uiSeconds) = 0;
|
||||
|
||||
virtual void FLMAPI startStats( void) = 0;
|
||||
|
||||
virtual void FLMAPI stopStats( void) = 0;
|
||||
|
||||
virtual void FLMAPI resetStats( void) = 0;
|
||||
|
||||
virtual RCODE FLMAPI getStats(
|
||||
XFLM_STATS * pFlmStats) = 0;
|
||||
|
||||
virtual void FLMAPI freeStats(
|
||||
XFLM_STATS * pFlmStats) = 0;
|
||||
|
||||
virtual RCODE FLMAPI setTempDir(
|
||||
const char * pszPath) = 0;
|
||||
|
||||
virtual RCODE FLMAPI getTempDir(
|
||||
char * pszPath) = 0;
|
||||
|
||||
virtual void FLMAPI setCheckpointInterval(
|
||||
FLMUINT uiSeconds) = 0;
|
||||
|
||||
virtual FLMUINT FLMAPI getCheckpointInterval( void) = 0;
|
||||
|
||||
virtual void FLMAPI setCacheAdjustInterval(
|
||||
FLMUINT uiSeconds) = 0;
|
||||
|
||||
virtual FLMUINT FLMAPI getCacheAdjustInterval( void) = 0;
|
||||
|
||||
virtual void FLMAPI setCacheCleanupInterval(
|
||||
FLMUINT uiSeconds) = 0;
|
||||
|
||||
virtual FLMUINT FLMAPI getCacheCleanupInterval( void) = 0;
|
||||
|
||||
virtual void FLMAPI setUnusedCleanupInterval(
|
||||
FLMUINT uiSeconds) = 0;
|
||||
|
||||
virtual FLMUINT FLMAPI getUnusedCleanupInterval( void) = 0;
|
||||
|
||||
virtual void FLMAPI setMaxUnusedTime(
|
||||
FLMUINT uiSeconds) = 0;
|
||||
|
||||
virtual FLMUINT FLMAPI getMaxUnusedTime( void) = 0;
|
||||
|
||||
virtual void FLMAPI setLogger(
|
||||
IF_LoggerClient * pLogger) = 0;
|
||||
|
||||
virtual void FLMAPI enableExtendedServerMemory(
|
||||
FLMBOOL bEnable) = 0;
|
||||
|
||||
virtual FLMBOOL FLMAPI extendedServerMemoryEnabled( void) = 0;
|
||||
|
||||
virtual void FLMAPI deactivateOpenDb(
|
||||
const char * pszDatabasePath,
|
||||
const char * pszDataFilePath) = 0;
|
||||
|
||||
virtual void FLMAPI setQuerySaveMax(
|
||||
FLMUINT uiMaxToSave) = 0;
|
||||
|
||||
virtual FLMUINT FLMAPI getQuerySaveMax( void) = 0;
|
||||
|
||||
virtual void FLMAPI setDirtyCacheLimits(
|
||||
FLMUINT uiMaxDirty,
|
||||
FLMUINT uiLowDirty) = 0;
|
||||
|
||||
virtual void FLMAPI getDirtyCacheLimits(
|
||||
FLMUINT * puiMaxDirty,
|
||||
FLMUINT * puiLowDirty) = 0;
|
||||
|
||||
virtual RCODE FLMAPI getThreadInfo(
|
||||
IF_ThreadInfo ** ifppThreadInfo) = 0;
|
||||
|
||||
virtual RCODE FLMAPI registerForEvent(
|
||||
eEventCategory eCategory,
|
||||
IF_EventClient * ifpEventClient) = 0;
|
||||
|
||||
virtual void FLMAPI deregisterForEvent(
|
||||
eEventCategory eCategory,
|
||||
IF_EventClient * ifpEventClient) = 0;
|
||||
|
||||
virtual RCODE FLMAPI getNextMetaphone(
|
||||
IF_IStream * ifpIStream,
|
||||
FLMUINT * puiMetaphone,
|
||||
FLMUINT * puiAltMetaphone = NULL) = 0;
|
||||
|
||||
virtual RCODE FLMAPI compareUTF8Strings(
|
||||
const FLMBYTE * pucLString,
|
||||
FLMUINT uiLStrBytes,
|
||||
FLMBOOL bLeftWild,
|
||||
const FLMBYTE * pucRString,
|
||||
FLMUINT uiRStrBytes,
|
||||
FLMBOOL bRightWild,
|
||||
FLMUINT uiCompareRules,
|
||||
FLMUINT uiLanguage,
|
||||
FLMINT * piResult) = 0;
|
||||
|
||||
virtual RCODE FLMAPI compareUnicodeStrings(
|
||||
const FLMUNICODE * puzLString,
|
||||
FLMUINT uiLStrBytes,
|
||||
FLMBOOL bLeftWild,
|
||||
const FLMUNICODE * puzRString,
|
||||
FLMUINT uiRStrBytes,
|
||||
FLMBOOL bRightWild,
|
||||
FLMUINT uiCompareRules,
|
||||
FLMUINT uiLanguage,
|
||||
FLMINT * piResult) = 0;
|
||||
|
||||
virtual RCODE FLMAPI utf8IsSubStr(
|
||||
const FLMBYTE * pszString,
|
||||
const FLMBYTE * pszSubString,
|
||||
FLMUINT uiCompareRules,
|
||||
FLMUINT uiLanguage,
|
||||
FLMBOOL * pbExists) = 0;
|
||||
|
||||
virtual FLMBOOL FLMAPI uniIsUpper(
|
||||
FLMUNICODE uzChar) = 0;
|
||||
|
||||
virtual FLMBOOL FLMAPI uniIsLower(
|
||||
FLMUNICODE uzChar) = 0;
|
||||
|
||||
virtual FLMBOOL FLMAPI uniIsAlpha(
|
||||
FLMUNICODE uzChar) = 0;
|
||||
|
||||
virtual FLMBOOL FLMAPI uniIsDecimalDigit(
|
||||
FLMUNICODE uzChar) = 0;
|
||||
|
||||
virtual FLMUNICODE FLMAPI uniToLower(
|
||||
FLMUNICODE uzChar) = 0;
|
||||
|
||||
virtual RCODE FLMAPI nextUCS2Char(
|
||||
const FLMBYTE ** ppszUTF8,
|
||||
const FLMBYTE * pszEndOfUTF8String,
|
||||
FLMUNICODE * puzChar) = 0;
|
||||
|
||||
virtual RCODE FLMAPI numUCS2Chars(
|
||||
const FLMBYTE * pszUTF8,
|
||||
FLMUINT * puiNumChars) = 0;
|
||||
|
||||
virtual RCODE FLMAPI waitToClose(
|
||||
const char * pszDbFileName) = 0;
|
||||
|
||||
virtual RCODE FLMAPI createIFNodeInfo(
|
||||
IF_NodeInfo ** ifppNodeInfo) = 0;
|
||||
|
||||
virtual RCODE FLMAPI createIFBTreeInfo(
|
||||
IF_BTreeInfo ** ifppBTreeInfo) = 0;
|
||||
|
||||
virtual RCODE FLMAPI clearCache(
|
||||
IF_Db * pDb) = 0;
|
||||
|
||||
*/
|
||||
|
||||
49
xflaim/java/xflaim/RebuildStatus.java
Normal file
49
xflaim/java/xflaim/RebuildStatus.java
Normal file
@@ -0,0 +1,49 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Desc: RebuildStatus Interface
|
||||
//
|
||||
// Tabs: 3
|
||||
//
|
||||
// Copyright (c) 2006 Novell, Inc. All Rights Reserved.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of version 2 of the GNU General Public
|
||||
// License as published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, contact Novell, Inc.
|
||||
//
|
||||
// To contact Novell about this file by physical or electronic mail,
|
||||
// you may find current contact information at www.novell.com
|
||||
//
|
||||
// $Id$
|
||||
//------------------------------------------------------------------------------
|
||||
package xflaim;
|
||||
|
||||
interface RebuildStatus
|
||||
{
|
||||
public int reportRebuild(
|
||||
int iDoingFlag,
|
||||
boolean bStartFlag,
|
||||
long l64FileSize,
|
||||
long lBytesExamined,
|
||||
long lTotNodes,
|
||||
long lNodesRecov,
|
||||
long lDiscardedDocs);
|
||||
|
||||
public int reportRebuildErr(
|
||||
int iErrCode,
|
||||
int iErrLocale,
|
||||
int iErrLfNumber,
|
||||
int iErrLfType,
|
||||
int iErrBTreeLevel,
|
||||
int iErrBlkAddress,
|
||||
int iErrParentBlkAddress,
|
||||
int iErrElmOffset,
|
||||
long lErrNodeId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user