|
@@ -742,11 +742,7 @@ class CRoxieFileCache : public CInterface, implements ICopyFileProgress, impleme
|
|
StringBuffer destPath;
|
|
StringBuffer destPath;
|
|
StringBuffer prevTempFile;
|
|
StringBuffer prevTempFile;
|
|
splitFilename(targetFilename, &destPath, &destPath, &prevTempFile, &prevTempFile);
|
|
splitFilename(targetFilename, &destPath, &destPath, &prevTempFile, &prevTempFile);
|
|
-
|
|
|
|
- if (useTreeCopy)
|
|
|
|
- prevTempFile.append("*.tmp");
|
|
|
|
- else
|
|
|
|
- prevTempFile.append("*.$$$");
|
|
|
|
|
|
+ prevTempFile.append("*.$$$");
|
|
|
|
|
|
Owned<IFile> dirf = createIFile(destPath.str());
|
|
Owned<IFile> dirf = createIFile(destPath.str());
|
|
Owned<IDirectoryIterator> iter = dirf->directoryFiles(prevTempFile.str(),false,false);
|
|
Owned<IDirectoryIterator> iter = dirf->directoryFiles(prevTempFile.str(),false,false);
|
|
@@ -800,7 +796,7 @@ class CRoxieFileCache : public CInterface, implements ICopyFileProgress, impleme
|
|
{
|
|
{
|
|
IpSubNet subnet; // preferred set but not required
|
|
IpSubNet subnet; // preferred set but not required
|
|
IpAddress fromip; // returned
|
|
IpAddress fromip; // returned
|
|
- Owned<IFile> destFile = createIFile(useTreeCopy?targetFilename:tempFile);
|
|
|
|
|
|
+ Owned<IFile> destFile = createIFile(tempFile);
|
|
|
|
|
|
bool hardLinkCreated = false;
|
|
bool hardLinkCreated = false;
|
|
unsigned start = msTick();
|
|
unsigned start = msTick();
|
|
@@ -819,17 +815,11 @@ class CRoxieFileCache : public CInterface, implements ICopyFileProgress, impleme
|
|
StringBuffer str;
|
|
StringBuffer str;
|
|
str.appendf("doCopyFile %s", sourceFile->queryFilename());
|
|
str.appendf("doCopyFile %s", sourceFile->queryFilename());
|
|
TimeSection timing(str.str());
|
|
TimeSection timing(str.str());
|
|
- if (useTreeCopy)
|
|
|
|
- sourceFile->treeCopyTo(destFile, subnet, fromip, true, copyFlags);
|
|
|
|
- else
|
|
|
|
- sourceFile->copyTo(destFile,DEFAULT_COPY_BLKSIZE,NULL,false,copyFlags);
|
|
|
|
|
|
+ sourceFile->copyTo(destFile,DEFAULT_COPY_BLKSIZE,NULL,false,copyFlags);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (useTreeCopy)
|
|
|
|
- sourceFile->treeCopyTo(destFile, subnet, fromip, true, copyFlags);
|
|
|
|
- else
|
|
|
|
- sourceFile->copyTo(destFile,DEFAULT_COPY_BLKSIZE,NULL,false,copyFlags);
|
|
|
|
|
|
+ sourceFile->copyTo(destFile,DEFAULT_COPY_BLKSIZE,NULL,false,copyFlags);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
f->setCopying(false);
|
|
f->setCopying(false);
|
|
@@ -838,26 +828,20 @@ class CRoxieFileCache : public CInterface, implements ICopyFileProgress, impleme
|
|
catch(IException *E)
|
|
catch(IException *E)
|
|
{
|
|
{
|
|
f->setCopying(false);
|
|
f->setCopying(false);
|
|
- if (!useTreeCopy)
|
|
|
|
- { // done by tree copy
|
|
|
|
- EXCLOG(E, "Copy exception - remove templocal");
|
|
|
|
- destFile->remove();
|
|
|
|
- }
|
|
|
|
|
|
+ EXCLOG(E, "Copy exception - remove templocal");
|
|
|
|
+ destFile->remove();
|
|
deleteTempFiles(targetFilename);
|
|
deleteTempFiles(targetFilename);
|
|
throw;
|
|
throw;
|
|
}
|
|
}
|
|
catch(...)
|
|
catch(...)
|
|
{
|
|
{
|
|
f->setCopying(false);
|
|
f->setCopying(false);
|
|
- if (!useTreeCopy)
|
|
|
|
- { // done by tree copy
|
|
|
|
- DBGLOG("%s exception - remove templocal", msg);
|
|
|
|
- destFile->remove();
|
|
|
|
- }
|
|
|
|
|
|
+ DBGLOG("%s exception - remove templocal", msg);
|
|
|
|
+ destFile->remove();
|
|
deleteTempFiles(targetFilename);
|
|
deleteTempFiles(targetFilename);
|
|
throw;
|
|
throw;
|
|
}
|
|
}
|
|
- if (!hardLinkCreated && !useTreeCopy) // for hardlinks / treeCopy - no rename needed
|
|
|
|
|
|
+ if (!hardLinkCreated) // for hardlinks no rename needed
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|