Remove deprecated Env::LoadEnv() (#11121)

Summary:
Can use Env::CreateFromString() instead

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11121

Test Plan: unit tests updated

Reviewed By: cbi42

Differential Revision: D42723813

Pulled By: pdillinger

fbshipit-source-id: 5d4b5b10225dfdaf662f5f8049ee965a05d3edc9
oxigraph-8.1.1
Peter Dillinger 2 years ago committed by Facebook GitHub Bot
parent 99e559533d
commit 9afa0f05ad
  1. 1
      HISTORY.md
  2. 9
      env/env.cc
  3. 11
      include/rocksdb/env.h
  4. 4
      options/options_test.cc

@ -5,6 +5,7 @@
### Feature Removal
* The feature block_cache_compressed is removed. Statistics related to it are removed too.
* Remove deprecated Env::LoadEnv(). Use Env::CreateFromString() instead.
### Public API Changes
* Completely removed the following deprecated/obsolete statistics: `STALL_L0_SLOWDOWN_MICROS`, `STALL_MEMTABLE_COMPACTION_MICROS`, `STALL_L0_NUM_FILES_MICROS`, `NO_ITERATORS`, `BLOB_DB_GC_NUM_KEYS_OVERWRITTEN`, `BLOB_DB_GC_NUM_KEYS_EXPIRED`, `BLOB_DB_GC_BYTES_OVERWRITTEN`, `BLOB_DB_GC_BYTES_EXPIRED`, `BLOB_DB_GC_MICROS`, and `NUM_DATA_BLOCKS_READ_PER_LEVEL`.

9
env/env.cc vendored

@ -640,10 +640,6 @@ Status Env::NewLogger(const std::string& fname,
return NewEnvLogger(fname, this, result);
}
Status Env::LoadEnv(const std::string& value, Env** result) {
return CreateFromString(ConfigOptions(), value, result);
}
Status Env::CreateFromString(const ConfigOptions& config_options,
const std::string& value, Env** result) {
Env* base = Env::Default();
@ -661,11 +657,6 @@ Status Env::CreateFromString(const ConfigOptions& config_options,
}
}
Status Env::LoadEnv(const std::string& value, Env** result,
std::shared_ptr<Env>* guard) {
return CreateFromString(ConfigOptions(), value, result, guard);
}
Status Env::CreateFromString(const ConfigOptions& config_options,
const std::string& value, Env** result,
std::shared_ptr<Env>* guard) {

@ -179,17 +179,6 @@ class Env : public Customizable {
// should implement this method.
const char* Name() const override { return ""; }
// Loads the environment specified by the input value into the result
// The CreateFromString alternative should be used; this method may be
// deprecated in a future release.
static Status LoadEnv(const std::string& value, Env** result);
// Loads the environment specified by the input value into the result
// The CreateFromString alternative should be used; this method may be
// deprecated in a future release.
static Status LoadEnv(const std::string& value, Env** result,
std::shared_ptr<Env>* guard);
// Loads the environment specified by the input value into the result
// @see Customizable for a more detailed description of the parameters and
// return codes

@ -1389,7 +1389,7 @@ TEST_F(OptionsTest, GetOptionsFromStringTest) {
ASSERT_EQ(new_options.max_open_files, 1);
ASSERT_TRUE(new_options.rate_limiter.get() != nullptr);
Env* newEnv = new_options.env;
ASSERT_OK(Env::LoadEnv(CustomEnv::kClassName(), &newEnv));
ASSERT_OK(Env::CreateFromString({}, CustomEnv::kClassName(), &newEnv));
ASSERT_EQ(newEnv, new_options.env);
config_options.ignore_unknown_options = false;
@ -3092,7 +3092,7 @@ TEST_F(OptionsOldApiTest, GetOptionsFromStringTest) {
ASSERT_EQ(new_options.max_open_files, 1);
ASSERT_TRUE(new_options.rate_limiter.get() != nullptr);
Env* newEnv = new_options.env;
ASSERT_OK(Env::LoadEnv("CustomEnvDefault", &newEnv));
ASSERT_OK(Env::CreateFromString({}, "CustomEnvDefault", &newEnv));
ASSERT_EQ(newEnv, new_options.env);
}

Loading…
Cancel
Save