Skip to content

Commit

Permalink
[XrdCl] Create an interface for FD splicing.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jan 21, 2020
1 parent 2eb5c5e commit 60a1f03
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/XrdCl/XrdClFile.cc
Expand Up @@ -250,6 +250,29 @@ namespace XrdCl
return status;
}

//------------------------------------------------------------------------
// Write a data chunk from a pipe at a given offset - async
//------------------------------------------------------------------------
XRootDStatus File::Write( uint64_t offset,
uint32_t size,
DataPipe &pipe,
ResponseHandler *handler,
uint16_t timeout )
{
return XRootDStatus( stError, errNotImplemented);
}

//------------------------------------------------------------------------
// Write a data chunk from a pipe at a given offset - sync
//------------------------------------------------------------------------
XRootDStatus File::Write( uint64_t offset,
uint32_t size,
DataPipe &pipe,
uint16_t timeout )
{
return XRootDStatus( stError, errNotImplemented );
}

//----------------------------------------------------------------------------
// Commit all pending disk writes - async
//----------------------------------------------------------------------------
Expand Down
42 changes: 42 additions & 0 deletions src/XrdCl/XrdClFile.hh
Expand Up @@ -37,6 +37,7 @@ namespace XrdCl
{
class FileStateHandler;
class FilePlugIn;
class DataPipe;

//----------------------------------------------------------------------------
//! A file
Expand Down Expand Up @@ -232,6 +233,47 @@ namespace XrdCl
uint16_t timeout = 0 )
XRD_WARN_UNUSED_RESULT;

//------------------------------------------------------------------------
//! Write a data chunk from a pipe at a given offset - async
//! The call interprets and returns the server response, which may be
//! either a success or a failure, it does not contain the number
//! of bytes that were actually written.
//!
//! @param offset offset from the beginning of the file
//! @param size number of bytes to be written
//! @param buffer a pointer to the buffer holding the data to be written
//! @param handler handler to be notified when the response arrives
//! @param timeout timeout value, if 0 the environment default will be
//! used
//! @return status of the operation
//------------------------------------------------------------------------
XRootDStatus Write( uint64_t offset,
uint32_t size,
DataPipe &pipe,
ResponseHandler *handler,
uint16_t timeout = 0 )
XRD_WARN_UNUSED_RESULT;

//------------------------------------------------------------------------
//! Write a data chunk from a pipe at a given offset - sync
//! The call interprets and returns the server response, which may be
//! either a success or a failure, it does not contain the number
//! of bytes that were actually written.
//!
//! @param offset offset from the beginning of the file
//! @param size number of bytes to be written
//! @param buffer a pointer to the buffer holding the data to be
//! written
//! @param timeout timeout value, if 0 the environment default will
//! be used
//! @return status of the operation
//------------------------------------------------------------------------
XRootDStatus Write( uint64_t offset,
uint32_t size,
DataPipe &pipe,
uint16_t timeout = 0 )
XRD_WARN_UNUSED_RESULT;

//------------------------------------------------------------------------
//! Commit all pending disk writes - async
//!
Expand Down
15 changes: 15 additions & 0 deletions src/XrdCl/XrdClPlugInInterface.hh
Expand Up @@ -30,6 +30,8 @@

namespace XrdCl
{
class DataPipe;

//----------------------------------------------------------------------------
//! An interface for file plug-ins
//----------------------------------------------------------------------------
Expand Down Expand Up @@ -101,6 +103,19 @@ namespace XrdCl
return XRootDStatus( stError, errNotImplemented );
}

//------------------------------------------------------------------------
//! @see XrdCl::File::Write
//------------------------------------------------------------------------
virtual XRootDStatus Write( uint64_t offset,
uint32_t size,
DataPipe &pipe,
ResponseHandler *handler,
uint16_t timeout = 0 )
{
(void)offset; (void)size; (void)pipe; (void)handler; (void)timeout;
return XRootDStatus( stError, errNotImplemented );
}

//------------------------------------------------------------------------
//! @see XrdCl::File::Sync
//------------------------------------------------------------------------
Expand Down

0 comments on commit 60a1f03

Please sign in to comment.