Skip to content

Commit

Permalink
Merge pull request #17595 from jakesmith/HPCC-29746-hthor-remote-comp…
Browse files Browse the repository at this point in the history
…ressed

HPCC-29746 Fix hthor bug reading remote compressed files.

Reviewed-By: Shamser Ahmed <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jul 31, 2023
2 parents 6f3b3fb + 11a10fc commit 268f455
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions dali/base/dautils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ interface ILocalOrDistributedFile: extends IInterface
virtual bool getPartCrc(unsigned partnum, unsigned &crc) = 0;
virtual bool exists() const = 0; // if created for writing, this may be false
virtual bool isExternal() const = 0;
virtual bool isExternalFile() const = 0;
};

typedef __int64 ConnectionId;
Expand Down
4 changes: 2 additions & 2 deletions ecl/hthor/hthor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ void CHThorDiskWriteActivity::resolve()
else
throw MakeStringException(99, "Cannot write %s, file already exists (missing OVERWRITE attribute?)", lfn.str());
}
else if (f->exists() || f->isExternal() || agent.queryResolveFilesLocally())
else if (f->exists() || f->isExternalFile() || agent.queryResolveFilesLocally())
{
// special/local/external file
if (f->numParts()!=1)
Expand Down Expand Up @@ -8370,7 +8370,7 @@ void CHThorDiskReadBaseActivity::resolve()
Owned<IFileDescriptor> fdesc;
fdesc.setown(ldFile->getFileDescriptor());
gatherInfo(fdesc);
if (ldFile->isExternal())
if (ldFile->isExternalFile())
compressed = checkWriteIsCompressed(helper.getFlags(), fixedDiskRecordSize, false);//grouped=FALSE because fixedDiskRecordSize already includes grouped
IDistributedFile *dFile = ldFile->queryDistributedFile();
if (dFile) //only makes sense for distributed (non local) files
Expand Down
7 changes: 6 additions & 1 deletion esp/clients/ws_dfsclient/ws_dfsclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ class CLocalOrDistributedFile: implements ILocalOrDistributedFile, public CInter
}
if (!onlylocal)
{
if (lfn.isExternal() && !lfn.isRemote())
if (lfn.isExternalFile() || lfn.isExternalPlane())
{
Owned<IFileDescriptor> fDesc = createExternalFileDescriptor(lfn.get());
dfile.setown(queryDistributedFileDirectory().createExternal(fDesc, lfn.get()));
Expand Down Expand Up @@ -1126,6 +1126,11 @@ class CLocalOrDistributedFile: implements ILocalOrDistributedFile, public CInter
{
return lfn.isExternal();
}

virtual bool isExternalFile() const override
{
return lfn.isExternalFile() || lfn.isExternalPlane();
}
};


Expand Down

0 comments on commit 268f455

Please sign in to comment.