ARC SDK
Public Member Functions | Protected Member Functions | Protected Attributes
Arc::DataPointIndex Class Reference

DataPointIndex represents "index" data objects, e.g. catalogs. More...

#include <arc/data/DataPointIndex.h>

Inheritance diagram for Arc::DataPointIndex:
Arc::DataPoint

Public Member Functions

virtual const URLCurrentLocation () const
 Returns current (resolved) URL. More...
 
virtual const std::string & CurrentLocationMetadata () const
 Returns meta information used to create current URL. More...
 
virtual DataPointCurrentLocationHandle () const
 Returns a pointer to the DataPoint representing the current location. More...
 
virtual DataStatus CompareLocationMetadata () const
 Compare metadata of DataPoint and current location. More...
 
virtual bool NextLocation ()
 Switch to next location in list of URLs. More...
 
virtual bool LocationValid () const
 Returns false no more locations are left and out of retries. More...
 
virtual bool HaveLocations () const
 Returns true if number of resolved URLs is not 0. More...
 
virtual bool LastLocation ()
 Returns true if the current location is the last. More...
 
virtual DataStatus RemoveLocation ()
 Remove current URL from list. More...
 
virtual DataStatus RemoveLocations (const DataPoint &p)
 Remove locations present in another DataPoint object. More...
 
virtual DataStatus ClearLocations ()
 Remove all locations. More...
 
virtual DataStatus AddLocation (const URL &url, const std::string &meta)
 Add URL representing physical replica to list of locations. More...
 
virtual void SortLocations (const std::string &pattern, const URLMap &url_map)
 Sort locations according to the specified pattern and URLMap. More...
 
virtual bool IsIndex () const
 Check if URL is an Indexing Service. More...
 
virtual bool IsStageable () const
 Check if URL should be staged or queried for Transport URL (TURL) More...
 
virtual bool AcceptsMeta () const
 Check if endpoint can have any use from meta information. More...
 
virtual bool ProvidesMeta () const
 Check if endpoint can provide at least some meta information directly. More...
 
virtual void SetMeta (const DataPoint &p)
 Copy meta information from another object. More...
 
virtual void SetCheckSum (const std::string &val)
 Set value of meta-information 'checksum'. More...
 
virtual void SetSize (const unsigned long long int val)
 Set value of meta-information 'size'. More...
 
virtual bool Registered () const
 Returns true if file is registered in indexing service (only known after Resolve()) More...
 
virtual bool SupportsTransfer () const
 Returns true if DataPoint supports internal transfer. More...
 
virtual void SetTries (const int n)
 Set number of retries. More...
 
virtual long long int BufSize () const
 Get suggested buffer size for transfers. More...
 
virtual int BufNum () const
 Get suggested number of buffers for transfers. More...
 
virtual bool Local () const
 Returns true if file is local, e.g. file:// urls. More...
 
virtual bool ReadOnly () const
 Returns true if file is readonly. More...
 
virtual DataStatus PrepareReading (unsigned int timeout, unsigned int &wait_time)
 Prepare DataPoint for reading. More...
 
virtual DataStatus PrepareWriting (unsigned int timeout, unsigned int &wait_time)
 Prepare DataPoint for writing. More...
 
virtual DataStatus StartReading (DataBuffer &buffer)
 Start reading data from URL. More...
 
virtual DataStatus StartWriting (DataBuffer &buffer, DataCallback *space_cb=NULL)
 Start writing data to URL. More...
 
virtual DataStatus StopReading ()
 Stop reading. More...
 
virtual DataStatus StopWriting ()
 Stop writing. More...
 
virtual DataStatus FinishReading (bool error=false)
 Finish reading from the URL. More...
 
virtual DataStatus FinishWriting (bool error=false)
 Finish writing to the URL. More...
 
virtual std::vector< URLTransferLocations () const
 Returns physical file(s) to read/write, if different from CurrentLocation() More...
 
virtual void ClearTransferLocations ()
 Clear list of physical file(s) to read/write. More...
 
virtual DataStatus Transfer (const URL &otherendpoint, bool source, TransferCallback callback=NULL)
 Do a transfer in a single operation. More...
 
virtual DataStatus Check (bool check_meta)
 Query the DataPoint to check if object is accessible. More...
 
virtual DataStatus Remove ()
 Remove/delete object at URL. More...
 
virtual void ReadOutOfOrder (bool v)
 Allow/disallow DataPoint to read data out of order. More...
 
virtual bool WriteOutOfOrder () const
 Returns true if DataPoint supports receiving data out of order during writing. More...
 
virtual void SetAdditionalChecks (bool v)
 Allow/disallow additional checks on a source DataPoint before transfer. More...
 
virtual bool GetAdditionalChecks () const
 Returns true unless SetAdditionalChecks() was set to false. More...
 
virtual void SetSecure (bool v)
 Allow/disallow heavy security (data encryption) during data transfer. More...
 
virtual bool GetSecure () const
 Returns true if heavy security during data transfer is allowed. More...
 
virtual DataPointAccessLatency GetAccessLatency () const
 Get value of meta-information 'access latency'. More...
 
virtual void Passive (bool v)
 Set passive transfers for FTP-like protocols. More...
 
virtual void Range (unsigned long long int start=0, unsigned long long int end=0)
 Set range of bytes to retrieve. More...
 
virtual int AddCheckSumObject (CheckSum *cksum)
 Add a checksum object which will compute checksum during data transfer. More...
 
virtual const CheckSumGetCheckSumObject (int index) const
 Get CheckSum object at given position in list. More...
 
- Public Member Functions inherited from Arc::DataPoint
virtual ~DataPoint ()
 Destructor. More...
 
virtual const URLGetURL () const
 Returns the URL that was passed to the constructor. More...
 
virtual const UserConfigGetUserConfig () const
 Returns the UserConfig that was passed to the constructor. More...
 
virtual bool SetURL (const URL &url)
 Assigns new URL. More...
 
virtual std::string str () const
 Returns a string representation of the DataPoint. More...
 
virtual operator bool () const
 Is DataPoint valid? More...
 
virtual bool operator! () const
 Is DataPoint valid? More...
 
virtual DataStatus Stat (FileInfo &file, DataPointInfoType verb=INFO_TYPE_ALL)=0
 Retrieve information about this object. More...
 
virtual DataStatus Stat (std::list< FileInfo > &files, const std::list< DataPoint *> &urls, DataPointInfoType verb=INFO_TYPE_ALL)=0
 Retrieve information about several DataPoints. More...
 
virtual DataStatus List (std::list< FileInfo > &files, DataPointInfoType verb=INFO_TYPE_ALL)=0
 List hierarchical content of this object. More...
 
virtual DataStatus CreateDirectory (bool with_parents=false)=0
 Create a directory. More...
 
virtual DataStatus Rename (const URL &newurl)=0
 Rename a URL. More...
 
virtual DataStatus GetFailureReason (void) const
 Returns reason of transfer failure, as reported by callbacks. More...
 
virtual DataStatus Resolve (bool source)=0
 Resolves index service URL into list of ordinary URLs. More...
 
virtual DataStatus Resolve (bool source, const std::list< DataPoint *> &urls)=0
 Resolves several index service URLs. More...
 
virtual DataStatus PreRegister (bool replication, bool force=false)=0
 Index service pre-registration. More...
 
virtual DataStatus PostRegister (bool replication)=0
 Index service post-registration. More...
 
virtual DataStatus PreUnregister (bool replication)=0
 Index service pre-unregistration. More...
 
virtual DataStatus Unregister (bool all)=0
 Index service unregistration. More...
 
virtual bool CheckSize () const
 Check if meta-information 'size' is available. More...
 
virtual unsigned long long int GetSize () const
 Get value of meta-information 'size'. More...
 
virtual bool CheckCheckSum () const
 Check if meta-information 'checksum' is available. More...
 
virtual const std::string & GetCheckSum () const
 Get value of meta-information 'checksum'. More...
 
virtual const std::string DefaultCheckSum () const
 Default checksum type (varies by protocol) More...
 
virtual bool CheckModified () const
 Check if meta-information 'modification time' is available. More...
 
virtual void SetModified (const Time &val)
 Set value of meta-information 'modification time'. More...
 
virtual const TimeGetModified () const
 Get value of meta-information 'modification time'. More...
 
virtual bool CheckValid () const
 Check if meta-information 'validity time' is available. More...
 
virtual void SetValid (const Time &val)
 Set value of meta-information 'validity time'. More...
 
virtual const TimeGetValid () const
 Get value of meta-information 'validity time'. More...
 
virtual void SetAccessLatency (const DataPointAccessLatency &latency)
 Set value of meta-information 'access latency'. More...
 
virtual bool Cache () const
 Returns true if file is cacheable. More...
 
virtual int GetTries () const
 Returns number of retries left. More...
 
virtual void NextTry ()
 Decrease number of retries left. More...
 
virtual bool RequiresCredentials () const
 Returns true if some kind of credentials are needed to use this DataPoint. More...
 
virtual bool RequiresCredentialsInFile () const
 Returns true if credentials must be stored in files. More...
 
virtual void ResetMeta ()
 Reset meta information to default (undefined) values. More...
 
virtual bool CompareMeta (const DataPoint &p) const
 Compare meta information from another object. More...
 
virtual void AddURLOptions (const std::map< std::string, std::string > &options)
 Add URL options to this DataPoint's URL object. More...
 

Protected Member Functions

 DataPointIndex (const URL &url, const UserConfig &usercfg, PluginArgument *parg)
 
- Protected Member Functions inherited from Arc::DataPoint
 DataPoint (const URL &url, const UserConfig &usercfg, PluginArgument *parg)
 Constructor. More...
 
virtual DataStatus Transfer3rdParty (const URL &source, const URL &destination, TransferCallback callback=NULL)
 Perform third party transfer. More...
 

Protected Attributes

bool resolved
 
bool registered
 
- Protected Attributes inherited from Arc::DataPoint
URL url
 URL supplied in constructor. More...
 
const UserConfig usercfg
 UserConfig supplied in constructor. More...
 
unsigned long long int size
 Size of object represented by DataPoint. More...
 
std::string checksum
 Checksum of object represented by DataPoint. More...
 
Time modified
 Modification time of object represented by DataPoint. More...
 
Time valid
 Validity time of object represented by DataPoint. More...
 
DataPointAccessLatency access_latency
 Access latency of object represented by DataPoint. More...
 
int triesleft
 Retries left for data transfer. More...
 
DataStatus failure_code
 Result of data read/write carried out in separate thread. More...
 
bool cache
 Whether this DataPoint is cacheable. More...
 
bool stageable
 Whether this DataPoint requires staging. More...
 
std::set< std::string > valid_url_options
 Valid URL options. Subclasses should add their own specific options to this list. More...
 

Additional Inherited Members

- Public Types inherited from Arc::DataPoint
enum  DataPointAccessLatency { ACCESS_LATENCY_ZERO, ACCESS_LATENCY_SMALL, ACCESS_LATENCY_LARGE }
 Describes the latency to access this URL. More...
 
enum  DataPointInfoType {
  INFO_TYPE_MINIMAL = 0, INFO_TYPE_NAME = 1, INFO_TYPE_TYPE = 2, INFO_TYPE_TIMES = 4,
  INFO_TYPE_CONTENT = 8, INFO_TYPE_CKSUM = 128, INFO_TYPE_ACCESS = 16, INFO_TYPE_STRUCT = 32,
  INFO_TYPE_REST = 64, INFO_TYPE_ALL = 255
}
 Describes type of information about URL to request. More...
 
typedef void(* TransferCallback) (unsigned long long int bytes_transferred)
 Callback for use in protocol-internal or 3rd party transfers. More...
 
- Static Public Member Functions inherited from Arc::DataPoint
static DataStatus Transfer3rdParty (const URL &source, const URL &destination, const UserConfig &usercfg, TransferCallback callback=NULL)
 Perform third party transfer. More...
 
- Static Protected Attributes inherited from Arc::DataPoint
static Logger logger
 Logger object. More...
 

Detailed Description

DataPointIndex represents "index" data objects, e.g. catalogs.

This class should never be used directly, instead inherit from it to provide a class for a specific indexing service.

Member Function Documentation

◆ AcceptsMeta()

virtual bool Arc::DataPointIndex::AcceptsMeta ( ) const
virtual

Check if endpoint can have any use from meta information.

Implements Arc::DataPoint.

◆ AddCheckSumObject()

virtual int Arc::DataPointIndex::AddCheckSumObject ( CheckSum cksum)
virtual

Add a checksum object which will compute checksum during data transfer.

Parameters
cksumobject which will compute checksum. Should not be destroyed until DataPointer itself.
Returns
integer position in the list of checksum objects.

Implements Arc::DataPoint.

◆ AddLocation()

virtual DataStatus Arc::DataPointIndex::AddLocation ( const URL url,
const std::string &  meta 
)
virtual

Add URL representing physical replica to list of locations.

Parameters
urlLocation URL to add.
metaLocation meta information.
Returns
LocationAlreadyExistsError if location already exists, otherwise success

Implements Arc::DataPoint.

◆ BufNum()

virtual int Arc::DataPointIndex::BufNum ( ) const
virtual

Get suggested number of buffers for transfers.

Implements Arc::DataPoint.

◆ BufSize()

virtual long long int Arc::DataPointIndex::BufSize ( ) const
virtual

Get suggested buffer size for transfers.

Implements Arc::DataPoint.

◆ Check()

virtual DataStatus Arc::DataPointIndex::Check ( bool  check_meta)
virtual

Query the DataPoint to check if object is accessible.

If check_meta is true this method will also try to provide meta information about the object. Note that for many protocols an access check also provides meta information and so check_meta may have no effect.

Parameters
check_metaIf true then the method will try to retrieve meta data during the check.
Returns
success if the object is accessible by the caller.

Implements Arc::DataPoint.

◆ ClearLocations()

virtual DataStatus Arc::DataPointIndex::ClearLocations ( )
virtual

Remove all locations.

Implements Arc::DataPoint.

◆ ClearTransferLocations()

virtual void Arc::DataPointIndex::ClearTransferLocations ( )
virtual

Clear list of physical file(s) to read/write.

To be used with protocols which re-direct to different URLs such as Transport URLs (TURLs). Has no effect for other protocols.

Since
Added in 4.0.0.

Reimplemented from Arc::DataPoint.

◆ CompareLocationMetadata()

virtual DataStatus Arc::DataPointIndex::CompareLocationMetadata ( ) const
virtual

Compare metadata of DataPoint and current location.

Returns
inconsistency error or error encountered during operation, or success

Implements Arc::DataPoint.

◆ CurrentLocation()

virtual const URL& Arc::DataPointIndex::CurrentLocation ( ) const
virtual

Returns current (resolved) URL.

Implements Arc::DataPoint.

◆ CurrentLocationHandle()

virtual DataPoint* Arc::DataPointIndex::CurrentLocationHandle ( ) const
virtual

Returns a pointer to the DataPoint representing the current location.

Implements Arc::DataPoint.

◆ CurrentLocationMetadata()

virtual const std::string& Arc::DataPointIndex::CurrentLocationMetadata ( ) const
virtual

Returns meta information used to create current URL.

Usage differs between different indexing services.

Implements Arc::DataPoint.

◆ FinishReading()

virtual DataStatus Arc::DataPointIndex::FinishReading ( bool  error = false)
virtual

Finish reading from the URL.

Must be called after transfer of physical file has completed if PrepareReading() was called, to free resources, release requests that were made during preparation etc.

Parameters
errorIf true then action is taken depending on the error.
Returns
success if source was released properly

Reimplemented from Arc::DataPoint.

◆ FinishWriting()

virtual DataStatus Arc::DataPointIndex::FinishWriting ( bool  error = false)
virtual

Finish writing to the URL.

Must be called after transfer of physical file has completed if PrepareWriting() was called, to free resources, release requests that were made during preparation etc.

Parameters
errorif true then action is taken depending on the error, for example cleaning the file from the storage
Returns
success if destination was released properly

Reimplemented from Arc::DataPoint.

◆ GetAccessLatency()

virtual DataPointAccessLatency Arc::DataPointIndex::GetAccessLatency ( ) const
virtual

Get value of meta-information 'access latency'.

Reimplemented from Arc::DataPoint.

◆ GetAdditionalChecks()

virtual bool Arc::DataPointIndex::GetAdditionalChecks ( ) const
virtual

Returns true unless SetAdditionalChecks() was set to false.

Implements Arc::DataPoint.

◆ GetCheckSumObject()

virtual const CheckSum* Arc::DataPointIndex::GetCheckSumObject ( int  index) const
virtual

Get CheckSum object at given position in list.

Implements Arc::DataPoint.

◆ GetSecure()

virtual bool Arc::DataPointIndex::GetSecure ( ) const
virtual

Returns true if heavy security during data transfer is allowed.

Implements Arc::DataPoint.

◆ HaveLocations()

virtual bool Arc::DataPointIndex::HaveLocations ( ) const
virtual

Returns true if number of resolved URLs is not 0.

Implements Arc::DataPoint.

◆ IsIndex()

virtual bool Arc::DataPointIndex::IsIndex ( ) const
virtual

Check if URL is an Indexing Service.

Implements Arc::DataPoint.

◆ IsStageable()

virtual bool Arc::DataPointIndex::IsStageable ( ) const
virtual

Check if URL should be staged or queried for Transport URL (TURL)

Reimplemented from Arc::DataPoint.

◆ LastLocation()

virtual bool Arc::DataPointIndex::LastLocation ( )
virtual

Returns true if the current location is the last.

Implements Arc::DataPoint.

◆ Local()

virtual bool Arc::DataPointIndex::Local ( ) const
virtual

Returns true if file is local, e.g. file:// urls.

Implements Arc::DataPoint.

◆ LocationValid()

virtual bool Arc::DataPointIndex::LocationValid ( ) const
virtual

Returns false no more locations are left and out of retries.

Implements Arc::DataPoint.

◆ NextLocation()

virtual bool Arc::DataPointIndex::NextLocation ( )
virtual

Switch to next location in list of URLs.

At last location switch to first if number of allowed retries is not exceeded.

Returns
false if no retries left.

Implements Arc::DataPoint.

◆ Passive()

virtual void Arc::DataPointIndex::Passive ( bool  v)
virtual

Set passive transfers for FTP-like protocols.

Parameters
vtrue if passive should be used.

Implements Arc::DataPoint.

◆ PrepareReading()

virtual DataStatus Arc::DataPointIndex::PrepareReading ( unsigned int  timeout,
unsigned int &  wait_time 
)
virtual

Prepare DataPoint for reading.

This method should be implemented by protocols which require preparation or staging of physical files for reading. It can act synchronously or asynchronously (if protocol supports it). In the first case the method will block until the file is prepared or the specified timeout has passed. In the second case the method can return with a ReadPrepareWait status before the file is prepared. The caller should then wait some time (a hint from the remote service may be given in wait_time) and call PrepareReading() again to poll for the preparation status, until the file is prepared. In this case it is also up to the caller to decide when the request has taken too long and if so cancel it by calling FinishReading(). When file preparation has finished, the physical file(s) to read from can be found from TransferLocations().

Parameters
timeoutIf non-zero, this method will block until either the file has been prepared successfully or the timeout has passed. A zero value means that the caller would like to call and poll for status.
wait_timeIf timeout is zero (caller would like asynchronous operation) and ReadPrepareWait is returned, a hint for how long to wait before a subsequent call may be given in wait_time.
Returns
Status of the operation

Reimplemented from Arc::DataPoint.

◆ PrepareWriting()

virtual DataStatus Arc::DataPointIndex::PrepareWriting ( unsigned int  timeout,
unsigned int &  wait_time 
)
virtual

Prepare DataPoint for writing.

This method should be implemented by protocols which require preparation of physical files for writing. It can act synchronously or asynchronously (if protocol supports it). In the first case the method will block until the file is prepared or the specified timeout has passed. In the second case the method can return with a WritePrepareWait status before the file is prepared. The caller should then wait some time (a hint from the remote service may be given in wait_time) and call PrepareWriting() again to poll for the preparation status, until the file is prepared. In this case it is also up to the caller to decide when the request has taken too long and if so cancel or abort it by calling FinishWriting(true). When file preparation has finished, the physical file(s) to write to can be found from TransferLocations().

Parameters
timeoutIf non-zero, this method will block until either the file has been prepared successfully or the timeout has passed. A zero value means that the caller would like to call and poll for status.
wait_timeIf timeout is zero (caller would like asynchronous operation) and WritePrepareWait is returned, a hint for how long to wait before a subsequent call may be given in wait_time.
Returns
Status of the operation

Reimplemented from Arc::DataPoint.

◆ ProvidesMeta()

virtual bool Arc::DataPointIndex::ProvidesMeta ( ) const
virtual

Check if endpoint can provide at least some meta information directly.

Implements Arc::DataPoint.

◆ Range()

virtual void Arc::DataPointIndex::Range ( unsigned long long int  start = 0,
unsigned long long int  end = 0 
)
virtual

Set range of bytes to retrieve.

Default values correspond to whole file. Both start and end bytes are included in the range, i.e. start - end + 1 bytes will be read.

Parameters
startbyte to start from
endbyte to end at

Implements Arc::DataPoint.

◆ ReadOnly()

virtual bool Arc::DataPointIndex::ReadOnly ( ) const
virtual

Returns true if file is readonly.

Implements Arc::DataPoint.

◆ ReadOutOfOrder()

virtual void Arc::DataPointIndex::ReadOutOfOrder ( bool  v)
virtual

Allow/disallow DataPoint to read data out of order.

If set to true then data may be read from source out of order or in parallel from multiple threads. For a transfer between two DataPoints this should only be set to true if WriteOutOfOrder() returns true for the destination. Only certain protocols support this option.

Parameters
vtrue if allowed (default is false).

Implements Arc::DataPoint.

◆ Registered()

virtual bool Arc::DataPointIndex::Registered ( ) const
virtual

Returns true if file is registered in indexing service (only known after Resolve())

Implements Arc::DataPoint.

◆ Remove()

virtual DataStatus Arc::DataPointIndex::Remove ( )
virtual

Remove/delete object at URL.

Implements Arc::DataPoint.

◆ RemoveLocation()

virtual DataStatus Arc::DataPointIndex::RemoveLocation ( )
virtual

Remove current URL from list.

Implements Arc::DataPoint.

◆ RemoveLocations()

virtual DataStatus Arc::DataPointIndex::RemoveLocations ( const DataPoint p)
virtual

Remove locations present in another DataPoint object.

Implements Arc::DataPoint.

◆ SetAdditionalChecks()

virtual void Arc::DataPointIndex::SetAdditionalChecks ( bool  v)
virtual

Allow/disallow additional checks on a source DataPoint before transfer.

If set to true, extra checks will be performed in DataMover::Transfer() before data transfer starts on for example existence of the source file (and probably other checks too).

Parameters
vtrue if allowed (default is true).

Implements Arc::DataPoint.

◆ SetCheckSum()

virtual void Arc::DataPointIndex::SetCheckSum ( const std::string &  val)
virtual

Set value of meta-information 'checksum'.

Reimplemented from Arc::DataPoint.

◆ SetMeta()

virtual void Arc::DataPointIndex::SetMeta ( const DataPoint p)
virtual

Copy meta information from another object.

Already defined values are not overwritten.

Parameters
pobject from which information is taken.

Reimplemented from Arc::DataPoint.

◆ SetSecure()

virtual void Arc::DataPointIndex::SetSecure ( bool  v)
virtual

Allow/disallow heavy security (data encryption) during data transfer.

Parameters
vtrue if allowed (default depends on protocol).

Implements Arc::DataPoint.

◆ SetSize()

virtual void Arc::DataPointIndex::SetSize ( const unsigned long long int  val)
virtual

Set value of meta-information 'size'.

Reimplemented from Arc::DataPoint.

◆ SetTries()

virtual void Arc::DataPointIndex::SetTries ( const int  n)
virtual

Set number of retries.

Reimplemented from Arc::DataPoint.

◆ SortLocations()

virtual void Arc::DataPointIndex::SortLocations ( const std::string &  pattern,
const URLMap url_map 
)
virtual

Sort locations according to the specified pattern and URLMap.

See DataMover::set_preferred_pattern for a more detailed explanation of pattern matching. Locations present in url_map are preferred over others.

Parameters
patterna set of strings, separated by |, to match against.
url_mapmap of URLs to local URLs

Implements Arc::DataPoint.

◆ StartReading()

virtual DataStatus Arc::DataPointIndex::StartReading ( DataBuffer buffer)
virtual

Start reading data from URL.

A separate thread to transfer data will be created. No other operation can be performed while reading is in progress. Progress of the transfer should be followed using the DataBuffer object.

Parameters
bufferoperation will use this buffer to put information into. Should not be destroyed before StopReading() was called and returned. If StopReading() is not called explicitly to release buffer it will be released in destructor of DataPoint which also usually calls StopReading().
Returns
success if a thread was successfully started to start reading

Implements Arc::DataPoint.

◆ StartWriting()

virtual DataStatus Arc::DataPointIndex::StartWriting ( DataBuffer buffer,
DataCallback space_cb = NULL 
)
virtual

Start writing data to URL.

A separate thread to transfer data will be created. No other operation can be performed while writing is in progress. Progress of the transfer should be followed using the DataBuffer object.

Parameters
bufferoperation will use this buffer to get information from. Should not be destroyed before StopWriting() was called and returned. If StopWriting() is not called explicitly to release buffer it will be released in destructor of DataPoint which also usually calls StopWriting().
space_cbcallback which is called if there is not enough space to store data. May not implemented for all protocols.
Returns
success if a thread was successfully started to start writing

Implements Arc::DataPoint.

◆ StopReading()

virtual DataStatus Arc::DataPointIndex::StopReading ( )
virtual

Stop reading.

Must be called after corresponding StartReading() method, either after all data is transferred or to cancel transfer. Use buffer object to find out when data is transferred.

Returns
outcome of stopping reading (not outcome of transfer itself)

Implements Arc::DataPoint.

◆ StopWriting()

virtual DataStatus Arc::DataPointIndex::StopWriting ( )
virtual

Stop writing.

Must be called after corresponding StartWriting() method, either after all data is transferred or to cancel transfer. Use buffer object to find out when data is transferred.

Returns
outcome of stopping writing (not outcome of transfer itself)

Implements Arc::DataPoint.

◆ SupportsTransfer()

virtual bool Arc::DataPointIndex::SupportsTransfer ( ) const
virtual

Returns true if DataPoint supports internal transfer.

Reimplemented from Arc::DataPoint.

◆ Transfer()

virtual DataStatus Arc::DataPointIndex::Transfer ( const URL otherendpoint,
bool  source,
TransferCallback  callback = NULL 
)
virtual

Do a transfer in a single operation.

This method is designed for plugins which support doing transfers between different endpoints in a single operation, rather than two separate DataPoints communicating with each other via a DataBuffer.

Parameters
endpointOther endpoint to transfer to or from
sourceWhether this DataPoint is the source (true) or destination (false)
callbackOptional monitoring callback
Returns
Outcome of transfer
Since
6.0.0

Reimplemented from Arc::DataPoint.

◆ TransferLocations()

virtual std::vector<URL> Arc::DataPointIndex::TransferLocations ( ) const
virtual

Returns physical file(s) to read/write, if different from CurrentLocation()

To be used with protocols which re-direct to different URLs such as Transport URLs (TURLs). The list is initially filled by PrepareReading and PrepareWriting. If this list is non-empty then real transfer should use a URL from this list. It is up to the caller to choose the best URL and instantiate new DataPoint for handling it. For consistency protocols which do not require redirections return original URL. For protocols which need redirection calling StartReading and StartWriting will use first URL in the list.

Reimplemented from Arc::DataPoint.

◆ WriteOutOfOrder()

virtual bool Arc::DataPointIndex::WriteOutOfOrder ( ) const
virtual

Returns true if DataPoint supports receiving data out of order during writing.

Implements Arc::DataPoint.


The documentation for this class was generated from the following file: