diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index e17ae3eae3..e5f892a754 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -947,6 +947,10 @@ class WritableFileWrapper : public WritableFile { // *base_env must remain live while the result is in use. Env* NewMemEnv(Env* base_env); +// Returns a new environment that is used for HDFS environment. +// This is a factory method for HdfsEnv declared in hdfs/env_hdfs.h +Status NewHdfsEnv(Env** hdfs_env, const std::string& fsname); + } // namespace rocksdb #endif // STORAGE_ROCKSDB_INCLUDE_ENV_H_ diff --git a/util/env_hdfs.cc b/util/env_hdfs.cc index e7844e8dcf..7e12c747a8 100644 --- a/util/env_hdfs.cc +++ b/util/env_hdfs.cc @@ -594,6 +594,11 @@ Status HdfsEnv::NewLogger(const std::string& fname, return Status::OK(); } +// The factory method for creating an HDFS Env +Status NewHdfsEnv(Env** hdfs_env, const std::string& fsname) { + *hdfs_env = new HdfsEnv(fsname); + return Status::OK(); +} } // namespace rocksdb #endif // ROCKSDB_HDFS_FILE_C @@ -607,6 +612,10 @@ namespace rocksdb { const EnvOptions& options) { return Status::NotSupported("Not compiled with hdfs support"); } + + Status NewHdfsEnv(Env** hdfs_env, const std::string& fsname) { + return Status::NotSupported("Not compiled with hdfs support"); + } } #endif