@@ -247,6 +247,9 @@ typedef std::map<std::string, std::string> DbidList;
247247// The Cloud environment
248248//
249249class CloudEnv : public Env {
250+ protected:
251+ CloudEnvOptions cloud_env_options;
252+ CloudEnv (const CloudEnvOptions& options) : cloud_env_options(options) { }
250253 public:
251254 // Returns the underlying env
252255 virtual Env* GetBaseEnv () = 0;
@@ -277,17 +280,28 @@ class CloudEnv : public Env {
277280 // GetSrcObjectPath specifies the path inside that bucket
278281 // where data files reside. The specified bucket is used in
279282 // a readonly mode by the associated DBCloud instance.
280- virtual const std::string& GetSrcBucketName () const = 0;
281- virtual const std::string& GetSrcObjectPath () const = 0;
283+ const std::string& GetSrcBucketName () const {
284+ return cloud_env_options.src_bucket .GetBucketName ();
285+ }
286+ const std::string& GetSrcObjectPath () const {
287+ return cloud_env_options.src_bucket .GetObjectPath ();
288+ }
282289
283290 // The DestBucketName identifies the cloud storage bucket and
284291 // GetDestObjectPath specifies the path inside that bucket
285292 // where data files reside. The associated DBCloud instance
286293 // writes newly created files to this bucket.
287- virtual const std::string& GetDestBucketName () const = 0;
288- virtual const std::string& GetDestObjectPath () const = 0;
294+ const std::string& GetDestBucketName () const {
295+ return cloud_env_options.dest_bucket .GetBucketName ();
296+ }
297+ const std::string& GetDestObjectPath () const {
298+ return cloud_env_options.dest_bucket .GetObjectPath ();
299+ }
300+
289301 // returns the options used to create this env
290- virtual const CloudEnvOptions& GetCloudEnvOptions () = 0;
302+ const CloudEnvOptions& GetCloudEnvOptions () const {
303+ return cloud_env_options;
304+ }
291305
292306 // returns all the objects that have the specified path prefix and
293307 // are stored in a cloud bucket
0 commit comments