本文整理汇总了C++中EXCLOG函数的典型用法代码示例。如果您正苦于以下问题:C++ EXCLOG函数的具体用法?C++ EXCLOG怎么用?C++ EXCLOG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EXCLOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CATCH_NEXTROW
CATCH_NEXTROW()
{
ActivityTimer t(totalCycles, timeActivities, NULL);
if(abortSoon || eof || eogNext)
{
eogNext = false;
return NULL;
}
if (refill) {
refill=false;
index=0;
try
{
group.reset(false);
loop {
OwnedConstThorRow row = input->nextRow();
if (!row)
break;
group.append(row.getClear());
if (group.isFull()) {
StringBuffer errStr("GROUPSORT");
errStr.append("(").append(container.queryId()).append(") ");
errStr.append("exceeded available memory. records=").append(group.ordinality()).append(", memory usage=").append((unsigned)(group.totalSize()/1024)).append('k');
IException *e = MakeActivityException(this, TE_TooMuchData, "%s", errStr.str());
EXCLOG(e, NULL);
throw e;
}
}
if (group.ordinality()==0) {
eof = true;
return NULL;
}
group.sort(*icompare,!unstable);
}
catch (IOutOfMemException *e)
{
StringBuffer errStr("GROUPSORT");
errStr.append("(").append(container.queryId()).append(") ");
errStr.append("exceeded available memory. records=").append(group.ordinality()).append(", memory usage=").append((unsigned)(group.totalSize()/1024)).append('k');
errStr.append(": ").append(e->errorCode()).append(", ");
e->errorMessage(errStr);
e->Release();
IException *e2 = MakeActivityException(this, TE_TooMuchData, "%s", errStr.str());
EXCLOG(e2, NULL);
throw e2;
}
}
if(index >= group.ordinality())
{
refill = true;
return NULL; // eog
}
const void *row = group.itemClear(index++);
assertex(row);
dataLinkIncrement();
return row;
}
示例2: ActPrintLog
void CDiskWriteSlaveActivityBase::process()
{
calcFileCrc = false;
uncompressedBytesWritten = 0;
replicateDone = 0;
StringBuffer tmpStr;
fName.set(getPartFilename(*partDesc, 0, tmpStr).str());
if (diskHelperBase->getFlags() & TDXtemporary && !container.queryJob().queryUseCheckpoints())
container.queryTempHandler()->registerFile(fName, container.queryOwner().queryGraphId(), usageCount, true);
try
{
ActPrintLog("handling fname : %s", fName.get());
try
{
open();
assertex(out||outraw);
write();
}
catch (IException *)
{
abortSoon = true;
try { close(); }
catch (IException *e)
{
EXCLOG(e, "close()");
e->Release();
}
throw;
}
catch (CATCHALL)
{
abortSoon = true;
try { close(); }
catch (IException *e)
{
EXCLOG(e, "close()");
e->Release();
}
throw;
}
close();
}
catch (IException *)
{
calcFileCrc = false;
throw;
}
catch(CATCHALL)
{
calcFileCrc = false;
throw;
}
unsigned crc = compress?~0:fileCRC.get();
ActPrintLog("Wrote %" RCPF "d records%s", processed & THORDATALINK_COUNT_MASK, calcFileCrc?StringBuffer(", crc=0x").appendf("%X", crc).str() : "");
}
示例3: deleteEmptyDir
static bool deleteEmptyDir(IFile *dir)
{
// this is a bit odd - basically we already know no files but there may be empty sub-dirs
Owned<IDirectoryIterator> iter = dir->directoryFiles(NULL,false,true);
IArrayOf<IFile> subdirs;
bool candelete = true;
ForEach(*iter) {
if (iter->isDir())
subdirs.append(iter->get());
else
candelete = false;
}
if (!candelete)
return false;
try {
ForEachItemIn(i,subdirs) {
if (!deleteEmptyDir(&subdirs.item(i)))
candelete = false;
}
}
catch (IException *e) {
EXCLOG(e,"deleteEmptyDir");
candelete = false;
}
if (!candelete)
return false;
static CriticalSection sect;
CriticalBlock block(sect); // don't want to actually remove in parallel
dir->remove();
return !dir->exists();
}
示例4: main
virtual void main()
{
running = true;
loop
{
INode *senderNode;
CMessageBuffer msg;
if (!queryWorldCommunicator().recv(msg, NULL, MPTAG_THORREGISTRATION, &senderNode))
return;
rank_t sender = queryNodeGroup().rank(senderNode);
SocketEndpoint ep = senderNode->endpoint();
StringBuffer url;
ep.getUrlStr(url);
if (RANK_NULL == sender)
{
PROGLOG("Node %s trying to deregister is not part of this cluster", url.str());
continue;
}
RegistryCode code;
msg.read((int &)code);
if (rc_deregister != code)
throwUnexpected();
Owned<IException> e = deserializeException(msg);
if (e.get())
EXCLOG(e, "Slave unregistered with exception");
registry.deregisterNode(sender-1);
}
running = false;
}
示例5: assertex
//cloned from hthor - a candidate for commoning up.
static IKeyIndex *openKeyFile(IDistributedFilePart *keyFile)
{
unsigned numCopies = keyFile->numCopies();
assertex(numCopies);
for (unsigned copy=0; copy < numCopies; copy++)
{
RemoteFilename rfn;
try
{
OwnedIFile ifile = createIFile(keyFile->getFilename(rfn,copy));
unsigned __int64 thissize = ifile->size();
if (thissize != -1)
{
StringBuffer remotePath;
rfn.getRemotePath(remotePath);
unsigned crc = 0;
keyFile->getCrc(crc);
return createKeyIndex(remotePath.str(), crc, false, false);
}
}
catch (IException *E)
{
EXCLOG(E, "While opening index file");
E->Release();
}
}
RemoteFilename rfn;
StringBuffer url;
keyFile->getFilename(rfn).getRemotePath(url);
throw MakeStringException(1001, "Could not open key file at %s%s", url.str(), (numCopies > 1) ? " or any alternate location." : ".");
}
示例6: main
int main(int argc, char * const * argv)
{
InitModuleObjects();
try
{
KeyPatchParams params;
getParams(argc, argv, params);
Owned<IKeyDiffApplicator> applicator;
if(params.mode == KEYPATCH_explicit)
applicator.setown(createKeyDiffApplicator(params.patch.str(), params.oldIndex.str(), params.newIndex.str(), params.newTLK.str(), params.overwrite, params.ignoreTLK));
else
applicator.setown(createKeyDiffApplicator(params.patch.str(), params.overwrite, params.ignoreTLK));
if(params.mode == KEYPATCH_info)
showInfo(params.patch.str(), applicator);
else
{
if(params.xmitTLK)
applicator->setTransmitTLK(new CNodeSender(params.tlkPort, params.xmitEp));
else if(params.recvTLK)
applicator->setReceiveTLK(new CNodeReceiver(params.tlkPort), params.recvNum);
if(params.progressFrequency)
applicator->setProgressCallback(new KeyPatchProgressCallback, params.progressFrequency);
applicator->run();
}
}
catch(IException * e)
{
EXCLOG(e);
e->Release();
releaseAtoms();
return 1;
}
releaseAtoms();
return 0;
}
示例7: main
int main(int argc, char* argv[])
{
InitModuleObjects();
EnableSEHtoExceptionMapping();
if (argc<6)
{
usage();
return 0;
}
try
{
const char *filename = argv[1];
Owned<IDaliCapabilityCreator> cc = createDaliCapabilityCreator();
cc->setSystemID(argv[2]);
cc->setServerPassword(argv[3]);
for (unsigned i=4;i<argc;i++) {
const char *cmd = argv[i++];
if (i==argc)
break;
const char *param = argv[i];
if (stricmp(cmd,"THORWIDTH")==0) {
cc->setLimit(DCR_ThorSlave,atoi(param));
}
else if (stricmp(cmd,"DALINODE")==0) {
StringBuffer mac;
if (strchr(param,'.')) { // must be ip
IpAddress ip;
ip.set(param);
if (!getMAC(ip,mac)) {
printf("ERROR: could mot get MAC address for %s\n",param);
return 1;
}
}
else
mac.append(param);
cc->addCapability(DCR_DaliServer,mac.str());
}
else {
printf("ERROR: unknown command %s\n",cmd);
return 1;
}
}
StringBuffer results;
cc->save(results);
Owned<IFile> ifile = createIFile(filename);
Owned<IFileIO> ifileio = ifile->open(IFOcreate);
ifileio->write(0,results.length(),results.str());
printf("Dali Capabilities sucessfully exported to %s\n", filename);
}
catch (IException *e)
{
EXCLOG(e);
e->Release();
}
releaseAtoms();
return 0;
}
示例8: nextSmartEndpoint
ISmartSocket *CSmartSocketFactory::connect_timeout( unsigned timeoutms)
{
SmartSocketEndpoint *ss = nextSmartEndpoint();
if (!ss)
throw createSmartSocketException(0, "smartsocket failed to get nextEndpoint");
ISocket *sock = NULL;
SocketEndpoint ep;
try
{
{
synchronized block(lock);
ss->checkHost(dnsInterval);
ep = ss->ep;
}
if (timeoutms)
sock = ISocket::connect_timeout(ep, timeoutms);
else
sock = ISocket::connect(ep);
return new CSmartSocket(sock, ep, this);
}
catch (IException *e)
{
StringBuffer s("CSmartSocketFactory::connect ");
ep.getUrlStr(s);
EXCLOG(e,s.str());
ss->status=false;
if (sock)
sock->Release();
throw;
}
}
示例9: malloc
void *CJHTreeNode::allocMem(size32_t len)
{
char *ret = (char *) malloc(len);
if (!ret)
{
Owned<IException> E = MakeStringException(MSGAUD_operator,0, "Out of memory in CJHTreeNode::allocMem, requesting %d bytes", len);
EXCLOG(E);
if (flushJHtreeCacheOnOOM)
{
clearKeyStoreCache(false);
ret = (char *) malloc(len);
}
if (!ret)
throw E.getClear();
}
unsigned __int64 _totalAllocatedCurrent;
unsigned __int64 _totalAllocatedEver;
unsigned _countAllocationsCurrent;
unsigned _countAllocationsEver;
{
SpinBlock b(spin);
totalAllocatedCurrent += len;
totalAllocatedEver += len;
countAllocationsCurrent ++;
countAllocationsEver ++;
_totalAllocatedCurrent = totalAllocatedCurrent;
_totalAllocatedEver = totalAllocatedEver;
_countAllocationsCurrent = countAllocationsCurrent;
_countAllocationsEver = countAllocationsEver;
}
if (traceJHtreeAllocations)
DBGLOG("JHTREE memory usage: Allocated %d - %" I64F "d currently allocated in %d allocations", len, _totalAllocatedCurrent, _countAllocationsCurrent);
return ret;
}
示例10: Do
void Do(unsigned i)
{
CriticalBlock block(crit);
if (parent->stopped)
return;
CFileCrcItem &item = parent->list.item(i);
RemoteFilename &rfn = item.filename;
Owned<IFile> partfile;
StringBuffer eps;
try
{
partfile.setown(createIFile(rfn));
// PROGLOG("VERIFY: part %s on %s",partfile->queryFilename(),rfn.queryEndpoint().getUrlStr(eps).str());
if (partfile) {
if (parent->stopped)
return;
CriticalUnblock unblock(crit);
item.crc = partfile->getCRC();
}
else
ok = false;
}
catch (IException *e)
{
StringBuffer s;
s.appendf("VERIFY: part %s on %s",partfile->queryFilename(),rfn.queryEndpoint().getUrlStr(eps).str());
EXCLOG(e, s.str());
e->Release();
ok = false;
}
}
示例11: DBGLOG
bool SafePluginMap::addPlugin(const char *path, const char *dllname)
{
if (!endsWithIgnoreCase(path, SharedObjectExtension))
{
if (trace)
DBGLOG("Ecl plugin %s ignored", path);
return false;
}
try
{
CriticalBlock b(crit);
ILoadedDllEntry *dll = map.getValue(dllname);
if (!dll)
{
Owned<PluginDll> n = new PluginDll(path, NULL);
if (!n->load(true, false) || !n->init(pluginCtx))
throw MakeStringException(0, "Failed to load plugin %s", path);
if (trace)
n->logLoaded();
map.setValue(dllname, n); // note: setValue links arg
return true;
}
return false;
}
catch (IException * e) // MORE - not sure why we don't throw exceptions back here...
{
EXCLOG(e, "Loading plugin");
e->Release();
return false;
}
}
示例12: WARNLOG
void CEclAgentExecutionServer::start(StringBuffer & codeDir)
{
if (started)
{
WARNLOG("START called when already started\n");
assert(false);
}
codeDirectory = codeDir;
StringBuffer propertyFile = codeDirectory;
addPathSepChar(propertyFile);
propertyFile.append("agentexec.xml");
Owned<IPropertyTree> properties;
try
{
DBGLOG("AgentExec: Loading properties file '%s'\n", propertyFile.str());
properties.setown(createPTreeFromXMLFile(propertyFile.str()));
}
catch (IException *e)
{
EXCLOG(e, "Error processing properties file\n");
throwUnexpected();
}
{
//Build logfile from component properties settings
Owned<IComponentLogFileCreator> lf = createComponentLogFileCreator(properties, "eclagent");
lf->setCreateAliasFile(false);
lf->setMsgFields(MSGFIELD_timeDate | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code);
lf->beginLogging();
PROGLOG("Logging to %s",lf->queryLogFileSpec());
}
//get name of workunit job queue
StringBuffer sb;
properties->getProp("@name", sb.clear());
agentName.set(sb);
if (!agentName.length())
{
ERRLOG("'name' not specified in properties file\n");
throwUnexpected();
}
//get dali server(s)
properties->getProp("@daliServers", daliServers);
if (!daliServers.length())
{
ERRLOG("'daliServers' not specified in properties file\n");
throwUnexpected();
}
started = true;
Thread::start();
Thread::join();
}
示例13: notifySelected
bool notifySelected(ISocket *sock,unsigned selected)
{
while (!done) {
try {
if (closing) {
closing = false;
#ifdef _FULL_TRACE
PROGLOG("notifySelected calling closedown");
#endif
closedown();
#ifdef _FULL_TRACE
PROGLOG("notifySelected called closedown");
#endif
done = true;
donesem.signal();
return false;
}
}
catch (IException *e) {
EXCLOG(e,"CSortMerge notifySelected.1");
exception.setown(e);
done = true;
donesem.signal();
return false;
}
try {
if (processRows())
return false; // false correct here
}
catch (IException *e) {
EXCLOG(e,"CSortMerge notifySelected.2");
exception.setown(e);
}
closing = true;
CriticalBlock block(crit);
if (!sock||!socket)
break;
if (sock->avail_read()==0)
break;
}
return false; // false correct here
}
示例14: main
int main( int argc, char *argv[] )
{
int res=0;
if (argc < 3)
{
printf
("frunssh <nodelistfile> \"command\" [options] \n"
" options: -i:<identity-file> \n"
" -u:<user> \n"
" -n:<number_of_threads>\n"
" -t:<connect-timeout-secs>\n"
" -a:<connect-attempts>\n"
" -d:<working_directory>\n"
" -s -- strict, must match known_hosts\n"
" -b -- background\n"
" -pw:<password> -- INSECURE: requires pssh (NB identity file preferred)\n"
" -pe:<password> -- INSECURE: as -pw except encrypted password\n"
" -pl -- use plink (on windows)\n"
" -v -- verbose, lists commands run\n"
" -d -- dry run (for testing, enables verbose)\n"
);
return 255;
}
InitModuleObjects();
#ifndef __64BIT__
// Restrict stack sizes on 32-bit systems
Thread::setDefaultStackSize(0x10000); // NB under windows requires linker setting (/stack:)
#endif
try {
StringBuffer logname;
splitFilename(argv[0], NULL, NULL, &logname, NULL);
Owned<IComponentLogFileCreator> lf = createComponentLogFileCreator("frunssh");
lf->setCreateAliasFile(false);
lf->setMsgFields(MSGFIELD_prefix);
lf->beginLogging();
Owned<IFRunSSH> runssh = createFRunSSH();
runssh->init(argc,argv);
runssh->exec();
}
catch(IException *e)
{
EXCLOG(e,"frunssh");
e->Release();
res=255;
}
releaseAtoms();
return res;
}
示例15: done
virtual void done()
{
StringBuffer scopedName;
OwnedRoxieString outputName(helper->getOutputName());
queryThorFileManager().addScope(container.queryJob(), outputName, scopedName);
Owned<IWorkUnit> wu = &container.queryJob().queryWorkUnit().lock();
Owned<IWUResult> r = wu->updateResultBySequence(helper->getSequence());
r->setResultStatus(ResultStatusCalculated);
r->setResultLogicalName(scopedName.str());
r.clear();
wu.clear();
IPropertyTree &patchProps = patchDesc->queryProperties();
if (0 != (helper->getFlags() & KDPexpires))
setExpiryTime(patchProps, helper->getExpiryDays());
IPropertyTree &originalProps = originalDesc->queryProperties();;
if (originalProps.queryProp("ECL"))
patchProps.setProp("ECL", originalProps.queryProp("ECL"));
if (originalProps.getPropBool("@local"))
patchProps.setPropBool("@local", true);
container.queryTempHandler()->registerFile(outputName, container.queryOwner().queryGraphId(), 0, false, WUFileStandard, &clusters);
Owned<IDistributedFile> patchFile;
// set part sizes etc
queryThorFileManager().publish(container.queryJob(), outputName, false, *patchDesc, &patchFile, 0, false);
try { // set file size
if (patchFile) {
__int64 fs = patchFile->getFileSize(true,false);
if (fs!=-1)
patchFile->queryAttributes().setPropInt64("@size",fs);
}
}
catch (IException *e) {
EXCLOG(e,"keydiff setting file size");
e->Release();
}
// Add a new 'Patch' description to the secondary key.
DistributedFilePropertyLock lock(newIndexFile);
IPropertyTree &fileProps = lock.queryAttributes();
StringBuffer path("Patch[@name=\"");
path.append(scopedName.str()).append("\"]");
IPropertyTree *patch = fileProps.queryPropTree(path.str());
if (!patch) patch = fileProps.addPropTree("Patch", createPTree());
patch->setProp("@name", scopedName.str());
unsigned checkSum;
if (patchFile->getFileCheckSum(checkSum))
patch->setPropInt64("@checkSum", checkSum);
IPropertyTree *index = patch->setPropTree("Index", createPTree());
index->setProp("@name", originalIndexFile->queryLogicalName());
if (originalIndexFile->getFileCheckSum(checkSum))
index->setPropInt64("@checkSum", checkSum);
originalIndexFile->setAccessed();
newIndexFile->setAccessed();
}