29 #include <kvikio/defaults.hpp> 
   30 #include <kvikio/error.hpp> 
   31 #include <kvikio/parallel_operation.hpp> 
   32 #include <kvikio/posix_io.hpp> 
   33 #include <kvikio/utils.hpp> 
   65   virtual std::string 
str() 
const = 0;
 
   85   std::string 
str() 
const override;
 
   95   std::string _aws_sigv4;
 
   96   std::string _aws_userpwd;
 
   97   curl_slist* _curl_header_list{};
 
  112   static std::string unwrap_or_default(std::optional<std::string> aws_arg,
 
  113                                        std::string 
const& env_var,
 
  114                                        std::string 
const& err_msg = 
"");
 
  133                                                 std::string object_name,
 
  134                                                 std::optional<std::string> aws_region,
 
  135                                                 std::optional<std::string> aws_endpoint_url);
 
  145   [[nodiscard]] 
static std::pair<std::string, std::string> 
parse_s3_url(std::string 
const& s3_url);
 
  163              std::optional<std::string> aws_region            = std::nullopt,
 
  164              std::optional<std::string> aws_access_key        = std::nullopt,
 
  165              std::optional<std::string> aws_secret_access_key = std::nullopt,
 
  166              std::optional<std::string> aws_session_token     = std::nullopt);
 
  185   S3Endpoint(std::pair<std::string, std::string> bucket_and_object_names,
 
  186              std::optional<std::string> aws_region            = std::nullopt,
 
  187              std::optional<std::string> aws_access_key        = std::nullopt,
 
  188              std::optional<std::string> aws_secret_access_key = std::nullopt,
 
  189              std::optional<std::string> aws_endpoint_url      = std::nullopt,
 
  190              std::optional<std::string> aws_session_token     = std::nullopt);
 
  193   std::string 
str() 
const override;
 
  202   std::unique_ptr<RemoteEndpoint> _endpoint;
 
  236   [[nodiscard]] std::size_t 
nbytes() const noexcept;
 
  257   std::
size_t read(
void* buf, std::
size_t size, std::
size_t file_offset = 0);
 
  271   std::future<std::
size_t> 
pread(
void* buf,
 
  273                                  std::
size_t file_offset = 0,
 
  274                                  std::
size_t task_size   = 
defaults::task_size());
 
Representation of a curl easy handle pointer and its operations.
 
A remote endpoint using http.
 
std::string str() const override
Get a description of this remote point instance.
 
HttpEndpoint(std::string url)
Create an http endpoint from a url.
 
void setopt(CurlHandle &curl) override
Set needed connection options on a curl handle.
 
Abstract base class for remote endpoints.
 
virtual void setopt(CurlHandle &curl)=0
Set needed connection options on a curl handle.
 
virtual std::string str() const =0
Get a description of this remote point instance.
 
std::size_t read(void *buf, std::size_t size, std::size_t file_offset=0)
Read from remote source into buffer (host or device memory).
 
RemoteEndpoint const  & endpoint() const noexcept
Get a const reference to the underlying remote endpoint.
 
std::size_t nbytes() const noexcept
Get the file size.
 
RemoteHandle(std::unique_ptr< RemoteEndpoint > endpoint)
Create a new remote handle from an endpoint (infers the file size).
 
std::future< std::size_t > pread(void *buf, std::size_t size, std::size_t file_offset=0, std::size_t task_size=defaults::task_size())
Read from remote source into buffer (host or device memory) in parallel.
 
RemoteHandle(std::unique_ptr< RemoteEndpoint > endpoint, std::size_t nbytes)
Create a new remote handle from an endpoint and a file size.
 
A remote endpoint using AWS's S3 protocol.
 
static std::string url_from_bucket_and_object(std::string bucket_name, std::string object_name, std::optional< std::string > aws_region, std::optional< std::string > aws_endpoint_url)
Get url from a AWS S3 bucket and object name.
 
S3Endpoint(std::pair< std::string, std::string > bucket_and_object_names, std::optional< std::string > aws_region=std::nullopt, std::optional< std::string > aws_access_key=std::nullopt, std::optional< std::string > aws_secret_access_key=std::nullopt, std::optional< std::string > aws_endpoint_url=std::nullopt, std::optional< std::string > aws_session_token=std::nullopt)
Create a S3 endpoint from a bucket and object name.
 
S3Endpoint(std::string url, std::optional< std::string > aws_region=std::nullopt, std::optional< std::string > aws_access_key=std::nullopt, std::optional< std::string > aws_secret_access_key=std::nullopt, std::optional< std::string > aws_session_token=std::nullopt)
Create a S3 endpoint from a url.
 
void setopt(CurlHandle &curl) override
Set needed connection options on a curl handle.
 
static std::pair< std::string, std::string > parse_s3_url(std::string const &s3_url)
Given an url like "s3://<bucket>/<object>", return the name of the bucket and object.
 
std::string str() const override
Get a description of this remote point instance.
 
Singleton class of default values used throughout KvikIO.