27#include <olp/core/porting/optional.h>
28#include <olp/core/thread/TaskScheduler.h>
29#include <olp/dataservice/read/DataServiceReadApi.h>
30#include <olp/dataservice/read/FetchOptions.h>
33namespace dataservice {
58 partition_ids_ = std::move(partition_ids);
92 template <
class T = porting::optional<std::
string>>
94 billing_tag_ = std::forward<T>(billing_tag);
115 priority_ = priority;
128 const std::string& layer_id,
129 porting::optional<int64_t> version = porting::none)
const {
130 std::stringstream out;
133 out <<
"@" << *version;
135 out <<
"^" << partition_ids_.size();
136 if (!partition_ids_.empty()) {
137 out <<
"[" << partition_ids_.front() <<
", ...]";
139 if (GetBillingTag()) {
140 out <<
"$" << *GetBillingTag();
142 out <<
"*" << priority_;
147 PartitionIds partition_ids_;
148 porting::optional<std::string> billing_tag_;
149 uint32_t priority_{thread::LOW};
Encapsulates the fields required to prefetch a list of partitions for the given catalog and layer.
Definition PrefetchPartitionsRequest.h:40
uint32_t GetPriority() const
Gets the request priority.
Definition PrefetchPartitionsRequest.h:105
PrefetchPartitionsRequest & WithPriority(uint32_t priority)
Sets the priority of the prefetch request.
Definition PrefetchPartitionsRequest.h:114
PrefetchPartitionsRequest & WithPartitionIds(PartitionIds partition_ids)
Sets the list of partitions.
Definition PrefetchPartitionsRequest.h:57
const porting::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition PrefetchPartitionsRequest.h:79
std::vector< std::string > PartitionIds
An alias for the vector of partitions IDs.
Definition PrefetchPartitionsRequest.h:43
std::string CreateKey(const std::string &layer_id, porting::optional< int64_t > version=porting::none) const
Creates a readable format for the request.
Definition PrefetchPartitionsRequest.h:127
PrefetchPartitionsRequest & WithBillingTag(T &&billing_tag)
Sets the billing tag for the request.
Definition PrefetchPartitionsRequest.h:93
const PartitionIds & GetPartitionIds() const
Gets the list of the partitions.
Definition PrefetchPartitionsRequest.h:67
Rules all the other namespaces.
Definition AppleSignInProperties.h:24