diff --git a/velox/common/file/FileSystems.h b/velox/common/file/FileSystems.h index 1829215b625b..7e675a0efb1a 100644 --- a/velox/common/file/FileSystems.h +++ b/velox/common/file/FileSystems.h @@ -62,6 +62,12 @@ struct FileOptions { /// filesystem on Unix-like operating system, this corresponds to the direct /// IO mode if set. bool bufferIo{true}; + + /// Property bag to set onto files/directories. Think something similar to + /// ioctl(2). For other remote filesystems, this can be PutObjectTagging in + /// S3. + std::optional> properties{ + std::nullopt}; }; /// Defines directory options @@ -144,6 +150,22 @@ class FileSystem { /// recursively). Throws velox exception on failure. virtual void rmdir(std::string_view path) = 0; + /// Sets the property for a directory. The user provides the key-value pairs + /// inside 'properties' field of options. Throws velox exception on failure. + virtual void setDirectoryProperty( + std::string_view /*path*/, + const DirectoryOptions& options = {}) { + VELOX_UNSUPPORTED("setDirectoryProperty not implemented"); + } + + /// Gets the property for a directory. If no property is found, std::nullopt + /// is returned. Throws velox exception on failure. + virtual std::optional getDirectoryProperty( + std::string_view /*path*/, + std::string_view /*propertyKey*/) { + VELOX_UNSUPPORTED("getDirectoryProperty not implemented"); + } + protected: std::shared_ptr config_; };