![]() |
Project
|
#include <FailoverByteSource.h>
Inherits o2::aod::native::ByteSource.
Public Types | |
| using | Opener = std::function< std::unique_ptr< ByteSource >(std::string const &url, Options const &)> |
| using | Log = std::function< void(std::string const &)> |
Public Member Functions | |
| FailoverByteSource (std::vector< Replica > replicas, Options const &options, Opener opener, Log log) | |
| Throws IoError when no replica opens. | |
| uint64_t | size () const override |
| void | readInto (uint64_t off, size_t len, void *dst) override |
| Throws IoError, or CorruptData when the range is past the end of the file. | |
| void | readvInto (std::span< ReadRequest > requests) override |
| std::span< const uint8_t > | tryMap (uint64_t off, size_t len) override |
| A view of the bytes without copying them, if the backend can provide it. | |
| bool | canMap () const override |
| Whether tryMap() provides every range, so that nothing needs reading. | |
| bool | isRemote () const override |
| Whether each read is a network round trip, worth hiding behind decoding. | |
| void | willNeed (uint64_t off, size_t len) override |
| Hints that a range will be needed soon, or is no longer needed. | |
| void | dontNeed (uint64_t off, size_t len) override |
| uint64_t | bytesRead () const override |
| uint64_t | readCalls () const override |
| std::string | url () const override |
| std::string | replicaLabel () const override |
| The label of the replica being read, for a source opened with openReplicas(). | |
Public Member Functions inherited from o2::aod::native::ByteSource | |
| virtual | ~ByteSource () |
Additional Inherited Members | |
Static Public Member Functions inherited from o2::aod::native::ByteSource | |
| static std::unique_ptr< ByteSource > | open (std::string url, const Options &) |
| static std::unique_ptr< ByteSource > | openReplicas (std::vector< Replica > replicas, const Options &, std::function< void(std::string const &)> log={}) |
The replicas of one file, read as one ByteSource. A read which fails with an IoError is retried on the same replica, reopened, Options::readRetries times with a growing delay, and then on the next replica of the same size. Opening goes through the replicas in order too. Reads already in flight on a replica that is being replaced finish there, or fail and are retried.
Definition at line 28 of file FailoverByteSource.h.
| using o2::aod::native::FailoverByteSource::Log = std::function<void(std::string const&)> |
Definition at line 32 of file FailoverByteSource.h.
| using o2::aod::native::FailoverByteSource::Opener = std::function<std::unique_ptr<ByteSource>(std::string const& url, Options const&)> |
Definition at line 31 of file FailoverByteSource.h.
| o2::aod::native::FailoverByteSource::FailoverByteSource | ( | std::vector< Replica > | replicas, |
| Options const & | options, | ||
| Opener | opener, | ||
| Log | log | ||
| ) |
Throws IoError when no replica opens.
Definition at line 29 of file FailoverByteSource.cxx.
|
overridevirtual |
Implements o2::aod::native::ByteSource.
Definition at line 70 of file FailoverByteSource.cxx.
|
inlineoverridevirtual |
Whether tryMap() provides every range, so that nothing needs reading.
Reimplemented from o2::aod::native::ByteSource.
Definition at line 41 of file FailoverByteSource.h.
|
inlineoverridevirtual |
Reimplemented from o2::aod::native::ByteSource.
Definition at line 44 of file FailoverByteSource.h.
|
inlineoverridevirtual |
Whether each read is a network round trip, worth hiding behind decoding.
Reimplemented from o2::aod::native::ByteSource.
Definition at line 42 of file FailoverByteSource.h.
|
overridevirtual |
Implements o2::aod::native::ByteSource.
Definition at line 75 of file FailoverByteSource.cxx.
|
overridevirtual |
Throws IoError, or CorruptData when the range is past the end of the file.
Implements o2::aod::native::ByteSource.
Definition at line 87 of file FailoverByteSource.cxx.
|
overridevirtual |
Implements o2::aod::native::ByteSource.
Definition at line 92 of file FailoverByteSource.cxx.
|
overridevirtual |
The label of the replica being read, for a source opened with openReplicas().
Reimplemented from o2::aod::native::ByteSource.
Definition at line 64 of file FailoverByteSource.cxx.
|
inlineoverridevirtual |
Implements o2::aod::native::ByteSource.
Definition at line 37 of file FailoverByteSource.h.
|
inlineoverridevirtual |
A view of the bytes without copying them, if the backend can provide it.
Reimplemented from o2::aod::native::ByteSource.
Definition at line 40 of file FailoverByteSource.h.
|
inlineoverridevirtual |
Implements o2::aod::native::ByteSource.
Definition at line 47 of file FailoverByteSource.h.
|
inlineoverridevirtual |
Hints that a range will be needed soon, or is no longer needed.
Reimplemented from o2::aod::native::ByteSource.
Definition at line 43 of file FailoverByteSource.h.