From aa218968805f529dc6d858846d0be688c95b8bc2 Mon Sep 17 00:00:00 2001 From: anand76 Date: Mon, 18 Oct 2021 23:00:57 -0700 Subject: [PATCH] Add property_bag to FileOptions (#9030) Summary: Add a property_bag option in FileOptions for direct FileSystem users to pass custom properties to the provider in APIs such as NewRandomAccessFile, NewWritableFile etc. This field will be ignored/not populated by RocksDB. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9030 Reviewed By: zhichao-cao Differential Revision: D31630643 Pulled By: anand1976 fbshipit-source-id: 1e1ddc5e2933ecada99a94eada5f309b674a03e8 --- include/rocksdb/file_system.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/rocksdb/file_system.h b/include/rocksdb/file_system.h index 20f51f51e..fb105bc6c 100644 --- a/include/rocksdb/file_system.h +++ b/include/rocksdb/file_system.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "rocksdb/env.h" @@ -90,6 +91,14 @@ struct IOOptions { // Type of data being read/written IOType type; + // EXPERIMENTAL + // An option map that's opaque to RocksDB. It can be used to implement a + // custom contract between a FileSystem user and the provider. This is only + // useful in cases where a RocksDB user directly uses the FileSystem or file + // object for their own purposes, and wants to pass extra options to APIs + // such as NewRandomAccessFile and NewWritableFile. + std::unordered_map property_bag; + IOOptions() : timeout(0), prio(IOPriority::kIOLow), type(IOType::kUnknown) {} };