27 #include <olp/core/thread/TaskScheduler.h>
28 #include <olp/dataservice/read/DataServiceReadApi.h>
29 #include <olp/dataservice/read/FetchOptions.h>
30 #include <boost/optional.hpp>
33 namespace dataservice {
59 partition_ids_ = std::move(partition_ids);
94 boost::optional<std::string> billing_tag) {
95 billing_tag_ = std::move(billing_tag);
110 billing_tag_ = std::move(billing_tag);
131 priority_ = priority;
144 boost::optional<int64_t> version = boost::none)
const {
145 std::stringstream out;
148 out <<
"@" << version.get();
150 out <<
"^" << partition_ids_.size();
151 if (!partition_ids_.empty()) {
152 out <<
"[" << partition_ids_.front() <<
", ...]";
154 if (GetBillingTag()) {
155 out <<
"$" << GetBillingTag().get();
157 out <<
"*" << priority_;
162 PartitionIds partition_ids_;
163 boost::optional<std::string> billing_tag_;
164 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:121
PrefetchPartitionsRequest & WithPartitionIds(PartitionIds partition_ids)
Sets the list of partitions.
Definition: PrefetchPartitionsRequest.h:57
const PartitionIds & GetPartitionIds() const
Gets the list of the partitions.
Definition: PrefetchPartitionsRequest.h:68
PrefetchPartitionsRequest & WithBillingTag(boost::optional< std::string > billing_tag)
Sets the billing tag for the request.
Definition: PrefetchPartitionsRequest.h:93
std::string CreateKey(const std::string &layer_id, boost::optional< int64_t > version=boost::none) const
Creates a readable format for the request.
Definition: PrefetchPartitionsRequest.h:143
PrefetchPartitionsRequest & WithBillingTag(std::string &&billing_tag)
Sets the billing tag for the request.
Definition: PrefetchPartitionsRequest.h:109
std::vector< std::string > PartitionIds
An alias for the vector of partitions IDs.
Definition: PrefetchPartitionsRequest.h:43
PrefetchPartitionsRequest & WithPriority(uint32_t priority)
Sets the priority of the prefetch request.
Definition: PrefetchPartitionsRequest.h:130
const boost::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition: PrefetchPartitionsRequest.h:80
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24