sapling/eden/fs/config/InodeCatalogOptions.h
John Elliott a0dd2bbc49 Simplify InodeCatalogTypes; add InodeCatalogOptions
Summary:
To enable consistent and simple configuration of a clone configuration and preferences around cloning:
* Refactored code to simplify InodeCatalogTypes (aka Overlay types) to three: Legacy, Sqlite, and InMemory
* Added new InodeCatalogOptions to support different variants for each type (currently only Sqlite has options)

This will allow CLI to read the users preferences from EdenConfig for overlay type, to control the defaults via Chef + GK, and to persist the configuration in CheckoutConfig. This change better unifies the settings that already existed in EdenConfig and CheckoutConfig.

Reviewed By: genevievehelsel, kmancini

Differential Revision: D48014211

fbshipit-source-id: 56e8f00d1680c717e736c84e5b5c24fb02e36b5d
2023-08-10 10:06:16 -07:00

35 lines
1007 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <folly/Utility.h>
#include <cstdint>
#include <type_traits>
#include "eden/common/utils/OptionSet.h"
namespace facebook::eden {
/**
* Options for `InodeCatalogType`s. Currently only used by `Sqlite`.
* Multiple values can be OR'd together. DEFAULT should be used to
* signal no options are enabled.
*/
struct InodeCatalogOptions : OptionSet<InodeCatalogOptions, uint32_t> {
using OptionSet::OptionSet;
static const NameTable table;
};
constexpr inline auto INODE_CATALOG_DEFAULT = InodeCatalogOptions::raw(0);
constexpr inline auto INODE_CATALOG_UNSAFE_IN_MEMORY =
InodeCatalogOptions::raw(1);
constexpr inline auto INODE_CATALOG_SYNCHRONOUS_OFF =
InodeCatalogOptions::raw(2);
constexpr inline auto INODE_CATALOG_BUFFERED = InodeCatalogOptions::raw(4);
} // namespace facebook::eden