@@ -62,13 +62,16 @@ 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" )
70+ .c_str ());
6971 OLP_SDK_LOG_INFO_F (
7072 kLogTag , " Protected cache path is \" %s\" " ,
71- cache_settings.disk_path_protected .get_value_or (" none" ).c_str ());
73+ olp::porting::value_or (cache_settings.disk_path_protected , " none" )
74+ .c_str ());
7275 // Create a task scheduler instance
7376 std::shared_ptr<olp::thread::TaskScheduler> task_scheduler =
7477 olp::client::OlpClientSettingsFactory::CreateDefaultTaskScheduler (1u );
@@ -84,8 +87,8 @@ int RunExampleReadWithCache(const AccessKey& access_key,
8487 olp::authentication::AuthenticationCredentials::ReadFromFile ();
8588
8689 // Initialize authentication settings.
87- olp::authentication::Settings settings{
88- read_credentials_result. get_value_or ( {access_key.id , access_key.secret })};
90+ olp::authentication::Settings settings{olp::porting::value_or (
91+ read_credentials_result, {access_key.id , access_key.secret })};
8992 settings.task_scheduler = task_scheduler;
9093 settings.network_request_handler = http_client;
9194
@@ -108,23 +111,22 @@ int RunExampleReadWithCache(const AccessKey& access_key,
108111
109112 // Create appropriate layer client with HRN, layer name and settings.
110113 olp::dataservice::read::VersionedLayerClient layer_client (
111- olp::client::HRN (catalog), first_layer_id, boost::none, client_settings);
114+ olp::client::HRN (catalog), first_layer_id, olp::porting::none,
115+ client_settings);
112116
113117 // Retrieve the partition data
114118 // 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 ()) {
119+ auto request =
120+ olp::dataservice::read::DataRequest ().WithPartitionId (first_partition_id);
121+ if (cache_settings.disk_path_protected .has_value ()) {
119122 request.WithFetchOption (olp::dataservice::read::FetchOptions::CacheOnly);
120123 }
121124
122125 // Run the DataRequest
123126 auto future = layer_client.GetData (request);
124127
125128 // Wait for DataResponse
126- olp::dataservice::read::DataResponse data_response =
127- future.GetFuture ().get ();
129+ olp::dataservice::read::DataResponse data_response = future.GetFuture ().get ();
128130
129131 // Compact mutable cache, so it can be used as protected cache
130132 cache->Compact ();
@@ -133,8 +135,8 @@ int RunExampleReadWithCache(const AccessKey& access_key,
133135 return (HandleDataResponse (data_response) ? 0 : -1 );
134136}
135137
136- int RunExampleProtectedCache (const AccessKey& access_key, const std::string& catalog)
137- {
138+ int RunExampleProtectedCache (const AccessKey& access_key,
139+ const std::string& catalog) {
138140 // Read data with mutable cache.
139141 olp::cache::CacheSettings cache_settings;
140142 cache_settings.disk_path_mutable =
@@ -145,6 +147,6 @@ int RunExampleProtectedCache(const AccessKey& access_key, const std::string& cat
145147 }
146148 // Read data with protected cache. Set mutable cache to none.
147149 cache_settings.disk_path_protected = cache_settings.disk_path_mutable ;
148- cache_settings.disk_path_mutable = boost ::none;
150+ cache_settings.disk_path_mutable = olp::porting ::none;
149151 return RunExampleReadWithCache (access_key, cache_settings, catalog);
150152}
0 commit comments