Skip to content

Commit

Permalink
Add asynchronous read.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja authored and abh3 committed Jun 30, 2016
1 parent 3733f2a commit 4b1eedd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/XrdFileCache/XrdFileCacheIOEntireFile.cc
Expand Up @@ -65,6 +65,11 @@ XrdOucCacheIO *IOEntireFile::Detach()
return io;
}

void IOEntireFile::Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
{
iocb.Done(IOEntireFile::Read(buff, offs, rlen));
}

int IOEntireFile::Read (char *buff, long long off, int size)
{
clLog()->Debug(XrdCl::AppMsg, "IOEntireFile::Read() [%p] %lld@%d %s", this, off, size, m_io.Path());
Expand Down
13 changes: 13 additions & 0 deletions src/XrdFileCache/XrdFileCacheIOEntireFile.hh
Expand Up @@ -61,6 +61,19 @@ namespace XrdFileCache
//---------------------------------------------------------------------
virtual int Read(char *Buffer, long long Offset, int Length);

//---------------------------------------------------------------------
//! Asynchronous read.
//!
//! @param callback
//! @param Buffer
//! @param Offset
//! @param Length
//!
//! @return number of bytes read
//---------------------------------------------------------------------
virtual void Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen);


//---------------------------------------------------------------------
//! Pass ReadV request to the corresponding File object.
//!
Expand Down

0 comments on commit 4b1eedd

Please sign in to comment.