From 3c934036f8319f44f11208d95b89554952197867 Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Thu, 22 Feb 2024 13:08:50 +0000 Subject: [PATCH] HPCC-31324 New IFileIO method to flush to underlying storage Signed-off-by: Shamser Ahmed --- common/remote/hooks/azure/azurefile.cpp | 11 ++++- common/remote/hooks/git/gitfile.cpp | 20 +++++--- common/remote/hooks/libarchive/archive.cpp | 20 +++++--- common/remote/hooks/s3/s3file.cpp | 10 +++- dali/datest/datest.cpp | 17 ++++--- fs/dafsclient/rmtfile.cpp | 24 ++++++--- roxie/ccd/ccdfile.cpp | 36 ++++++++------ system/jlib/jfile.cpp | 42 ++++++++++------ system/jlib/jfile.hpp | 1 + system/jlib/jfile.ipp | 57 +++++++++++----------- system/jlib/jlzw.cpp | 5 ++ thorlcr/activities/thactivityutil.cpp | 17 ++++--- thorlcr/graph/thgraphslave.cpp | 4 ++ 13 files changed, 164 insertions(+), 100 deletions(-) diff --git a/common/remote/hooks/azure/azurefile.cpp b/common/remote/hooks/azure/azurefile.cpp index 1c8f2b44243..c6414581c67 100644 --- a/common/remote/hooks/azure/azurefile.cpp +++ b/common/remote/hooks/azure/azurefile.cpp @@ -86,7 +86,10 @@ class AzureFileReadIO : implements CInterfaceOf { } unsigned __int64 getStatistic(StatisticKind kind) override; - + virtual void flushToStorage() override + { + flush(); + } protected: size_t extractDataFromResult(size_t offset, size_t length, void * target); @@ -116,7 +119,7 @@ class AzureFileWriteIO : implements CInterfaceOf virtual void flush() override; virtual unsigned __int64 getStatistic(StatisticKind kind) override; - + virtual void flushToStorage() override; protected: Linked file; CriticalSection cs; @@ -422,6 +425,10 @@ unsigned __int64 AzureFileWriteIO::getStatistic(StatisticKind kind) return stats.getStatistic(kind); } +void AzureFileWriteIO::flushToStorage() +{ + flush(); +} //--------------------------------------------------------------------------------------------------------------------- AzureFileAppendBlobWriteIO::AzureFileAppendBlobWriteIO(AzureFile * _file) : AzureFileWriteIO(_file) diff --git a/common/remote/hooks/git/gitfile.cpp b/common/remote/hooks/git/gitfile.cpp index 1a3e7d14ebe..8fd0c55cce6 100644 --- a/common/remote/hooks/git/gitfile.cpp +++ b/common/remote/hooks/git/gitfile.cpp @@ -188,7 +188,7 @@ class GitRepositoryFileIO : implements CSimpleInterfaceOf if (isLFSfile()) readLfsContents(gitDirectory, gitUser); } - virtual size32_t read(offset_t pos, size32_t len, void * data) + virtual size32_t read(offset_t pos, size32_t len, void * data) override { if (pos >= buf.length()) return 0; @@ -197,36 +197,40 @@ class GitRepositoryFileIO : implements CSimpleInterfaceOf memcpy_iflen(data, buf.toByteArray()+pos, len); return len; } - virtual offset_t size() + virtual offset_t size() override { return buf.length(); } - virtual void close() + virtual void close() override { } // Write methods not implemented - this is a read-only file - virtual size32_t write(offset_t pos, size32_t len, const void * data) + virtual size32_t write(offset_t pos, size32_t len, const void * data) override { throwUnexpected(); } - virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=(offset_t)-1) + virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=(offset_t)-1) override { throwUnexpected(); } - virtual void setSize(offset_t size) + virtual void setSize(offset_t size) override { throwUnexpected(); } - virtual void flush() + virtual void flush() override { throwUnexpected(); } - unsigned __int64 getStatistic(StatisticKind kind) + unsigned __int64 getStatistic(StatisticKind kind) override { //This could be implemented, but not likely to be useful so currently return nothing. return 0; } + virtual void flushToStorage() override + { + throwUnexpected(); + } protected: void readLfsContents(const char *gitDirectory, const char * gitUser) diff --git a/common/remote/hooks/libarchive/archive.cpp b/common/remote/hooks/libarchive/archive.cpp index da811b75588..fd39fd939a1 100644 --- a/common/remote/hooks/libarchive/archive.cpp +++ b/common/remote/hooks/libarchive/archive.cpp @@ -222,7 +222,7 @@ class ArchiveFileIO : implements IFileIO, public CInterface #endif } - virtual size32_t read(offset_t pos, size32_t len, void * _data) + virtual size32_t read(offset_t pos, size32_t len, void * _data) override { // NOTE - we don't support multithreaded access (the sequential-only restriction would make that tricky anyway) if (pos < lastPos) @@ -259,35 +259,39 @@ class ArchiveFileIO : implements IFileIO, public CInterface lastPos = pos; return lenRequested - len; } - virtual offset_t size() + virtual offset_t size() override { return fileSize; } - virtual void close() + virtual void close() override { } // Write methods not implemented - this is a read-only file - virtual size32_t write(offset_t pos, size32_t len, const void * data) + virtual size32_t write(offset_t pos, size32_t len, const void * data) override { throwUnexpected(); } - virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=(offset_t)-1) + virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=(offset_t)-1) override { throwUnexpected(); } - virtual void setSize(offset_t size) + virtual void setSize(offset_t size) override { throwUnexpected(); } - virtual void flush() + virtual void flush() override { throwUnexpected(); } - unsigned __int64 getStatistic(StatisticKind kind) + unsigned __int64 getStatistic(StatisticKind kind) override { return 0; } + virtual void flushToStorage() override + { + throwUnexpected(); + } protected: struct archive *archive = nullptr; offset_t fileSize = 0; diff --git a/common/remote/hooks/s3/s3file.cpp b/common/remote/hooks/s3/s3file.cpp index 589a9027be6..07ae8c70dca 100644 --- a/common/remote/hooks/s3/s3file.cpp +++ b/common/remote/hooks/s3/s3file.cpp @@ -135,6 +135,10 @@ class S3FileReadIO : implements CInterfaceOf //Could implement if we use the async version of the putObject call. } unsigned __int64 getStatistic(StatisticKind kind) override; + virtual void flushToStorage() override + { + flush(); + } protected: size_t extractDataFromResult(size_t offset, size_t length, void * target); @@ -169,7 +173,7 @@ class S3FileWriteIO : implements CInterfaceOf virtual size32_t write(offset_t pos, size32_t len, const void * data) override; virtual void setSize(offset_t size) override; virtual void flush() override; - + virtual void flushToStorage() override; virtual unsigned __int64 getStatistic(StatisticKind kind) override; protected: @@ -432,6 +436,10 @@ void S3FileWriteIO::flush() { } +void S3FileWriteIO::flushToStorage() +{ +} + unsigned __int64 S3FileWriteIO::getStatistic(StatisticKind kind) { return stats.getStatistic(kind); diff --git a/dali/datest/datest.cpp b/dali/datest/datest.cpp index c0c7ecaf50d..12735367366 100644 --- a/dali/datest/datest.cpp +++ b/dali/datest/datest.cpp @@ -2900,9 +2900,9 @@ NULL CSplitIFileIO() { } void addIFileIO(IFileIO *iFileIO) { iFileIOs.append(*iFileIO); } // IFileIO - virtual size32_t read(offset_t pos, size32_t len, void * data) { UNIMPLEMENTED; return 0; } - virtual offset_t size() { UNIMPLEMENTED; return 0; } - virtual size32_t write(offset_t pos, size32_t len, const void * data) + virtual size32_t read(offset_t pos, size32_t len, void * data) override { UNIMPLEMENTED; return 0; } + virtual offset_t size() override { UNIMPLEMENTED; return 0; } + virtual size32_t write(offset_t pos, size32_t len, const void * data) override { size32_t sz = iFileIOs.item(0).write(pos, len, data); unsigned i=1; @@ -2910,11 +2910,12 @@ NULL verifyex(sz == iFileIOs.item(i).write(pos, len, data)); return sz; } - virtual unsigned __int64 getStatistic(StatisticKind kind) { return 0; } - virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=-1) { UNIMPLEMENTED; return 0; } - virtual void setSize(offset_t size) { UNIMPLEMENTED; } - virtual void flush() { } - virtual void close() { } + virtual unsigned __int64 getStatistic(StatisticKind kind) override { return 0; } + virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=-1) override { UNIMPLEMENTED; return 0; } + virtual void setSize(offset_t size) override { UNIMPLEMENTED; } + virtual void flush() override { } + virtual void flushToStorage() override { } + virtual void close() override { } }; const char *newFileName = "xpathTests.out"; diff --git a/fs/dafsclient/rmtfile.cpp b/fs/dafsclient/rmtfile.cpp index 58bf77f0118..ef92a3e9121 100644 --- a/fs/dafsclient/rmtfile.cpp +++ b/fs/dafsclient/rmtfile.cpp @@ -1296,7 +1296,7 @@ class CRemoteFileIO : public CInterfaceOf parent->disconnect(); } - void close() + void close() override { if (handle) { @@ -1379,7 +1379,7 @@ class CRemoteFileIO : public CInterfaceOf } - offset_t size() + offset_t size() override { MemoryBuffer sendBuffer; initSendBuffer(sendBuffer); @@ -1393,7 +1393,7 @@ class CRemoteFileIO : public CInterfaceOf return ret; } - virtual unsigned __int64 getStatistic(StatisticKind kind) + virtual unsigned __int64 getStatistic(StatisticKind kind) override { switch (kind) { @@ -1419,7 +1419,7 @@ class CRemoteFileIO : public CInterfaceOf return 0; } - size32_t read(offset_t pos, size32_t len, void * data) + size32_t read(offset_t pos, size32_t len, void * data) override { size32_t got; MemoryBuffer replyBuffer; @@ -1442,8 +1442,13 @@ class CRemoteFileIO : public CInterfaceOf return got; } - virtual void flush() + virtual void flush() override + { + } + + virtual void flushToStorage() override { + flush(); } const void *doRead(offset_t pos, size32_t len, MemoryBuffer &replyBuffer, size32_t &got, void *dstbuf) @@ -1514,7 +1519,7 @@ class CRemoteFileIO : public CInterfaceOf } - size32_t write(offset_t pos, size32_t len, const void * data) + size32_t write(offset_t pos, size32_t len, const void * data) override { unsigned tries=0; size32_t ret = 0; @@ -1580,7 +1585,7 @@ class CRemoteFileIO : public CInterfaceOf } - void setSize(offset_t size) + void setSize(offset_t size) override { MemoryBuffer sendBuffer; initSendBuffer(sendBuffer); @@ -2336,6 +2341,11 @@ class CRemoteFilteredFileIOBase : public CRemoteBase, implements IRemoteFileIO */ return 0; } + virtual void flushToStorage() override + { + flush(); + } + // IRemoteFileIO virtual void addVirtualFieldMapping(const char *fieldName, const char *fieldValue) override { diff --git a/roxie/ccd/ccdfile.cpp b/roxie/ccd/ccdfile.cpp index b0733aa6aa8..41de5151849 100644 --- a/roxie/ccd/ccdfile.cpp +++ b/roxie/ccd/ccdfile.cpp @@ -73,14 +73,15 @@ class CFailingFileIO : implements IFileIO, public CInterface public: IMPLEMENT_IINTERFACE; - virtual size32_t read(offset_t pos, size32_t len, void * data) { THROWNOTOPEN; } - virtual offset_t size() { THROWNOTOPEN; } - virtual void flush() { THROWNOTOPEN; } - virtual size32_t write(offset_t pos, size32_t len, const void * data) { THROWNOTOPEN; } - virtual void setSize(offset_t size) { UNIMPLEMENTED; } - virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len) { UNIMPLEMENTED; return 0; } - virtual void close() { } - virtual unsigned __int64 getStatistic(StatisticKind kind) { return 0; } + virtual size32_t read(offset_t pos, size32_t len, void * data) override { THROWNOTOPEN; } + virtual offset_t size() override { THROWNOTOPEN; } + virtual void flush() override { THROWNOTOPEN; } + virtual size32_t write(offset_t pos, size32_t len, const void * data) override { THROWNOTOPEN; } + virtual void setSize(offset_t size) override { UNIMPLEMENTED; } + virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len) override { UNIMPLEMENTED; return 0; } + virtual void close() override { } + virtual unsigned __int64 getStatistic(StatisticKind kind) override { return 0; } + virtual void flushToStorage() override { THROWNOTOPEN; } } failure; class CRoxieLazyFileIO : implements ILazyFileIO, implements IDelayedFile, public CInterface @@ -198,7 +199,7 @@ class CRoxieLazyFileIO : implements ILazyFileIO, implements IDelayedFile, public return lastAccess; } - virtual void close() + virtual void close() override { CriticalBlock b(crit); setFailure(); @@ -345,7 +346,7 @@ class CRoxieLazyFileIO : implements ILazyFileIO, implements IDelayedFile, public } } - virtual size32_t read(offset_t pos, size32_t len, void * data) + virtual size32_t read(offset_t pos, size32_t len, void * data) override { unsigned activeIdx; Owned active = getCheckOpen(activeIdx); @@ -386,7 +387,7 @@ class CRoxieLazyFileIO : implements ILazyFileIO, implements IDelayedFile, public } } - virtual void flush() + virtual void flush() override { Linked active; { @@ -397,7 +398,7 @@ class CRoxieLazyFileIO : implements ILazyFileIO, implements IDelayedFile, public active->flush(); } - virtual offset_t size() + virtual offset_t size() override { unsigned activeIdx; Owned active = getCheckOpen(activeIdx); @@ -405,15 +406,18 @@ class CRoxieLazyFileIO : implements ILazyFileIO, implements IDelayedFile, public return active->size(); } - virtual unsigned __int64 getStatistic(StatisticKind kind) + virtual unsigned __int64 getStatistic(StatisticKind kind) override { unsigned __int64 v = fileStats.getStatisticValue(kind); CriticalBlock b(crit); // don't bother with linking current and performing getStatistic outside of crit, because getStatistic is very quick return v + current->getStatistic(kind); } - - virtual size32_t write(offset_t pos, size32_t len, const void * data) { throwUnexpected(); } - virtual void setSize(offset_t size) { throwUnexpected(); } + virtual void flushToStorage() override + { + flush(); + } + virtual size32_t write(offset_t pos, size32_t len, const void * data) override { throwUnexpected(); } + virtual void setSize(offset_t size) override { throwUnexpected(); } virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len) { throwUnexpected(); return 0; } virtual const char *queryFilename() const { return logical->queryFilename(); } diff --git a/system/jlib/jfile.cpp b/system/jlib/jfile.cpp index d0496dc84df..ee87aca04e0 100644 --- a/system/jlib/jfile.cpp +++ b/system/jlib/jfile.cpp @@ -1659,7 +1659,7 @@ IFileIO *_createIFileIO(const void *buffer, unsigned sz, bool readOnly) buffer = (void *)mb.toByteArray(); sz = mb.length(); } - virtual size32_t read(offset_t pos, size32_t len, void * data) + virtual size32_t read(offset_t pos, size32_t len, void * data) override { if (pos>sz) throw MakeStringException(-1, "CMemoryBufferIO: read beyond end of buffer pos=%" I64F "d, len=%d, buffer length=%d", pos, len, mb.length()); @@ -1670,7 +1670,7 @@ IFileIO *_createIFileIO(const void *buffer, unsigned sz, bool readOnly) } virtual offset_t size() { return sz; } - virtual size32_t write(offset_t pos, size32_t len, const void * data) + virtual size32_t write(offset_t pos, size32_t len, const void * data) override { assertex(!readOnly); if (pos+len>sz) @@ -1678,18 +1678,19 @@ IFileIO *_createIFileIO(const void *buffer, unsigned sz, bool readOnly) memcpy((byte *)buffer+pos, data, len); return len; } - virtual void flush() {} - virtual void close() {} - virtual unsigned __int64 getStatistic(StatisticKind kind) + virtual void flush() override {} + virtual void close() override {} + virtual unsigned __int64 getStatistic(StatisticKind kind) override { return 0; } - virtual void setSize(offset_t size) + virtual void setSize(offset_t size) override { if (size > mb.length()) throw MakeStringException(-1, "CMemoryBufferIO: UNIMPLEMENTED, setting size %" I64F "d beyond end of buffer, buffer length=%d", size, mb.length()); mb.setLength((size32_t)size); } + virtual void flushToStorage() override {} offset_t appendFile(IFile *file,offset_t pos,offset_t len) { @@ -1872,6 +1873,11 @@ unsigned __int64 CFileIO::getStatistic(StatisticKind kind) return stats.getStatistic(kind); } +void CFileIO::flushToStorage() +{ + flush(); +} + #ifdef _WIN32 //-- Windows implementation ------------------------------------------------- @@ -2309,6 +2315,11 @@ unsigned __int64 CFileAsyncIO::getStatistic(StatisticKind kind) return 0; } +void CFileAsyncIO::flushToStorage() +{ + flush(); +} + #ifdef _WIN32 //-- Windows implementation ------------------------------------------------- @@ -2471,8 +2482,6 @@ IFileAsyncResult *CFileAsyncIO::writeAsync(offset_t pos, size32_t len, const voi return res; } - - #else //-- Unix implementation ---------------------------------------------------- @@ -7029,7 +7038,7 @@ class CCachedFileIO: implements IFileIO, public CInterface virtual bool Release(void) const; - unsigned __int64 getStatistic(StatisticKind kind) + unsigned __int64 getStatistic(StatisticKind kind) override { CriticalBlock block(sect); unsigned __int64 openValue = cachedio ? cachedio->getStatistic(kind) : 0; @@ -7038,36 +7047,40 @@ class CCachedFileIO: implements IFileIO, public CInterface IFileIO *open(); - size32_t read(offset_t pos, size32_t len, void * data) + size32_t read(offset_t pos, size32_t len, void * data) override { CriticalBlock block(sect); Owned io = open(); return io->read(pos,len,data); } - offset_t size() + offset_t size() override { CriticalBlock block(sect); Owned io = open(); return io->size(); } - size32_t write(offset_t pos, size32_t len, const void * data) + size32_t write(offset_t pos, size32_t len, const void * data) override { CriticalBlock block(sect); Owned io = open(); return io->write(pos,len,data); } - virtual void flush() + virtual void flush() override { CriticalBlock block(sect); if (cachedio) cachedio->flush(); } - virtual void close() + virtual void close() override { CriticalBlock block(sect); if (cachedio) forceClose(); } + virtual void flushToStorage() override + { + flush(); + } offset_t appendFile(IFile *file,offset_t pos,offset_t len) { CriticalBlock block(sect); @@ -7750,6 +7763,7 @@ class CBlockedFileIO : public CSimpleInterfaceOf virtual void flush() override { throwUnexpected(); } virtual void close() override { io->close(); } virtual unsigned __int64 getStatistic(StatisticKind kind) override { return io->getStatistic(kind); } + virtual void flushToStorage() override { throwUnexpected(); } }; extern IFileIO *createBlockedIO(IFileIO *base, size32_t blockSize) diff --git a/system/jlib/jfile.hpp b/system/jlib/jfile.hpp index 509200dd1c4..8889cce1582 100644 --- a/system/jlib/jfile.hpp +++ b/system/jlib/jfile.hpp @@ -182,6 +182,7 @@ interface IFileIO : public IInterface virtual void flush() = 0; virtual void close() = 0; // no other access is allowed after this call virtual unsigned __int64 getStatistic(StatisticKind kind) = 0; + virtual void flushToStorage() = 0; }; interface IFileIOCache : extends IInterface diff --git a/system/jlib/jfile.ipp b/system/jlib/jfile.ipp index dfeef77ae48..f886e84057f 100644 --- a/system/jlib/jfile.ipp +++ b/system/jlib/jfile.ipp @@ -95,15 +95,15 @@ public: ~CFileIO(); IMPLEMENT_IINTERFACE - virtual size32_t read(offset_t pos, size32_t len, void * data); - virtual offset_t size(); - virtual size32_t write(offset_t pos, size32_t len, const void * data); - virtual void setSize(offset_t size); - virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len); - virtual void flush(); - virtual void close(); - virtual unsigned __int64 getStatistic(StatisticKind kind); - + virtual size32_t read(offset_t pos, size32_t len, void * data) override; + virtual offset_t size() override; + virtual size32_t write(offset_t pos, size32_t len, const void * data) override; + virtual void setSize(offset_t size) override; + virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len) override; + virtual void flush() override; + virtual void close() override; + virtual unsigned __int64 getStatistic(StatisticKind kind) override; + virtual void flushToStorage() override; HANDLE queryHandle() { return file; } // for debugging protected: @@ -127,15 +127,15 @@ public: CFileRangeIO(IFileIO * _io, offset_t _headerSize, offset_t _maxLength); IMPLEMENT_IINTERFACE - virtual size32_t read(offset_t pos, size32_t len, void * data); - virtual offset_t size(); - virtual size32_t write(offset_t pos, size32_t len, const void * data); - virtual void setSize(offset_t size) { UNIMPLEMENTED; } - virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len) { UNIMPLEMENTED; return 0; } - virtual void flush() { io->flush(); } - virtual void close() { io->close(); } - virtual unsigned __int64 getStatistic(StatisticKind kind) { return io->getStatistic(kind); } - + virtual size32_t read(offset_t pos, size32_t len, void * data) override; + virtual offset_t size() override; + virtual size32_t write(offset_t pos, size32_t len, const void * data) override; + virtual void setSize(offset_t size) override { UNIMPLEMENTED; } + virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len) override { UNIMPLEMENTED; return 0; } + virtual void flush() override { io->flush(); } + virtual void close() override { io->close(); } + virtual unsigned __int64 getStatistic(StatisticKind kind) override { return io->getStatistic(kind); } + virtual void flushToStorage() override { io->flushToStorage(); } protected: Linked io; offset_t headerSize; @@ -182,17 +182,18 @@ public: ~CFileAsyncIO(); IMPLEMENT_IINTERFACE - virtual size32_t read(offset_t pos, size32_t len, void * data); - virtual offset_t size(); - virtual size32_t write(offset_t pos, size32_t len, const void * data); - virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len); - virtual void flush(); - virtual void close(); - virtual unsigned __int64 getStatistic(StatisticKind kind); + virtual size32_t read(offset_t pos, size32_t len, void * data) override; + virtual offset_t size() override; + virtual size32_t write(offset_t pos, size32_t len, const void * data) override; + virtual offset_t appendFile(IFile *file,offset_t pos,offset_t len) override; + virtual void flush() override; + virtual void close() override; + virtual unsigned __int64 getStatistic(StatisticKind kind) override; + virtual void flushToStorage() override; - virtual void setSize(offset_t size); - virtual IFileAsyncResult *readAsync(offset_t pos, size32_t len, void * data); - virtual IFileAsyncResult *writeAsync(offset_t pos, size32_t len, const void * data); + virtual void setSize(offset_t size) override; + virtual IFileAsyncResult *readAsync(offset_t pos, size32_t len, void * data) override; + virtual IFileAsyncResult *writeAsync(offset_t pos, size32_t len, const void * data) override; bool create(const char * filename, bool replace); bool open(const char * filename); diff --git a/system/jlib/jlzw.cpp b/system/jlib/jlzw.cpp index e67dac2d838..1b3feb201b4 100644 --- a/system/jlib/jlzw.cpp +++ b/system/jlib/jlzw.cpp @@ -2425,6 +2425,11 @@ class CCompressedFile : implements ICompressedFileIO, public CInterface { return fileio->getStatistic(kind); } + virtual void flushToStorage() override + { + flush(); // flush the CCompressedFile buffers to the underlying IFileIO + fileio->flushToStorage(); // have the underlying IFile flush it's buffers to storage + } // CCompressedFile impl. virtual unsigned dataCRC() override diff --git a/thorlcr/activities/thactivityutil.cpp b/thorlcr/activities/thactivityutil.cpp index c77f5ede002..61ed5c2c33e 100644 --- a/thorlcr/activities/thactivityutil.cpp +++ b/thorlcr/activities/thactivityutil.cpp @@ -711,14 +711,15 @@ class CWriteHandler : implements IFileIO, public CInterface } } // IFileIO impl. - virtual size32_t read(offset_t pos, size32_t len, void * data) { return primaryio->read(pos, len, data); } - virtual offset_t size() { return primaryio->size(); } - virtual size32_t write(offset_t pos, size32_t len, const void * data) { return primaryio->write(pos, len, data); } - virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=-1) { return primaryio->appendFile(file, pos, len); } - virtual unsigned __int64 getStatistic(StatisticKind kind) { return primaryio->getStatistic(kind); } - virtual void setSize(offset_t size) { primaryio->setSize(size); } - virtual void flush() { primaryio->flush(); } - virtual void close() + virtual size32_t read(offset_t pos, size32_t len, void * data) override { return primaryio->read(pos, len, data); } + virtual offset_t size() override { return primaryio->size(); } + virtual size32_t write(offset_t pos, size32_t len, const void * data) override { return primaryio->write(pos, len, data); } + virtual offset_t appendFile(IFile *file,offset_t pos=0,offset_t len=-1) override { return primaryio->appendFile(file, pos, len); } + virtual unsigned __int64 getStatistic(StatisticKind kind) override { return primaryio->getStatistic(kind); } + virtual void setSize(offset_t size) override { primaryio->setSize(size); } + virtual void flush() override{ primaryio->flush(); } + virtual void flushToStorage() override { flush(); } + virtual void close() override { checkAndHandleClose(); } diff --git a/thorlcr/graph/thgraphslave.cpp b/thorlcr/graph/thgraphslave.cpp index c510d59960b..b72fc8097f4 100644 --- a/thorlcr/graph/thgraphslave.cpp +++ b/thorlcr/graph/thgraphslave.cpp @@ -2117,6 +2117,10 @@ class CLazyFileIO : public CInterfaceOf { throwUnexpectedX("CDelayedFileWrapper::flush() called for a cached IFileIO object"); } + virtual void flushToStorage() override + { + throwUnexpectedX("CDelayedFileWrapper::flushToStorage() called for a cached IFileIO object"); + } }; class CFileCache : public CSimpleInterfaceOf