@@ -62,13 +62,15 @@ bool HandleDataResponse(
6262} // namespace
6363
6464int RunExampleReadWithCache (const AccessKey& access_key,
65- const olp::cache::CacheSettings& cache_settings, const std::string& catalog) {
65+ const olp::cache::CacheSettings& cache_settings,
66+ const std::string& catalog) {
6667 OLP_SDK_LOG_INFO_F (
6768 kLogTag , " Mutable cache path is \" %s\" " ,
68- cache_settings.disk_path_mutable . get_value_or ( " none" ).c_str ());
69+ olp::porting::value_or ( cache_settings.disk_path_mutable , " none" ).c_str ());
6970 OLP_SDK_LOG_INFO_F (
7071 kLogTag , " Protected cache path is \" %s\" " ,
71- cache_settings.disk_path_protected .get_value_or (" none" ).c_str ());
72+ olp::porting::value_or (cache_settings.disk_path_protected , " none" )
73+ .c_str ());
7274 // Create a task scheduler instance
7375 std::shared_ptr<olp::thread::TaskScheduler> task_scheduler =
7476 olp::client::OlpClientSettingsFactory::CreateDefaultTaskScheduler (1u );
@@ -84,8 +86,8 @@ int RunExampleReadWithCache(const AccessKey& access_key,
8486 olp::authentication::AuthenticationCredentials::ReadFromFile ();
8587
8688 // Initialize authentication settings.
87- olp::authentication::Settings settings{
88- read_credentials_result. get_value_or ( {access_key.id , access_key.secret })};
89+ olp::authentication::Settings settings{olp::porting::value_or (
90+ read_credentials_result, {access_key.id , access_key.secret })};
8991 settings.task_scheduler = task_scheduler;
9092 settings.network_request_handler = http_client;
9193
@@ -108,23 +110,22 @@ int RunExampleReadWithCache(const AccessKey& access_key,
108110
109111 // Create appropriate layer client with HRN, layer name and settings.
110112 olp::dataservice::read::VersionedLayerClient layer_client (
111- olp::client::HRN (catalog), first_layer_id, boost::none, client_settings);
113+ olp::client::HRN (catalog), first_layer_id, olp::porting::none,
114+ client_settings);
112115
113116 // Retrieve the partition data
114117 // Create a DataRequest with appropriate LayerId and PartitionId
115- auto request = olp::dataservice::read::DataRequest ()
116- .WithPartitionId (first_partition_id)
117- .WithBillingTag (boost::none);
118- if (cache_settings.disk_path_protected .is_initialized ()) {
118+ auto request =
119+ olp::dataservice::read::DataRequest ().WithPartitionId (first_partition_id);
120+ if (cache_settings.disk_path_protected .has_value ()) {
119121 request.WithFetchOption (olp::dataservice::read::FetchOptions::CacheOnly);
120122 }
121123
122124 // Run the DataRequest
123125 auto future = layer_client.GetData (request);
124126
125127 // Wait for DataResponse
126- olp::dataservice::read::DataResponse data_response =
127- future.GetFuture ().get ();
128+ olp::dataservice::read::DataResponse data_response = future.GetFuture ().get ();
128129
129130 // Compact mutable cache, so it can be used as protected cache
130131 cache->Compact ();
@@ -133,8 +134,8 @@ int RunExampleReadWithCache(const AccessKey& access_key,
133134 return (HandleDataResponse (data_response) ? 0 : -1 );
134135}
135136
136- int RunExampleProtectedCache (const AccessKey& access_key, const std::string& catalog)
137- {
137+ int RunExampleProtectedCache (const AccessKey& access_key,
138+ const std::string& catalog) {
138139 // Read data with mutable cache.
139140 olp::cache::CacheSettings cache_settings;
140141 cache_settings.disk_path_mutable =
@@ -145,6 +146,6 @@ int RunExampleProtectedCache(const AccessKey& access_key, const std::string& cat
145146 }
146147 // Read data with protected cache. Set mutable cache to none.
147148 cache_settings.disk_path_protected = cache_settings.disk_path_mutable ;
148- cache_settings.disk_path_mutable = boost ::none;
149+ cache_settings.disk_path_mutable = olp::porting ::none;
149150 return RunExampleReadWithCache (access_key, cache_settings, catalog);
150151}
0 commit comments