rocksdb/utilities
ryneli 663afef884 Add EnvLibrados - RocksDB Env of RADOS (#1222)
EnvLibrados is a customized RocksDB Env to use RADOS as the backend file system of RocksDB. It overrides all file system related API of default Env. The easiest way to use it is just like following:

	std::string db_name = "test_db";
	std::string config_path = "path/to/ceph/config";
	DB* db;
	Options options;
	options.env = EnvLibrados(db_name, config_path);
	Status s = DB::Open(options, kDBPath, &db);

Then EnvLibrados will forward all file read/write operation to the RADOS cluster assigned by config_path. Default pool is db_name+"_pool".

There are some options that users could set for EnvLibrados.
- write_buffer_size. This variable is the max buffer size for WritableFile. After reaching the buffer_max_size, EnvLibrados will sync buffer content to RADOS, then clear buffer.
- db_pool. Rather than using default pool, users could set their own db pool name
- wal_dir. The dir for WAL files. Because RocksDB only has 2-level structure (dir_name/file_name), the format of wal_dir is "/dir_name"(CAN'T be "/dir1/dir2"). Default wal_dir is "/wal".
- wal_pool. Corresponding pool name for WAL files. Default value is db_name+"_wal_pool"

The example of setting options looks like following:

	db_name = "test_db";
	db_pool = db_name+"_pool";
	wal_dir = "/wal";
	wal_pool = db_name+"_wal_pool";
	write_buffer_size = 1 << 20;
	env_ = new EnvLibrados(db_name, config, db_pool, wal_dir, wal_pool, write_buffer_size);

	DB* db;
	Options options;
	options.env = env_;
	// The last level dir name should match the dir name in prefix_pool_map
	options.wal_dir = "/tmp/wal";

	// open DB
	Status s = DB::Open(options, kDBPath, &db);

Librados is required to compile EnvLibrados. Then use "$make LIBRADOS=1" to compile RocksDB. If you want to only compile EnvLibrados test, just run "$ make env_librados_test LIBRADOS=1". To run env_librados_test, you need to have a running RADOS cluster with the configure file located in "../ceph/src/ceph.conf" related to "rocksdb/".
2016-07-21 11:16:34 -07:00
..
backupable Add comment for GetBackupInfo about returned BackupInfos order 2016-07-06 12:54:01 -07:00
checkpoint Backup Options 2016-06-09 19:03:10 -07:00
compaction_filters Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
convenience Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
document Alpine Linux Build (#990) 2016-04-22 16:49:12 -07:00
flashcache Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
geodb Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
leveldb_options Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
memory Temporarily disable unstable tests in memory_test.cc 2016-02-09 16:28:34 -08:00
merge_operators Introduce FullMergeV2 (eliminate memcpy from merge operators) 2016-07-20 09:49:03 -07:00
options Only cache level 0 indexes and filter when opening table reader 2016-07-20 11:23:31 -07:00
persistent_cache Build break fix 2016-07-20 10:56:43 -07:00
redis Eliminate use of 'using namespace std'. Also remove a number of ADL references to std functions. 2016-05-20 07:42:18 -07:00
simulator_cache Remove %z Format Specifier and Fix Windows Build of sim_cache.cc (#1224) 2016-07-20 15:28:04 -07:00
spatialdb fix wrong assignment of level0_stop_writes_trigger in spatialdb (#1061) 2016-04-07 09:02:28 -07:00
table_properties_collectors Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
transactions delete unnessary pointer cast in beginInternalTransaction() function 2016-07-07 16:34:41 -07:00
ttl Introduce FullMergeV2 (eliminate memcpy from merge operators) 2016-07-20 09:49:03 -07:00
write_batch_with_index Fix clang analyzer errors 2016-07-08 17:50:51 -07:00
env_librados_test.cc Add EnvLibrados - RocksDB Env of RADOS (#1222) 2016-07-21 11:16:34 -07:00
env_librados.cc Add EnvLibrados - RocksDB Env of RADOS (#1222) 2016-07-21 11:16:34 -07:00
env_librados.md Add EnvLibrados - RocksDB Env of RADOS (#1222) 2016-07-21 11:16:34 -07:00
env_mirror_test.cc env: add EnvMirror 2015-12-10 21:32:45 -05:00
env_mirror.cc Fix warning in release 2015-12-23 22:38:12 -08:00
env_registry_test.cc Env registry for URI-based Env selection [pluggable Env part 1] 2016-06-03 08:15:16 -07:00
env_registry.cc Env registry for URI-based Env selection [pluggable Env part 1] 2016-06-03 08:15:16 -07:00
merge_operators.h Introduce FullMergeV2 (eliminate memcpy from merge operators) 2016-07-20 09:49:03 -07:00
util_merge_operators_test.cc Introduce FullMergeV2 (eliminate memcpy from merge operators) 2016-07-20 09:49:03 -07:00