本文整理汇总了C++中RemoteFilename::getPath方法的典型用法代码示例。如果您正苦于以下问题:C++ RemoteFilename::getPath方法的具体用法?C++ RemoteFilename::getPath怎么用?C++ RemoteFilename::getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RemoteFilename
的用法示例。
在下文中一共展示了RemoteFilename::getPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cancelReplicates
void cancelReplicates(CActivityBase *activity, IPartDescriptor &partDesc)
{
RemoteFilename rfn;
IFileDescriptor &fileDesc = partDesc.queryOwner();
unsigned copies = partDesc.numCopies();
unsigned c=1;
for (; c<copies; c++)
{
unsigned replicateCopy;
unsigned clusterNum = partDesc.copyClusterNum(c, &replicateCopy);
rfn.clear();
partDesc.getFilename(c, rfn);
StringBuffer dstName;
rfn.getPath(dstName);
assertex(dstName.length());
if (replicateCopy>0)
{
try
{
queryThor().queryBackup().cancel(dstName.str());
}
catch (IException *e)
{
Owned<IThorException> re = MakeActivityException(activity, e, "Error cancelling backup '%s'", dstName.str());
ActPrintLog(&activity->queryContainer(), e, NULL);
e->Release();
}
}
}
}
示例2: createKeyIndex
static IKeyIndex *openKeyPart(CActivityBase *activity, const char *logicalFilename, IPartDescriptor &partDesc)
{
RemoteFilename rfn;
partDesc.getFilename(0, rfn);
StringBuffer filePath;
rfn.getPath(filePath);
unsigned crc=0;
partDesc.getCrc(crc);
Owned<IDelayedFile> lfile = queryThor().queryFileCache().lookup(*activity, partDesc);
return createKeyIndex(filePath.str(), crc, *lfile, false, false);
}
示例3: renameDfuTempToFinal
void renameDfuTempToFinal(const RemoteFilename & realname)
{
RemoteFilename tempFilename;
StringBuffer newTailname;
getDfuTempName(tempFilename, realname);
realname.getTail(newTailname);
OwnedIFile output = createIFile(tempFilename);
try
{
output->rename(newTailname);
}
catch (IException * e)
{
EXCLOG(e, "Failed to rename target file");
StringBuffer oldName;
realname.getPath(oldName);
LOG(MCdebugInfoDetail, unknownJob, "Error: Rename %s->%s failed - tring to delete target and rename again", oldName.str(), newTailname.str());
e->Release();
OwnedIFile old = createIFile(realname);
old->remove();
output->rename(newTailname);
}
}
示例4: publish
void CWriteMasterBase::publish()
{
if (published) return;
published = true;
if (!(diskHelperBase->getFlags() & (TDXtemporary|TDXjobtemp)))
updateActivityResult(container.queryJob().queryWorkUnit(), diskHelperBase->getFlags(), diskHelperBase->getSequence(), fileName, recordsProcessed);
IPropertyTree &props = fileDesc->queryProperties();
props.setPropInt64("@recordCount", recordsProcessed);
if (0 == (diskHelperBase->getFlags() & TDXtemporary) || container.queryJob().queryUseCheckpoints())
{
if (0 != (diskHelperBase->getFlags() & TDWexpires))
setExpiryTime(props, diskHelperBase->getExpiryDays());
if (TDWupdate & diskHelperBase->getFlags())
{
unsigned eclCRC;
unsigned __int64 totalCRC;
diskHelperBase->getUpdateCRCs(eclCRC, totalCRC);
props.setPropInt("@eclCRC", eclCRC);
props.setPropInt64("@totalCRC", totalCRC);
}
}
container.queryTempHandler()->registerFile(fileName, container.queryOwner().queryGraphId(), diskHelperBase->getTempUsageCount(), TDXtemporary & diskHelperBase->getFlags(), getDiskOutputKind(diskHelperBase->getFlags()), &clusters);
if (!dlfn.isExternal())
{
bool temporary = 0 != (diskHelperBase->getFlags()&TDXtemporary);
if (!temporary && (queryJob().querySlaves() < fileDesc->numParts()))
{
// create empty parts for a fileDesc being published that is larger than this clusters
size32_t recordSize = 0;
IOutputMetaData *diskRowMeta = diskHelperBase->queryDiskRecordSize()->querySerializedDiskMeta();
if (diskRowMeta->isFixedSize() && (TAKdiskwrite == container.getKind()))
{
recordSize = diskRowMeta->getMinRecordSize();
if (0 != (diskHelperBase->getFlags() & TDXgrouped))
recordSize += 1;
}
unsigned compMethod = COMPRESS_METHOD_LZW;
// rowdiff used if recordSize > 0, else fallback to compMethod
if (getOptBool(THOROPT_COMP_FORCELZW, false))
{
recordSize = 0; // by default if fixed length (recordSize set), row diff compression is used. This forces compMethod.
compMethod = COMPRESS_METHOD_LZW;
}
else if (getOptBool(THOROPT_COMP_FORCEFLZ, false))
compMethod = COMPRESS_METHOD_FASTLZ;
else if (getOptBool(THOROPT_COMP_FORCELZ4, false))
compMethod = COMPRESS_METHOD_LZ4;
bool blockCompressed;
bool compressed = fileDesc->isCompressed(&blockCompressed);
for (unsigned clusterIdx=0; clusterIdx<fileDesc->numClusters(); clusterIdx++)
{
StringBuffer clusterName;
fileDesc->getClusterGroupName(clusterIdx, clusterName, &queryNamedGroupStore());
PROGLOG("Creating blank parts for file '%s', cluster '%s'", fileName.get(), clusterName.str());
unsigned p=0;
while (p<fileDesc->numParts())
{
if (p == targetOffset)
p += queryJob().querySlaves();
IPartDescriptor *partDesc = fileDesc->queryPart(p);
CDateTime createTime, modifiedTime;
for (unsigned c=0; c<partDesc->numCopies(); c++)
{
RemoteFilename rfn;
partDesc->getFilename(c, rfn);
StringBuffer path;
rfn.getPath(path);
try
{
ensureDirectoryForFile(path.str());
OwnedIFile iFile = createIFile(path.str());
Owned<IFileIO> iFileIO;
if (compressed)
iFileIO.setown(createCompressedFileWriter(iFile, recordSize, false, true, NULL, compMethod));
else
iFileIO.setown(iFile->open(IFOcreate));
dbgassertex(iFileIO.get());
iFileIO.clear();
// ensure copies have matching datestamps, as they would do normally (backupnode expects it)
if (partDesc->numCopies() > 1)
{
if (0 == c)
iFile->getTime(&createTime, &modifiedTime, NULL);
else
iFile->setTime(&createTime, &modifiedTime, NULL);
}
}
catch (IException *e)
{
if (0 == c)
throw;
Owned<IThorException> e2 = MakeThorException(e);
e->Release();
e2->setAction(tea_warning);
queryJob().fireException(e2);
}
}
partDesc->queryProperties().setPropInt64("@size", 0);
p++;
//.........这里部分代码省略.........
示例5: _doReplicate
static void _doReplicate(CActivityBase *activity, IPartDescriptor &partDesc, ICopyFileProgress *iProgress)
{
StringBuffer primaryName;
getPartFilename(partDesc, 0, primaryName);;
RemoteFilename rfn;
IFileDescriptor &fileDesc = partDesc.queryOwner();
unsigned copies = partDesc.numCopies();
unsigned c=1;
for (; c<copies; c++)
{
unsigned replicateCopy;
unsigned clusterNum = partDesc.copyClusterNum(c, &replicateCopy);
rfn.clear();
partDesc.getFilename(c, rfn);
StringBuffer dstName;
rfn.getPath(dstName);
assertex(dstName.length());
if (replicateCopy>0 )
{
try
{
queryThor().queryBackup().backup(dstName.str(), primaryName.str());
}
catch (IException *e)
{
Owned<IThorException> re = MakeActivityWarning(activity, e, "Failed to create replicate file '%s'", dstName.str());
e->Release();
activity->fireException(re);
}
}
else // another primary
{
ActPrintLog(activity, "Copying to primary %s", dstName.str());
StringBuffer tmpName(dstName.str());
tmpName.append(".tmp");
OwnedIFile tmpIFile = createIFile(tmpName.str());
OwnedIFile srcFile = createIFile(primaryName.str());
CFIPScope fipScope(tmpName.str());
try
{
try
{
ensureDirectoryForFile(dstName.str());
::copyFile(tmpIFile, srcFile, 0x100000, iProgress);
}
catch (IException *e)
{
IThorException *re = MakeActivityException(activity, e, "Failed to copy to tmp file '%s' from source file '%s'", tmpIFile->queryFilename(), srcFile->queryFilename());
e->Release();
throw re;
}
try
{
OwnedIFile dstIFile = createIFile(dstName.str());
dstIFile->remove();
tmpIFile->rename(pathTail(dstName.str()));
}
catch (IException *e)
{
IThorException *re = ThorWrapException(e, "Failed to rename '%s' to '%s'", tmpName.str(), dstName.str());
e->Release();
throw re;
}
}
catch (IException *)
{
try { tmpIFile->remove(); }
catch (IException *e) { ActPrintLog(&activity->queryContainer(), e, NULL); e->Release(); }
throw;
}
}
}
}