Various message logging and async I/O changes.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@528 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
ahodgkinson
2006-06-06 22:49:49 +00:00
parent 6e5b224a5f
commit d64d1bc5c0
15 changed files with 126 additions and 1589 deletions
+15 -9
View File
@@ -466,7 +466,7 @@ void flmLogError(
FLMINT iLineNumber)
{
flmLogMessage(
FLM_DEBUG_MESSAGE,
F_DEBUG_MESSAGE,
FLM_YELLOW,
FLM_BLACK,
pszFileName
@@ -481,18 +481,24 @@ void flmLogError(
Desc: Logs messages
****************************************************************************/
void flmLogMessage(
FlmLogMessageSeverity eMsgSeverity,
eLogMessageSeverity eMsgSeverity,
eColorType foreground,
eColorType background,
const char * pszFormat,
...)
{
FLMINT iLen;
f_va_list args;
F_LogMessage * pLogMsg = NULL;
char * pszMsgBuf = NULL;
FLMINT iLen;
f_va_list args;
IF_LogMessageClient * pLogMsg = NULL;
char * pszMsgBuf = NULL;
if( (pLogMsg = flmBeginLogMessage( FLM_GENERAL_MESSAGE, eMsgSeverity)) != NULL)
if( !gv_FlmSysData.pLogger)
{
return;
}
if( (pLogMsg = gv_FlmSysData.pLogger->beginMessage(
FLM_GENERAL_MESSAGE, eMsgSeverity)) != NULL)
{
if( RC_OK( f_alloc( 1024, &pszMsgBuf)))
{
@@ -504,7 +510,7 @@ void flmLogMessage(
pLogMsg->appendString( pszMsgBuf);
}
flmEndLogMessage( &pLogMsg);
f_endLogMessage( &pLogMsg);
if( pszMsgBuf)
{
@@ -524,7 +530,7 @@ FSTATIC void flmLogMustCloseReason(
// Log a message indicating why the "must close" flag was set
flmLogMessage(
FLM_DEBUG_MESSAGE,
F_DEBUG_MESSAGE,
FLM_YELLOW,
FLM_BLACK,
"Database (%s) must be closed because of a 0x%04X error, File=%s, Line=%d.",
+1 -183
View File
@@ -382,7 +382,6 @@
class FlmRecord;
class FlmRecordSet;
class F_LogMessage;
class F_Restore;
/***************************************************************************
@@ -1726,7 +1725,7 @@
FLM_CLOSE_FILE,
/// FlmConfig().\ Set the logger object.\ \n
/// Input: pvValue1 is (F_Logger *), pointer to logger object.\ \n
/// Input: pvValue1 is (IF_LoggerClient *), pointer to logger object.\ \n
/// NULL means disable logging.
FLM_LOGGER,
@@ -3207,187 +3206,6 @@
FLM_NUM_MESSAGE_TYPES
} FlmLogMessageType;
/// Message severity.
typedef enum
{
FLM_FATAL_MESSAGE = 0, ///< Indicates that a fatal error occurred - the kind that would normally
///< require a shutdown or other corrective action by an administrator.
FLM_WARN_MESSAGE, ///< Warning message.
FLM_ERR_MESSAGE, ///< Non-fatal error message.
FLM_INFO_MESSAGE, ///< Information-only message.
FLM_DEBUG_MESSAGE ///< Debug message.
} FlmLogMessageSeverity;
/// This is an abstract base class that allows an application to catch messages logged by FLAIM. The
/// application must create an implementation for this class and then pass that object into
/// the FlmConfig() function using the eFlmConfigTypes::FLM_LOGGER option. Doing so allows the
/// application to catch messages logged by FLAIM. The application can do whatever it wants with
/// the messages - write them to a log file, display them to a console, save them to a database, etc.
class FLMEXP F_Logger : public F_Object
{
public:
F_Logger();
virtual ~F_Logger();
// Pure virtual functions that must be implemented
/// FLAIM calls this method to start a new message. The application should return to FLAIM
/// an ::F_LogMessage object that FLAIM can then use to format a message.
virtual F_LogMessage * beginMessage(
FlmLogMessageType eMsgType, ///< Type of message FLAIM wants to log.\ If the application
///< has disabled messages of this type, it should return
///< a NULL from the function.\ An application can determine
///< if a particular message type has been disabled by calling
///< the F_Logger::messageTypeEnabled() method.
FlmLogMessageSeverity eMsgSeverity ///< Message severity of the message FLAIM wants to
///< log.
) = 0;
// Functions implemented in the base class
/// This method is provided by FLAIM to allow an application to enable logging of a particular
/// message type. This method should be called once for each type of message the application
/// wants to enable.
void enableMessageType(
FlmLogMessageType eMsgType ///< Type of message to be enabled.
);
/// This method is provided by FLAIM to allow an applicatoin to enable logging of all
/// message types.
void enableAllMessageTypes( void);
/// This method is provided by FLAIM to allow an application to disable logging of a particular
/// message type. This method should be called once for each type of message the application
/// wants to disable.
void disableMessageType(
FlmLogMessageType eMsgType);
/// This method is provided by FLAIM to allow an applicatoin to disable logging of all
/// message types.
void disableAllMessageTypes( void);
/// This method is provided by FLAIM to allow an application to determine if logging has
/// been enabled for a particular message type. An application would typically call this
/// method from within its implementation of the F_Logger::beginMessage() method
/// to determine if it should return an ::F_LogMessage object to FLAIM.
FLMBOOL messageTypeEnabled(
FlmLogMessageType eMsgType ///< Type of message the application wants to determine if
///< message logging is enabled for.
);
/// Lock the ::F_Logger object. This method and the F_Logger::unlockLogger() method are used internally
/// by FLAIM to control multi-thread access to the logger object. This method was
/// made public in case the application also wants to control multi-thread access.
void lockLogger( void);
/// Unlock the ::F_Logger object. This method and the F_Logger::lockLogger() method are used internally
/// by FLAIM to control multi-thread access to the logger object. This method was
/// made public in case the application also wants to control multi-thread access.
void unlockLogger( void);
/// Setup the ::F_Logger object. The application must call this method before doing anything else with
/// the object.
RCODE setupLogger( void);
/// Determine if the ::F_Logger object has been properly setup - that is, has the F_Logger::setupLogger()
/// method been called.
FLMBOOL loggerIsSetup( void);
private:
F_MUTEX m_hMutex;
FLMBOOL m_bSetupCalled;
FLMBOOL * m_pbEnabledList;
};
/// This is an abstract base class that allows an application to catch messages logged by FLAIM. The
/// application must create an implementation for this class and then return an object of that
/// class when the F_Logger::beginMessage() method is called by FLAIM. Doing so allows the
/// application to catch messages logged by FLAIM. The application can do whatever it wants with
/// the messages - write them to a log file, display them to a console, save them to a database, etc.
class FLMEXP F_LogMessage : public F_Object
{
public:
F_LogMessage()
{
m_uiBackColors = 0;
m_uiForeColors = 0;
m_currentForeColor = FLM_LIGHTGRAY;
m_currentBackColor = FLM_BLACK;
}
virtual ~F_LogMessage()
{
}
// Pure virtual functions
/// Set the current foreground and background colors for the message. FLAIM calls this to
/// set the colors for text that is appended after this call (see F_LogMessage::appendString()).
/// The colors may be changed at any time - thus allowing a message to have multiple different colors.
virtual void changeColor(
eColorType foreColor, ///< Foreground color.
eColorType backColor ///< Background color.
) = 0;
/// Append a string to the message. FLAIM calls this to add text to a message. It may be called
/// multiple times by FLAIM to format a complete message. The message is not complete until
/// FLAIM calls the F_LogMessage::endMessage() method.
virtual void appendString(
const char * pszStr ///< Text to append to the message.
) = 0;
/// Append a newline to the message. FLAIM calls this when it wants to create a multi-line
/// message. Rather than embedding a newline character, FLAIM calls this method. This
/// allows an application to recognize the fact that there are multiple lines in the message
/// and to log, display, store, etc. (whatever) them accordingly.
virtual void newline( void) = 0;
/// End the current message. FLAIM calls this to end the current message. The application
/// should finish logging, displaying, storing, etc. (whatever) the message. The object
/// should be reset in case FLAIM wants to start logging a new message.
virtual void endMessage( void) = 0;
// Public methods. The following methods are only be called by FLAIM internally. They are
// all implemented by FLAIM.
void pushForegroundColor( void);
void popForegroundColor( void);
void pushBackgroundColor( void);
void popBackgroundColor( void);
eColorType getForegroundColor()
{
return( m_currentForeColor);
}
eColorType getBackgroundColor()
{
return( m_currentBackColor);
}
void setColor(
eColorType foreColor,
eColorType backColor);
private:
#define F_MAX_COLOR_STACK_SIZE 8
eColorType m_backColors[ F_MAX_COLOR_STACK_SIZE];
eColorType m_foreColors[ F_MAX_COLOR_STACK_SIZE];
FLMUINT m_uiBackColors;
FLMUINT m_uiForeColors;
eColorType m_currentBackColor;
eColorType m_currentForeColor;
};
#define F_MAX_NUM_BUF 12
/// Convert a FLMUINT value to FLAIM's internal storage format for numbers.
+1 -2
View File
@@ -67,7 +67,6 @@ class F_CCS;
#include "filesys.h"
#include "fquery.h"
#include "fscursor.h"
#include "flog.h"
#include "flmimon.h"
#include "flmstat.h"
#include "fcs.h"
@@ -943,7 +942,7 @@ void flmLogError(
FLMINT iLineNumber = 0);
void flmLogMessage(
FlmLogMessageSeverity eMsgSeverity,
eLogMessageSeverity eMsgSeverity,
eColorType eForground,
eColorType eBackground,
const char * pszFormat,
+4 -8
View File
@@ -372,12 +372,12 @@ FSTATIC RCODE flmInitNewFile(
// Initialize the database file header.
// Allocate a buffer to use - must be AT LEAST 2K.
uiBufSize = (FLMUINT)((uiBlkSize < 2048)
? (FLMUINT)2048
: (FLMUINT)uiBlkSize);
if (RC_BAD( rc = f_calloc( uiBufSize, &pBuf)))
if( RC_BAD( rc = f_allocAlignedBuffer( uiBufSize,
(void **)&pBuf)))
{
goto Exit;
}
@@ -388,10 +388,6 @@ FSTATIC RCODE flmInitNewFile(
goto Exit;
}
// Free the buffer before returning.
f_free( &pBuf);
// Allocate the pRfl object. Could not do this until this point
// because we need to have the version number, block size, etc.
// setup in the pFile->FileHdr.
@@ -438,7 +434,7 @@ Exit:
if (pBuf)
{
f_free( &pBuf);
f_freeAlignedBuffer( (void **)&pBuf);
}
if (bTransStarted)
-1179
View File
File diff suppressed because it is too large Load Diff
-84
View File
@@ -1,84 +0,0 @@
//-------------------------------------------------------------------------
// Desc: Message logging - definitions.
// Tabs: 3
//
// Copyright (c) 2001-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: flog.h 12329 2006-01-20 17:49:30 -0700 (Fri, 20 Jan 2006) ahodgkinson $
//-------------------------------------------------------------------------
#ifndef FLOG_H
#define FLOG_H
#include "fpackon.h"
// IMPORTANT NOTE: No other include files should follow this one except
// for fpackoff.h
// Special defines for use in the format string of flmLogPrintf
#define F_BLACK "%0C"
#define F_BLUE "%1C"
#define F_GREEN "%2C"
#define F_CYAN "%3C"
#define F_RED "%4C"
#define F_PURPLE "%5C"
#define F_BROWN "%6C"
#define F_LIGHTGRAY "%7C"
#define F_DARKGRAY "%8C"
#define F_LIGHTBLUE "%9C"
#define F_LIGHTGREEN "%10C"
#define F_LIGHTCYAN "%11C"
#define F_LIGHTRED "%12C"
#define F_LIGHTPURPLE "%13C"
#define F_YELLOW "%14C"
#define F_WHITE "%15C"
#define F_PUSHFORECOLOR "%+0C"
#define F_PUSHBACKCOLOR "%+1C"
#define F_POPFORECOLOR "%-0C"
#define F_POPBACKCOLOR "%-1C"
#define F_PUSHCOLOR F_PUSHFORECOLOR F_PUSHBACKCOLOR
#define F_POPCOLOR F_POPFORECOLOR F_POPBACKCOLOR
#define F_BLUE_ON_WHITE "%1.15C"
// Logging functions for use within FLAIM
F_LogMessage * flmBeginLogMessage(
FlmLogMessageType eMsgType,
FlmLogMessageSeverity eMsgSeverity);
void flmLogPrintf(
F_LogMessage * pLogMessage,
const char * pszFormatStr, ...);
void flmLogVPrintf(
F_LogMessage * pLogMessage,
const char * szFormatStr,
f_va_list * args);
/****************************************************************************
Desc: Ends a logging message
****************************************************************************/
void flmEndLogMessage(
F_LogMessage ** ppLogMessage);
#include "fpackoff.h"
#endif
+1 -1
View File
@@ -2238,7 +2238,7 @@ RCODE flmDbMonitor(
{
// Log a message
flmLogMessage( FLM_WARN_MESSAGE, FLM_YELLOW, FLM_BLACK,
flmLogMessage( F_WARN_MESSAGE, FLM_YELLOW, FLM_BLACK,
"WARNING: The RFL has exceeded the specified size limit of %i64u",
ui64RflDiskThreshold);
+11 -8
View File
@@ -642,18 +642,21 @@ Desc: Frees memory allocated to an initialized cursor. The cursor handle
FLMEXP RCODE FLMAPI FlmCursorFree(
HFCURSOR * phCursor)
{
CURSOR * pCursor = (CURSOR *)*phCursor;
F_LogMessage * pLogMsg = NULL;
CURSOR * pCursor = (CURSOR *)*phCursor;
IF_LogMessageClient * pLogMsg = NULL;
flmAssert( pCursor != NULL);
if( !gv_FlmSysData.pLogger)
{
return( FERR_OK);
}
// Log the query before getting rid of it
if ((pLogMsg = flmBeginLogMessage( FLM_QUERY_MESSAGE,
FLM_DEBUG_MESSAGE)) != NULL)
if ((pLogMsg = gv_FlmSysData.pLogger->beginMessage( FLM_QUERY_MESSAGE,
F_DEBUG_MESSAGE)) != NULL)
{
flmLogQuery( pLogMsg, 0, pCursor);
flmEndLogMessage( &pLogMsg);
f_endLogMessage( &pLogMsg);
}
if (!pCursor->pCSContext && gv_FlmSysData.uiMaxQueries)
@@ -668,7 +671,7 @@ FLMEXP RCODE FLMAPI FlmCursorFree(
*phCursor = HFCURSOR_NULL;
}
return FERR_OK;
return( FERR_OK);
}
/****************************************************************************
+83 -86
View File
@@ -25,41 +25,41 @@
#include "flaimsys.h"
FSTATIC void flmLogIndent(
F_LogMessage * pLogMsg,
FLMUINT uiIndent);
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent);
FSTATIC void flmLogOperator(
F_LogMessage * pLogMsg,
QTYPES eOperator,
FLMBOOL bEndLine);
IF_LogMessageClient * pLogMsg,
QTYPES eOperator,
FLMBOOL bEndLine);
FSTATIC void flmLogBinary(
F_LogMessage * pLogMsg,
FLMBYTE * pucBuf,
FLMUINT uiBufLen);
IF_LogMessageClient * pLogMsg,
FLMBYTE * pucBuf,
FLMUINT uiBufLen);
FSTATIC void flmLogText(
F_LogMessage * pLogMsg,
const char * pucBuf,
FLMUINT uiBufLen);
IF_LogMessageClient * pLogMsg,
const char * pucBuf,
FLMUINT uiBufLen);
FSTATIC void flmLogPredicate(
F_LogMessage * pLogMsg,
FLMUINT uiIndent,
FQNODE * pQNode);
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent,
FQNODE * pQNode);
FSTATIC void flmLogSubQuery(
F_LogMessage * pLogMsg,
FLMUINT uiIndent,
QTYPES eParentOp,
SUBQUERY * pSubQuery);
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent,
QTYPES eParentOp,
SUBQUERY * pSubQuery);
/****************************************************************************
Desc: This routine indents in the log.
****************************************************************************/
FSTATIC void flmLogIndent(
F_LogMessage * pLogMsg,
FLMUINT uiIndent)
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent)
{
char szIndent [100];
@@ -67,7 +67,7 @@ FSTATIC void flmLogIndent(
{
f_memset( szIndent, ' ', uiIndent);
szIndent [uiIndent] = 0;
pLogMsg->setColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->changeColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->appendString( szIndent);
}
}
@@ -76,10 +76,9 @@ FSTATIC void flmLogIndent(
Desc: This routine logs an operator
****************************************************************************/
FSTATIC void flmLogOperator(
F_LogMessage * pLogMsg,
QTYPES eOperator,
FLMBOOL bEndLine
)
IF_LogMessageClient * pLogMsg,
QTYPES eOperator,
FLMBOOL bEndLine)
{
const char * pszOperator;
@@ -163,11 +162,11 @@ FSTATIC void flmLogOperator(
pLogMsg->pushBackgroundColor();
if (eOperator == FLM_LPAREN_OP || eOperator == FLM_RPAREN_OP)
{
pLogMsg->setColor( FLM_CYAN, FLM_BLACK);
pLogMsg->changeColor( FLM_CYAN, FLM_BLACK);
}
else
{
pLogMsg->setColor( FLM_BLUE, FLM_LIGHTGRAY);
pLogMsg->changeColor( FLM_BLUE, FLM_LIGHTGRAY);
}
pLogMsg->appendString( pszOperator);
@@ -202,9 +201,9 @@ FINLINE void flmFormatByteToHex(
Desc: This routine logs a buffer of binary bytes as ASCII hex.
****************************************************************************/
FSTATIC void flmLogBinary(
F_LogMessage * pLogMsg,
FLMBYTE * pucBuf,
FLMUINT uiBufLen)
IF_LogMessageClient * pLogMsg,
FLMBYTE * pucBuf,
FLMUINT uiBufLen)
{
FLMUINT uiLoop;
FLMUINT uiOffset;
@@ -303,9 +302,9 @@ FSTATIC void flmLogBinary(
Desc: This routine logs text data.
****************************************************************************/
FSTATIC void flmLogText(
F_LogMessage * pLogMsg,
const char * pucBuf,
FLMUINT uiBufLen)
IF_LogMessageClient * pLogMsg,
const char * pucBuf,
FLMUINT uiBufLen)
{
FLMUINT uiLoop;
FLMUINT uiOffset;
@@ -412,10 +411,9 @@ FSTATIC void flmLogText(
Desc: This routine logs the query criteria for a cursor.
****************************************************************************/
FSTATIC void flmLogPredicate(
F_LogMessage * pLogMsg,
FLMUINT uiIndent,
FQNODE * pQNode
)
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent,
FQNODE * pQNode)
{
FLMUINT uiNestLevel = 0;
QTYPES eCurrentOp;
@@ -441,20 +439,20 @@ FSTATIC void flmLogPredicate(
if (IS_VAL( eCurrentOp))
{
pLogMsg->setColor( FLM_WHITE, FLM_BLACK);
pLogMsg->changeColor( FLM_WHITE, FLM_BLACK);
switch (eCurrentOp)
{
case FLM_BOOL_VAL:
flmLogPrintf( pLogMsg, "%u",
f_logPrintf( pLogMsg, "%u",
(unsigned)pQNode->pQAtom->val.uiBool);
break;
case FLM_REC_PTR_VAL:
case FLM_UINT32_VAL:
flmLogPrintf( pLogMsg, "%u",
f_logPrintf( pLogMsg, "%u",
(unsigned)pQNode->pQAtom->val.uiVal);
break;
case FLM_INT32_VAL:
flmLogPrintf( pLogMsg, "%d",
f_logPrintf( pLogMsg, "%d",
(int)pQNode->pQAtom->val.iVal);
break;
case FLM_BINARY_VAL:
@@ -480,7 +478,7 @@ FSTATIC void flmLogPredicate(
FLMUINT uiCnt;
flmAssert( IS_FIELD( eCurrentOp));
pLogMsg->setColor( FLM_YELLOW, FLM_BLACK);
pLogMsg->changeColor( FLM_YELLOW, FLM_BLACK);
pLogMsg->appendString( "FLD:");
// Fields are from child to parent order - must count fields
@@ -496,11 +494,11 @@ FSTATIC void flmLogPredicate(
uiCnt--;
if (uiCnt)
{
flmLogPrintf( pLogMsg, "%u.", (unsigned)puiFldPath [uiCnt]);
f_logPrintf( pLogMsg, "%u.", (unsigned)puiFldPath [uiCnt]);
}
else
{
flmLogPrintf( pLogMsg, "%u", (unsigned)puiFldPath [uiCnt]);
f_logPrintf( pLogMsg, "%u", (unsigned)puiFldPath [uiCnt]);
}
}
}
@@ -540,11 +538,10 @@ Exit:
Desc: This routine logs the query criteria for a cursor.
****************************************************************************/
FSTATIC void flmLogSubQuery(
F_LogMessage * pLogMsg,
FLMUINT uiIndent,
QTYPES eParentOp,
SUBQUERY * pSubQuery
)
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent,
QTYPES eParentOp,
SUBQUERY * pSubQuery)
{
FQNODE * pQNode;
QTYPES eCurrentOp;
@@ -560,7 +557,7 @@ FSTATIC void flmLogSubQuery(
{
flmLogIndent( pLogMsg, uiIndent);
flmLogOperator( pLogMsg, FLM_LPAREN_OP, FALSE);
pLogMsg->setColor( FLM_WHITE, FLM_BLACK);
pLogMsg->changeColor( FLM_WHITE, FLM_BLACK);
pLogMsg->appendString( "<empty>");
flmLogOperator( pLogMsg, FLM_RPAREN_OP, TRUE);
goto Output_Opt_Info;
@@ -603,13 +600,13 @@ FSTATIC void flmLogSubQuery(
flmLogOperator( pLogMsg, FLM_LPAREN_OP, FALSE);
if (hCursor == HFCURSOR_NULL)
{
pLogMsg->setColor( FLM_WHITE, FLM_BLACK);
pLogMsg->changeColor( FLM_WHITE, FLM_BLACK);
pLogMsg->appendString( " [EmbeddedPredicate] ");
flmLogOperator( pLogMsg, FLM_RPAREN_OP, TRUE);
}
else
{
pLogMsg->setColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->changeColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->appendString( " [BeginEmbedded");
if (pSubQuery->OptInfo.eOptType == QOPT_USING_PREDICATE &&
pSubQuery->pPredicate == pQNode->pQAtom->val.pPredicate)
@@ -627,7 +624,7 @@ FSTATIC void flmLogSubQuery(
uiIndent -= 2;
flmLogIndent( pLogMsg, uiIndent);
flmLogOperator( pLogMsg, FLM_RPAREN_OP, FALSE);
pLogMsg->setColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->changeColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->appendString( " [EndEmbedded]");
pLogMsg->newline();
}
@@ -684,26 +681,26 @@ Output_Opt_Info:
switch (pSubQuery->OptInfo.eOptType)
{
case QOPT_USING_INDEX:
flmLogPrintf( pLogMsg, F_WHITE "UsingIX=" F_YELLOW "%u",
f_logPrintf( pLogMsg, F_WHITE "UsingIX=" F_YELLOW "%u",
pSubQuery->OptInfo.uiIxNum);
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", KeyMatch=");
f_logPrintf( pLogMsg, F_LIGHTGRAY ", KeyMatch=");
if (pSubQuery->OptInfo.bDoKeyMatch)
{
flmLogPrintf( pLogMsg, F_GREEN "YES");
f_logPrintf( pLogMsg, F_GREEN "YES");
}
else
{
flmLogPrintf( pLogMsg, F_RED "NO");
f_logPrintf( pLogMsg, F_RED "NO");
}
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", RecMatch=");
f_logPrintf( pLogMsg, F_LIGHTGRAY ", RecMatch=");
if (pSubQuery->OptInfo.bDoRecMatch)
{
flmLogPrintf( pLogMsg, F_GREEN "YES");
f_logPrintf( pLogMsg, F_GREEN "YES");
}
else
{
flmLogPrintf( pLogMsg, F_RED "NO");
f_logPrintf( pLogMsg, F_RED "NO");
}
pucFromKey = NULL;
@@ -716,24 +713,24 @@ Output_Opt_Info:
// Show the from key
flmLogPrintf( pLogMsg,
f_logPrintf( pLogMsg,
F_LIGHTGRAY ", FromKeyLen=" F_YELLOW "%u"
F_LIGHTGRAY ", FromKey=(",
uiFromKeyLen);
if (uiFromKeyLen)
{
pLogMsg->setColor( FLM_YELLOW, FLM_BLACK);
pLogMsg->changeColor( FLM_YELLOW, FLM_BLACK);
flmLogBinary( pLogMsg, pucFromKey, uiFromKeyLen);
}
else
{
flmLogPrintf( pLogMsg, F_YELLOW "<empty>");
f_logPrintf( pLogMsg, F_YELLOW "<empty>");
}
flmLogPrintf( pLogMsg, F_LIGHTGRAY ")");
f_logPrintf( pLogMsg, F_LIGHTGRAY ")");
// Show the until key.
flmLogPrintf( pLogMsg,
f_logPrintf( pLogMsg,
F_LIGHTGRAY ", UntilKeyLen=" F_YELLOW "%u"
F_LIGHTGRAY ", UntilExcl=" F_YELLOW "%s"
F_LIGHTGRAY ", UntilKey=(",
@@ -743,68 +740,68 @@ Output_Opt_Info:
: "No"));
if (uiUntilKeyLen)
{
pLogMsg->setColor( FLM_YELLOW, FLM_BLACK);
pLogMsg->changeColor( FLM_YELLOW, FLM_BLACK);
flmLogBinary( pLogMsg, pucUntilKey, uiUntilKeyLen);
}
else
{
flmLogPrintf( pLogMsg, F_YELLOW "<empty>");
f_logPrintf( pLogMsg, F_YELLOW "<empty>");
}
flmLogPrintf( pLogMsg, F_LIGHTGRAY ")");
f_logPrintf( pLogMsg, F_LIGHTGRAY ")");
f_free( &pucFromKey);
f_free( &pucUntilKey);
}
break;
case QOPT_USING_PREDICATE:
flmLogPrintf( pLogMsg, F_WHITE "Using Embedded Predicate");
f_logPrintf( pLogMsg, F_WHITE "Using Embedded Predicate");
break;
case QOPT_SINGLE_RECORD_READ:
flmLogPrintf( pLogMsg, F_WHITE "Single Record Read, DRN: "
f_logPrintf( pLogMsg, F_WHITE "Single Record Read, DRN: "
F_YELLOW "%u", pSubQuery->OptInfo.uiDrn);
break;
case QOPT_PARTIAL_CONTAINER_SCAN:
flmLogPrintf( pLogMsg, F_WHITE "Partial Container Scan");
f_logPrintf( pLogMsg, F_WHITE "Partial Container Scan");
//VISIT: Output from and until DRNs - need a method from
//pSubQuery->pFSDataCursor to return them.
break;
case QOPT_FULL_CONTAINER_SCAN:
flmLogPrintf( pLogMsg, F_WHITE "Full Container Scan");
f_logPrintf( pLogMsg, F_WHITE "Full Container Scan");
break;
default:
flmLogPrintf( pLogMsg, F_WHITE "Unknown optimization");
f_logPrintf( pLogMsg, F_WHITE "Unknown optimization");
break;
}
flmLogPrintf( pLogMsg, F_LIGHTGRAY "}\n");
f_logPrintf( pLogMsg, F_LIGHTGRAY "}\n");
flmLogIndent( pLogMsg, uiIndent);
pLogMsg->appendString( "{Stats: ");
flmLogPrintf( pLogMsg, F_LIGHTGRAY "Container=" F_WHITE "%u",
f_logPrintf( pLogMsg, F_LIGHTGRAY "Container=" F_WHITE "%u",
(unsigned)pSubQuery->SQStatus.uiContainerNum);
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", Matched=" F_WHITE "%u",
f_logPrintf( pLogMsg, F_LIGHTGRAY ", Matched=" F_WHITE "%u",
(unsigned)pSubQuery->SQStatus.uiMatchedCnt);
if (pSubQuery->SQStatus.uiNumRejectedByCallback)
{
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", CallbackRejected=" F_WHITE "%u",
f_logPrintf( pLogMsg, F_LIGHTGRAY ", CallbackRejected=" F_WHITE "%u",
(unsigned)pSubQuery->SQStatus.uiNumRejectedByCallback);
}
if (pSubQuery->SQStatus.uiDupsEliminated)
{
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", DupsElim=" F_WHITE "%u",
f_logPrintf( pLogMsg, F_LIGHTGRAY ", DupsElim=" F_WHITE "%u",
(unsigned)pSubQuery->SQStatus.uiDupsEliminated);
}
if (pSubQuery->SQStatus.uiKeysTraversed ||
pSubQuery->SQStatus.uiKeysRejected)
{
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", KeysFailed=" F_WHITE "%u of %u",
f_logPrintf( pLogMsg, F_LIGHTGRAY ", KeysFailed=" F_WHITE "%u of %u",
(unsigned)pSubQuery->SQStatus.uiKeysRejected,
(unsigned)pSubQuery->SQStatus.uiKeysTraversed);
}
@@ -812,7 +809,7 @@ Output_Opt_Info:
if (pSubQuery->SQStatus.uiRefsTraversed ||
pSubQuery->SQStatus.uiRefsRejected)
{
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", RefsFailed=" F_WHITE "%u of %u",
f_logPrintf( pLogMsg, F_LIGHTGRAY ", RefsFailed=" F_WHITE "%u of %u",
(unsigned)pSubQuery->SQStatus.uiRefsRejected,
(unsigned)pSubQuery->SQStatus.uiRefsTraversed);
}
@@ -821,7 +818,7 @@ Output_Opt_Info:
pSubQuery->SQStatus.uiRecsRejected ||
pSubQuery->SQStatus.uiRecsNotFound)
{
flmLogPrintf( pLogMsg, F_LIGHTGRAY ", RecsFetched=" F_WHITE "%u"
f_logPrintf( pLogMsg, F_LIGHTGRAY ", RecsFetched=" F_WHITE "%u"
F_LIGHTGRAY ", RecsRejected=" F_WHITE "%u"
F_LIGHTGRAY ", RecsNotFound=" F_WHITE "%u",
(unsigned)pSubQuery->SQStatus.uiRecsFetchedForEval,
@@ -829,7 +826,7 @@ Output_Opt_Info:
(unsigned)pSubQuery->SQStatus.uiRecsNotFound);
}
flmLogPrintf( pLogMsg, F_LIGHTGRAY "}\n");
f_logPrintf( pLogMsg, F_LIGHTGRAY "}\n");
if (bIndentOptInfo)
{
@@ -842,9 +839,9 @@ Output_Opt_Info:
Desc: This routine logs the query criteria for a cursor.
****************************************************************************/
void flmLogQuery(
F_LogMessage * pLogMsg,
FLMUINT uiIndent,
CURSOR * pCursor)
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent,
CURSOR * pCursor)
{
SUBQUERY * pSubQuery;
QTYPES eParentOp = (pCursor->pSubQueryList &&
@@ -854,7 +851,7 @@ void flmLogQuery(
if (!uiIndent)
{
pLogMsg->setColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->changeColor( FLM_LIGHTGRAY, FLM_BLACK);
pLogMsg->appendString( "QUERY CRITERIA:");
if (!pCursor->pSubQueryList)
{
+3 -3
View File
@@ -577,9 +577,9 @@ RCODE flmCurGraftNode(
FQNODE * * ppQTree);
void flmLogQuery(
F_LogMessage * pLogMsg,
FLMUINT uiIndent,
CURSOR * pCursor);
IF_LogMessageClient * pLogMsg,
FLMUINT uiIndent,
CURSOR * pCursor);
FINLINE void flmCurFinishTransactions(
CURSOR * pCursor,
+1 -1
View File
@@ -738,7 +738,7 @@ void flmLogIndexingProgress(
FLMUINT uiLastDrn)
{
flmLogMessage(
FLM_DEBUG_MESSAGE,
F_DEBUG_MESSAGE,
FLM_YELLOW,
FLM_BLACK,
uiLastDrn
+1 -1
View File
@@ -886,7 +886,7 @@ typedef struct FLMSYSDATA
HTTPCONFIGPARAMS HttpConfigParms;
FLMUINT uiMaxFileSize;
F_Logger * pLogger;
IF_LoggerClient * pLogger;
IF_SlabManager * pSlabManager;
IF_ThreadMgr * pThreadMgr;
+3 -9
View File
@@ -666,7 +666,7 @@ DONT_PREALLOCATE:
// Log a message indicating that we couldn't pre-allocate
// the cache
flmLogMessage( FLM_DEBUG_MESSAGE, FLM_YELLOW, FLM_BLACK,
flmLogMessage( F_DEBUG_MESSAGE, FLM_YELLOW, FLM_BLACK,
"WARNING: Couldn't pre-allocate cache.");
goto DONT_PREALLOCATE;
@@ -1418,10 +1418,8 @@ FLMEXP RCODE FLMAPI FlmConfig(
f_mutexLock( gv_FlmSysData.hShareMutex);
if( !gv_FlmSysData.pLogger && Value1)
{
gv_FlmSysData.pLogger = (F_Logger *)Value1;
gv_FlmSysData.pLogger->lockLogger();
gv_FlmSysData.pLogger = (IF_LoggerClient *)Value1;
gv_FlmSysData.pLogger->AddRef();
gv_FlmSysData.pLogger->unlockLogger();
}
f_mutexUnlock( gv_FlmSysData.hShareMutex);
break;
@@ -2461,11 +2459,7 @@ FSTATIC void flmCleanup( void)
if( gv_FlmSysData.pLogger)
{
gv_FlmSysData.pLogger->lockLogger();
if( gv_FlmSysData.pLogger->Release() >= 1)
{
gv_FlmSysData.pLogger->unlockLogger();
}
gv_FlmSysData.pLogger->Release();
gv_FlmSysData.pLogger = NULL;
}
-13
View File
@@ -608,19 +608,6 @@ void F_FlmSysDataPage::write_data(
gv_FlmSysData.uiMaxFileSize,
(bHighlight = !bHighlight));
// pLogger - Logger
f_sprintf( (char *)pszTemp, "%s/Logger",
m_pszURLString);
printHTMLLink(
"pLogger",
"F_Logger *",
(void *)&gv_FlmSysData,
(void *)&gv_FlmSysData.pLogger,
(void *)gv_FlmSysData.pLogger,
(char *)pszTemp,
(bHighlight = !bHighlight));
printTableEnd();
Exit:
+2 -2
View File
@@ -7822,7 +7822,7 @@ FSTATIC RCODE scaFinishCheckpoint(
uiFirstDbInactiveSecs = FLM_TIMER_UNITS_TO_SECS( uiElapTime);
flmLogMessage(
FLM_DEBUG_MESSAGE,
F_DEBUG_MESSAGE,
FLM_YELLOW,
FLM_BLACK,
"Killed transaction 0x%08X."
@@ -7862,7 +7862,7 @@ FSTATIC RCODE scaFinishCheckpoint(
uiFirstDbInactiveSecs = FLM_TIMER_UNITS_TO_SECS( uiElapTime);
flmLogMessage(
FLM_DEBUG_MESSAGE,
F_DEBUG_MESSAGE,
FLM_YELLOW,
FLM_BLACK,
"Waiting for transaction 0x%08X to complete."