26#include <olp/core/porting/optional.h>
27#include <olp/core/thread/TaskScheduler.h>
28#include <olp/dataservice/read/DataServiceReadApi.h>
29#include <olp/dataservice/read/FetchOptions.h>
32namespace dataservice {
64 template <
class T = porting::optional<std::
string>>
66 partition_id_ = std::forward<T>(partition_id);
97 template <
class T = porting::optional<std::
string>>
99 data_handle_ = std::forward<T>(data_handle);
126 template <
class T = porting::optional<std::
string>>
128 billing_tag_ = std::forward<T>(tag);
153 fetch_option_ = fetch_option;
174 priority_ = priority;
187 porting::optional<int64_t> version)
const {
188 std::stringstream out;
189 out << layer_id <<
"[";
190 if (GetPartitionId()) {
191 out << *GetPartitionId();
192 }
else if (GetDataHandle()) {
193 out << *GetDataHandle();
197 out <<
"@" << *version;
199 if (GetBillingTag()) {
200 out <<
"$" << *GetBillingTag();
202 out <<
"^" << GetFetchOption();
207 porting::optional<std::string> partition_id_;
208 porting::optional<int64_t> catalog_version_;
209 porting::optional<std::string> data_handle_;
210 porting::optional<std::string> billing_tag_;
211 FetchOptions fetch_option_{OnlineIfNotFound};
212 uint32_t priority_{thread::NORMAL};
Encapsulates the fields required to request data for the given catalog, layer, and partition.
Definition DataRequest.h:43
DataRequest & WithPartitionId(T &&partition_id)
Sets the partition ID.
Definition DataRequest.h:65
std::string CreateKey(const std::string &layer_id, porting::optional< int64_t > version) const
Creates a readable format for the request.
Definition DataRequest.h:186
FetchOptions GetFetchOption() const
Gets the fetch option that controls how requests are handled.
Definition DataRequest.h:140
const porting::optional< std::string > & GetBillingTag() const
Gets the billing tag to group billing records together.
Definition DataRequest.h:113
DataRequest & WithFetchOption(FetchOptions fetch_option)
Sets the fetch option that you can use to set the source from which data should be fetched.
Definition DataRequest.h:152
const porting::optional< std::string > & GetDataHandle() const
Get the partition data handle.
Definition DataRequest.h:81
DataRequest & WithDataHandle(T &&data_handle)
Sets the partition data handle.
Definition DataRequest.h:98
DataRequest & WithBillingTag(T &&tag)
Sets the billing tag for the request.
Definition DataRequest.h:127
uint32_t GetPriority() const
Gets the request priority.
Definition DataRequest.h:164
const porting::optional< std::string > & GetPartitionId() const
Gets the ID of the requested partition.
Definition DataRequest.h:50
DataRequest & WithPriority(uint32_t priority)
Sets the priority of the request.
Definition DataRequest.h:173
Rules all the other namespaces.
Definition AppleSignInProperties.h:24