@@ -32,19 +32,19 @@ CloudLogController::CloudLogController(
3232 : env_(env), info_log_(info_log) {
3333
3434 // Create a random number for the cache directory.
35- const std::string uid = trim (env_->GetPosixEnv ()->GenerateUniqueId ());
35+ const std::string uid = trim (env_->GetBaseEnv ()->GenerateUniqueId ());
3636
3737 // Temporary directory for cache.
3838 const std::string bucket_dir = kCacheDir + pathsep + env_->GetSrcBucketName ();
3939 cache_dir_ = bucket_dir + pathsep + uid;
4040
4141 // Create temporary directories.
42- status_ = env_->GetPosixEnv ()->CreateDirIfMissing (kCacheDir );
42+ status_ = env_->GetBaseEnv ()->CreateDirIfMissing (kCacheDir );
4343 if (status_.ok ()) {
44- status_ = env_->GetPosixEnv ()->CreateDirIfMissing (bucket_dir);
44+ status_ = env_->GetBaseEnv ()->CreateDirIfMissing (bucket_dir);
4545 }
4646 if (status_.ok ()) {
47- status_ = env_->GetPosixEnv ()->CreateDirIfMissing (cache_dir_);
47+ status_ = env_->GetBaseEnv ()->CreateDirIfMissing (cache_dir_);
4848 }
4949}
5050
@@ -86,17 +86,17 @@ Status CloudLogController::Apply(const Slice& in) {
8686 // If this file is not yet open, open it and store it in cache.
8787 if (iter == cache_fds_.end ()) {
8888 unique_ptr<RandomRWFile> result;
89- st = env_->GetPosixEnv ()->NewRandomRWFile (
89+ st = env_->GetBaseEnv ()->NewRandomRWFile (
9090 pathname, &result, EnvOptions ());
9191
9292 if (!st.ok ()) {
9393 // create the file
9494 unique_ptr<WritableFile> tmp_writable_file;
95- env_->GetPosixEnv ()->NewWritableFile (pathname, &tmp_writable_file,
95+ env_->GetBaseEnv ()->NewWritableFile (pathname, &tmp_writable_file,
9696 EnvOptions ());
9797 tmp_writable_file.reset ();
9898 // Try again.
99- st = env_->GetPosixEnv ()->NewRandomRWFile (
99+ st = env_->GetBaseEnv ()->NewRandomRWFile (
100100 pathname, &result, EnvOptions ());
101101 }
102102
@@ -129,7 +129,7 @@ Status CloudLogController::Apply(const Slice& in) {
129129 cache_fds_.erase (iter);
130130 }
131131
132- st = env_->GetPosixEnv ()->DeleteFile (pathname);
132+ st = env_->GetBaseEnv ()->DeleteFile (pathname);
133133 Log (InfoLogLevel::DEBUG_LEVEL, env_->info_log_ ,
134134 " [%s] Tailer: Deleted file: %s %s" ,
135135 GetTypeName ().c_str (), pathname.c_str (), st.ToString ().c_str ());
0 commit comments