diff options
author | babenko <babenko@yandex-team.com> | 2025-02-23 17:35:38 +0300 |
---|---|---|
committer | babenko <babenko@yandex-team.com> | 2025-02-23 17:50:16 +0300 |
commit | 09477f276e5b928d49ecef5c8f7e502668f1b8d6 (patch) | |
tree | c2e77e98bcc76902c05632f570df4534adfb69ee | |
parent | b7d18ff7873ad8234a431edeffd385f743b44dd6 (diff) | |
download | ydb-09477f276e5b928d49ecef5c8f7e502668f1b8d6.tar.gz |
YT-18571: Turn configs into structs
commit_hash:3674e694d6a99e354c9a4befc2ec8d106e2a00db
72 files changed, 301 insertions, 450 deletions
diff --git a/yt/yt/client/api/config.h b/yt/yt/client/api/config.h index 1ef1d79e0f..1fa2d876fc 100644 --- a/yt/yt/client/api/config.h +++ b/yt/yt/client/api/config.h @@ -29,10 +29,9 @@ DEFINE_ENUM(EConnectionType, //////////////////////////////////////////////////////////////////////////////// -class TTableMountCacheConfig +struct TTableMountCacheConfig : public NTabletClient::TTableMountCacheConfig { -public: int OnErrorRetryCount; TDuration OnErrorSlackPeriod; @@ -45,10 +44,9 @@ DEFINE_REFCOUNTED_TYPE(TTableMountCacheConfig) //////////////////////////////////////////////////////////////////////////////// -class TConnectionConfig +struct TConnectionConfig : public virtual NYTree::TYsonStruct { -public: EConnectionType ConnectionType; std::optional<std::string> ClusterName; TTableMountCacheConfigPtr TableMountCache; @@ -63,10 +61,9 @@ DEFINE_REFCOUNTED_TYPE(TConnectionConfig) //////////////////////////////////////////////////////////////////////////////// -class TConnectionDynamicConfig +struct TConnectionDynamicConfig : public virtual NYTree::TYsonStruct { -public: NTabletClient::TTableMountCacheDynamicConfigPtr TableMountCache; TExponentialBackoffOptions TabletWriteBackoff; @@ -80,10 +77,9 @@ DEFINE_REFCOUNTED_TYPE(TConnectionDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TPersistentQueuePollerConfig +struct TPersistentQueuePollerConfig : public virtual NYTree::TYsonStruct { -public: //! Try to keep at most this many prefetched rows in memory. This limit is approximate. i64 MaxPrefetchRowCount; @@ -124,10 +120,9 @@ DEFINE_REFCOUNTED_TYPE(TPersistentQueuePollerConfig) //////////////////////////////////////////////////////////////////////////////// -class TFileReaderConfig +struct TFileReaderConfig : public virtual NChunkClient::TMultiChunkReaderConfig { -public: REGISTER_YSON_STRUCT(TFileReaderConfig); static void Register(TRegistrar) @@ -138,11 +133,10 @@ DEFINE_REFCOUNTED_TYPE(TFileReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TFileWriterConfig +struct TFileWriterConfig : public NChunkClient::TMultiChunkWriterConfig , public NFileClient::TFileChunkWriterConfig { -public: REGISTER_YSON_STRUCT(TFileWriterConfig); static void Register(TRegistrar) @@ -153,11 +147,10 @@ DEFINE_REFCOUNTED_TYPE(TFileWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TJournalReaderConfig +struct TJournalReaderConfig : public NJournalClient::TChunkReaderConfig , public TWorkloadConfig { -public: REGISTER_YSON_STRUCT(TJournalReaderConfig); static void Register(TRegistrar) @@ -168,10 +161,9 @@ DEFINE_REFCOUNTED_TYPE(TJournalReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TJournalChunkWriterConfig +struct TJournalChunkWriterConfig : public virtual TWorkloadConfig { -public: int MaxBatchRowCount; i64 MaxBatchDataSize; TDuration MaxBatchDelay; @@ -205,10 +197,9 @@ DEFINE_REFCOUNTED_TYPE(TJournalChunkWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TJournalWriterConfig +struct TJournalWriterConfig : public TJournalChunkWriterConfig { -public: int MaxChunkRowCount; i64 MaxChunkDataSize; TDuration MaxChunkSessionDuration; diff --git a/yt/yt/client/api/public.h b/yt/yt/client/api/public.h index a50ae566b7..d289f6c9b7 100644 --- a/yt/yt/client/api/public.h +++ b/yt/yt/client/api/public.h @@ -156,17 +156,17 @@ DECLARE_REFCOUNTED_STRUCT(IJournalWriter) DECLARE_REFCOUNTED_CLASS(TPersistentQueuePoller) -DECLARE_REFCOUNTED_CLASS(TTableMountCacheConfig) -DECLARE_REFCOUNTED_CLASS(TConnectionConfig) -DECLARE_REFCOUNTED_CLASS(TConnectionDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TPersistentQueuePollerConfig) +DECLARE_REFCOUNTED_STRUCT(TTableMountCacheConfig) +DECLARE_REFCOUNTED_STRUCT(TConnectionConfig) +DECLARE_REFCOUNTED_STRUCT(TConnectionDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TPersistentQueuePollerConfig) -DECLARE_REFCOUNTED_CLASS(TFileReaderConfig) -DECLARE_REFCOUNTED_CLASS(TFileWriterConfig) -DECLARE_REFCOUNTED_CLASS(TJournalReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TFileReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TFileWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TJournalReaderConfig) -DECLARE_REFCOUNTED_CLASS(TJournalChunkWriterConfig) -DECLARE_REFCOUNTED_CLASS(TJournalWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TJournalChunkWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TJournalWriterConfig) DECLARE_REFCOUNTED_CLASS(TJournalChunkWriterOptions) diff --git a/yt/yt/client/api/rpc_proxy/config.h b/yt/yt/client/api/rpc_proxy/config.h index 793c48dce6..990708b746 100644 --- a/yt/yt/client/api/rpc_proxy/config.h +++ b/yt/yt/client/api/rpc_proxy/config.h @@ -19,10 +19,9 @@ namespace NYT::NApi::NRpcProxy { //////////////////////////////////////////////////////////////////////////////// -class TConnectionConfig +struct TConnectionConfig : public NApi::TConnectionConfig { -public: static TConnectionConfigPtr CreateFromClusterUrl( const std::string& clusterUrl, const std::optional<std::string>& proxyRole = {}); diff --git a/yt/yt/client/api/rpc_proxy/public.h b/yt/yt/client/api/rpc_proxy/public.h index fd74de1fef..cf825ad99e 100644 --- a/yt/yt/client/api/rpc_proxy/public.h +++ b/yt/yt/client/api/rpc_proxy/public.h @@ -11,7 +11,7 @@ struct TConnectionOptions; DECLARE_REFCOUNTED_STRUCT(IRowStreamEncoder) DECLARE_REFCOUNTED_STRUCT(IRowStreamDecoder) -DECLARE_REFCOUNTED_CLASS(TConnectionConfig) +DECLARE_REFCOUNTED_STRUCT(TConnectionConfig) extern const TString ApiServiceName; extern const TString DiscoveryServiceName; diff --git a/yt/yt/client/chaos_client/config.h b/yt/yt/client/chaos_client/config.h index 9391551f8a..fe3467c24c 100644 --- a/yt/yt/client/chaos_client/config.h +++ b/yt/yt/client/chaos_client/config.h @@ -10,11 +10,10 @@ namespace NYT::NChaosClient { //////////////////////////////////////////////////////////////////////////////// -class TChaosCacheChannelConfig +struct TChaosCacheChannelConfig : public NRpc::TRetryingChannelConfig , public NRpc::TBalancingChannelConfig { -public: REGISTER_YSON_STRUCT(TChaosCacheChannelConfig); static void Register(TRegistrar /*registrar*/) @@ -25,11 +24,10 @@ DEFINE_REFCOUNTED_TYPE(TChaosCacheChannelConfig) //////////////////////////////////////////////////////////////////////////////// -class TReplicationCardCacheConfig +struct TReplicationCardCacheConfig : public TAsyncExpiringCacheConfig , public TChaosCacheChannelConfig { -public: bool EnableWatching; REGISTER_YSON_STRUCT(TReplicationCardCacheConfig); @@ -41,10 +39,9 @@ DEFINE_REFCOUNTED_TYPE(TReplicationCardCacheConfig) //////////////////////////////////////////////////////////////////////////////// -class TReplicationCardCacheDynamicConfig +struct TReplicationCardCacheDynamicConfig : public virtual NYTree::TYsonStruct { -public: std::optional<bool> EnableWatching; REGISTER_YSON_STRUCT(TReplicationCardCacheDynamicConfig); diff --git a/yt/yt/client/chaos_client/public.h b/yt/yt/client/chaos_client/public.h index 8ecf2415b3..4f1eb1c50a 100644 --- a/yt/yt/client/chaos_client/public.h +++ b/yt/yt/client/chaos_client/public.h @@ -24,9 +24,9 @@ constexpr int MaxReplicasPerReplicationCard = 128; DECLARE_REFCOUNTED_STRUCT(TReplicationCard) DECLARE_REFCOUNTED_STRUCT(IReplicationCardCache) -DECLARE_REFCOUNTED_CLASS(TChaosCacheChannelConfig) -DECLARE_REFCOUNTED_CLASS(TReplicationCardCacheConfig) -DECLARE_REFCOUNTED_CLASS(TReplicationCardCacheDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TChaosCacheChannelConfig) +DECLARE_REFCOUNTED_STRUCT(TReplicationCardCacheConfig) +DECLARE_REFCOUNTED_STRUCT(TReplicationCardCacheDynamicConfig) struct TReplicationProgress; struct TReplicaHistoryItem; diff --git a/yt/yt/client/chunk_client/config.h b/yt/yt/client/chunk_client/config.h index b052610bd4..d703c2da3a 100644 --- a/yt/yt/client/chunk_client/config.h +++ b/yt/yt/client/chunk_client/config.h @@ -10,10 +10,9 @@ namespace NYT::NChunkClient { //////////////////////////////////////////////////////////////////////////////// -class TFetchChunkSpecConfig +struct TFetchChunkSpecConfig : public virtual NYTree::TYsonStruct { -public: int MaxChunksPerFetch; int MaxChunksPerLocateRequest; @@ -26,10 +25,9 @@ DEFINE_REFCOUNTED_TYPE(TFetchChunkSpecConfig) //////////////////////////////////////////////////////////////////////////////// -class TFetcherConfig +struct TFetcherConfig : public virtual NYTree::TYsonStruct { -public: TDuration NodeRpcTimeout; //! If node throttled fetch request, it becomes banned for this period of time. @@ -52,10 +50,9 @@ DEFINE_REFCOUNTED_TYPE(TFetcherConfig) //////////////////////////////////////////////////////////////////////////////// -class TBlockReordererConfig +struct TBlockReordererConfig : public virtual NYTree::TYsonStruct { -public: bool EnableBlockReordering; //! Instead of grouping blocks by column groups, shuffle them. @@ -71,10 +68,9 @@ DEFINE_REFCOUNTED_TYPE(TBlockReordererConfig) //////////////////////////////////////////////////////////////////////////////// -class TChunkSliceFetcherConfig +struct TChunkSliceFetcherConfig : public TFetcherConfig { -public: int MaxSlicesPerFetch; REGISTER_YSON_STRUCT(TChunkSliceFetcherConfig); @@ -86,11 +82,10 @@ DEFINE_REFCOUNTED_TYPE(TChunkSliceFetcherConfig) //////////////////////////////////////////////////////////////////////////////// -class TEncodingWriterConfig +struct TEncodingWriterConfig : public virtual TWorkloadConfig , public virtual TBlockReordererConfig { -public: i64 EncodeWindowSize; double DefaultCompressionRatio; bool VerifyCompression; @@ -130,10 +125,9 @@ public: //////////////////////////////////////////////////////////////////////////////// -class TReplicationReaderConfig +struct TReplicationReaderConfig : public virtual TRemoteReaderConfigBase { -public: //! Timeout for a block request. TDuration BlockRpcTimeout; @@ -259,10 +253,9 @@ DEFINE_REFCOUNTED_TYPE(TReplicationReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TBlockFetcherConfig +struct TBlockFetcherConfig : public virtual NYTree::TYsonStruct { -public: //! Prefetch window size (in bytes). i64 WindowSize; @@ -284,11 +277,10 @@ DEFINE_REFCOUNTED_TYPE(TBlockFetcherConfig) //////////////////////////////////////////////////////////////////////////////// -class TErasureReaderConfig +struct TErasureReaderConfig : public virtual TReplicationReaderConfig , public virtual TBlockFetcherConfig { -public: bool EnableAutoRepair; double ReplicationReaderSpeedLimitPerSec; TDuration SlowReaderExpirationTimeout; @@ -304,13 +296,12 @@ DEFINE_REFCOUNTED_TYPE(TErasureReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TMultiChunkReaderConfig +struct TMultiChunkReaderConfig : public virtual TErasureReaderConfig , public virtual TBlockFetcherConfig , public virtual TFetchChunkSpecConfig , public virtual TWorkloadConfig { -public: i64 MaxBufferSize; int MaxParallelReaders; @@ -323,11 +314,10 @@ DEFINE_REFCOUNTED_TYPE(TMultiChunkReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TReplicationWriterConfig +struct TReplicationWriterConfig : public virtual TWorkloadConfig , public virtual TBlockReordererConfig { -public: //! Maximum window size (in bytes). i64 SendWindowSize; @@ -387,10 +377,9 @@ DEFINE_REFCOUNTED_TYPE(TReplicationWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TErasureWriterConfig +struct TErasureWriterConfig : public virtual TBlockReordererConfig { -public: i64 WriterWindowSize; i64 WriterGroupSize; @@ -416,11 +405,10 @@ DEFINE_REFCOUNTED_TYPE(TErasureWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TMultiChunkWriterConfig +struct TMultiChunkWriterConfig : public TReplicationWriterConfig , public TErasureWriterConfig { -public: i64 DesiredChunkSize; i64 DesiredChunkWeight; i64 MaxMetaSize; @@ -460,10 +448,9 @@ DEFINE_REFCOUNTED_TYPE(TEncodingWriterOptions) //////////////////////////////////////////////////////////////////////////////// -class TChunkFragmentReaderConfig +struct TChunkFragmentReaderConfig : public virtual TRemoteReaderConfigBase { -public: //! Expiration timeout of corresponding sync expiring cache. TDuration PeerInfoExpirationTimeout; diff --git a/yt/yt/client/chunk_client/public.h b/yt/yt/client/chunk_client/public.h index 1202955335..dc437a9389 100644 --- a/yt/yt/client/chunk_client/public.h +++ b/yt/yt/client/chunk_client/public.h @@ -164,20 +164,20 @@ extern const TString DefaultSlotsMediumName; DECLARE_REFCOUNTED_STRUCT(IReaderBase) -DECLARE_REFCOUNTED_CLASS(TFetchChunkSpecConfig) -DECLARE_REFCOUNTED_CLASS(TFetcherConfig) -DECLARE_REFCOUNTED_CLASS(TChunkSliceFetcherConfig) -DECLARE_REFCOUNTED_CLASS(TEncodingWriterConfig) -DECLARE_REFCOUNTED_CLASS(TErasureReaderConfig) -DECLARE_REFCOUNTED_CLASS(TMultiChunkReaderConfig) -DECLARE_REFCOUNTED_CLASS(TBlockFetcherConfig) -DECLARE_REFCOUNTED_CLASS(TReplicationReaderConfig) -DECLARE_REFCOUNTED_CLASS(TReplicationWriterConfig) -DECLARE_REFCOUNTED_CLASS(TErasureWriterConfig) -DECLARE_REFCOUNTED_CLASS(TMultiChunkWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TFetchChunkSpecConfig) +DECLARE_REFCOUNTED_STRUCT(TFetcherConfig) +DECLARE_REFCOUNTED_STRUCT(TChunkSliceFetcherConfig) +DECLARE_REFCOUNTED_STRUCT(TEncodingWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TErasureReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TMultiChunkReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TBlockFetcherConfig) +DECLARE_REFCOUNTED_STRUCT(TReplicationReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TReplicationWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TErasureWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TMultiChunkWriterConfig) DECLARE_REFCOUNTED_CLASS(TEncodingWriterOptions) -DECLARE_REFCOUNTED_CLASS(TBlockReordererConfig) -DECLARE_REFCOUNTED_CLASS(TChunkFragmentReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TBlockReordererConfig) +DECLARE_REFCOUNTED_STRUCT(TChunkFragmentReaderConfig) struct TCodecDuration; class TCodecStatistics; diff --git a/yt/yt/client/driver/config.h b/yt/yt/client/driver/config.h index dcc378c72e..a5ddf95bf5 100644 --- a/yt/yt/client/driver/config.h +++ b/yt/yt/client/driver/config.h @@ -17,10 +17,9 @@ namespace NYT::NDriver { constexpr int ApiVersion3 = 3; constexpr int ApiVersion4 = 4; -class TDriverConfig +struct TDriverConfig : public NYTree::TYsonStruct { -public: NApi::TFileReaderConfigPtr FileReader; NApi::TFileWriterConfigPtr FileWriter; NTableClient::TTableReaderConfigPtr TableReader; diff --git a/yt/yt/client/driver/public.h b/yt/yt/client/driver/public.h index 6f4b5618da..fbde867898 100644 --- a/yt/yt/client/driver/public.h +++ b/yt/yt/client/driver/public.h @@ -9,7 +9,7 @@ namespace NYT::NDriver { DECLARE_REFCOUNTED_STRUCT(IDriver) DECLARE_REFCOUNTED_STRUCT(IProxyDiscoveryCache) -DECLARE_REFCOUNTED_CLASS(TDriverConfig) +DECLARE_REFCOUNTED_STRUCT(TDriverConfig) struct TCommandDescriptor; struct TDriverRequest; diff --git a/yt/yt/client/federated/config.h b/yt/yt/client/federated/config.h index d092c3f019..17b2fed982 100644 --- a/yt/yt/client/federated/config.h +++ b/yt/yt/client/federated/config.h @@ -12,10 +12,9 @@ namespace NYT::NClient::NFederated { //////////////////////////////////////////////////////////////////////////////// -class TFederationConfig +struct TFederationConfig : public virtual NYTree::TYsonStruct { -public: //! Bundle name which liveness should be checked on the background. std::optional<TString> BundleName; @@ -38,10 +37,9 @@ public: DEFINE_REFCOUNTED_TYPE(TFederationConfig) -class TConnectionConfig +struct TConnectionConfig : public TFederationConfig { -public: //! The RPC connection config for participants clusters. std::vector<NApi::NRpcProxy::TConnectionConfigPtr> RpcProxyConnections; diff --git a/yt/yt/client/federated/public.h b/yt/yt/client/federated/public.h index 37b85a1ae4..315a7c9436 100644 --- a/yt/yt/client/federated/public.h +++ b/yt/yt/client/federated/public.h @@ -6,8 +6,8 @@ namespace NYT::NClient::NFederated { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TFederationConfig) -DECLARE_REFCOUNTED_CLASS(TConnectionConfig) +DECLARE_REFCOUNTED_STRUCT(TFederationConfig) +DECLARE_REFCOUNTED_STRUCT(TConnectionConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/file_client/config.h b/yt/yt/client/file_client/config.h index 0645aadfb8..20bbb68ea4 100644 --- a/yt/yt/client/file_client/config.h +++ b/yt/yt/client/file_client/config.h @@ -8,10 +8,9 @@ namespace NYT::NFileClient { //////////////////////////////////////////////////////////////////////////////// -class TFileChunkWriterConfig +struct TFileChunkWriterConfig : public virtual NChunkClient::TEncodingWriterConfig { -public: i64 BlockSize; REGISTER_YSON_STRUCT(TFileChunkWriterConfig); diff --git a/yt/yt/client/file_client/public.h b/yt/yt/client/file_client/public.h index f999e52908..f3b0c5d371 100644 --- a/yt/yt/client/file_client/public.h +++ b/yt/yt/client/file_client/public.h @@ -6,7 +6,7 @@ namespace NYT::NFileClient { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TFileChunkWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TFileChunkWriterConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/formats/config.h b/yt/yt/client/formats/config.h index 84b4164b12..87452442c6 100644 --- a/yt/yt/client/formats/config.h +++ b/yt/yt/client/formats/config.h @@ -11,10 +11,9 @@ namespace NYT::NFormats { //////////////////////////////////////////////////////////////////////////////// -class TControlAttributesConfig +struct TControlAttributesConfig : public NTableClient::TChunkReaderOptions { -public: bool EnableKeySwitch; bool EnableEndOfStream; @@ -28,10 +27,9 @@ DEFINE_REFCOUNTED_TYPE(TControlAttributesConfig) //////////////////////////////////////////////////////////////////////////////// -class TYsonFormatConfig +struct TYsonFormatConfig : public NTableClient::TTypeConversionConfig { -public: NYson::EYsonFormat Format; EComplexTypeMode ComplexTypeMode; EDictMode StringKeyedDictMode; @@ -128,10 +126,9 @@ DEFINE_REFCOUNTED_TYPE(TDsvFormatConfigBase) //////////////////////////////////////////////////////////////////////////////// -class TYamrFormatConfig +struct TYamrFormatConfig : public TYamrFormatConfigBase { -public: TString Key; TString Subkey; TString Value; @@ -145,10 +142,9 @@ DEFINE_REFCOUNTED_TYPE(TYamrFormatConfig) //////////////////////////////////////////////////////////////////////////////// -class TDsvFormatConfig +struct TDsvFormatConfig : public TDsvFormatConfigBase { -public: std::string TableIndexColumn; bool SkipUnsupportedTypes = false; @@ -161,11 +157,10 @@ DEFINE_REFCOUNTED_TYPE(TDsvFormatConfig) //////////////////////////////////////////////////////////////////////////////// -class TYamredDsvFormatConfig +struct TYamredDsvFormatConfig : public TYamrFormatConfigBase , public TDsvFormatConfigBase { -public: char YamrKeysSeparator; std::vector<std::string> KeyColumnNames; @@ -188,10 +183,9 @@ DEFINE_ENUM(EMissingSchemafulDsvValueMode, (PrintSentinel) ); -class TSchemafulDsvFormatConfig +struct TSchemafulDsvFormatConfig : public TTableFormatConfigBase { -public: std::optional<std::vector<std::string>> Columns; EMissingSchemafulDsvValueMode MissingValueMode; @@ -263,10 +257,9 @@ DEFINE_ENUM(EProtobufEnumWritingMode, (SkipUnknownValues) ); -class TProtobufTypeConfig +struct TProtobufTypeConfig : public NYTree::TYsonStruct { -public: EProtobufType ProtoType; std::vector<TProtobufColumnConfigPtr> Fields; std::optional<TString> EnumerationName; @@ -278,10 +271,9 @@ public: DEFINE_REFCOUNTED_TYPE(TProtobufTypeConfig) -class TProtobufColumnConfig +struct TProtobufColumnConfig : public NYTree::TYsonStruct { -public: TString Name; std::optional<ui64> FieldNumber; bool Repeated; @@ -305,10 +297,9 @@ DEFINE_REFCOUNTED_TYPE(TProtobufColumnConfig) //////////////////////////////////////////////////////////////////////////////// -class TProtobufTableConfig +struct TProtobufTableConfig : public NYTree::TYsonStruct { -public: std::vector<TProtobufColumnConfigPtr> Columns; REGISTER_YSON_STRUCT(TProtobufTableConfig); @@ -323,10 +314,9 @@ DEFINE_ENUM(ENestedMessagesMode, (Yson) ); -class TProtobufFormatConfig +struct TProtobufFormatConfig : public NYTree::TYsonStruct { -public: TString FileDescriptorSet; // deprecated std::vector<int> FileIndices; // deprecated std::vector<int> MessageIndices; // deprecated @@ -373,10 +363,9 @@ DEFINE_ENUM(EWebJsonValueFormat, (Yql) ); -class TWebJsonFormatConfig +struct TWebJsonFormatConfig : public NYTree::TYsonStruct { -public: int MaxSelectedColumnCount; int FieldWeightLimit; int StringWeightLimit; @@ -396,10 +385,9 @@ DEFINE_REFCOUNTED_TYPE(TWebJsonFormatConfig) //////////////////////////////////////////////////////////////////////////////// -class TSkiffFormatConfig +struct TSkiffFormatConfig : public NYTree::TYsonStruct { -public: NYTree::IMapNodePtr SkiffSchemaRegistry; NYTree::IListNodePtr TableSkiffSchemas; @@ -415,10 +403,9 @@ DEFINE_REFCOUNTED_TYPE(TSkiffFormatConfig) //////////////////////////////////////////////////////////////////////////////// -class TYamlFormatConfig +struct TYamlFormatConfig : public NYTree::TYsonStruct { -public: //! Write explicit tag "!yt/uint64" for uint64 data type. //! Use this option if you want to preserve information about //! the original YT type (without it, numbers in range [0, 2^63-1] diff --git a/yt/yt/client/formats/public.h b/yt/yt/client/formats/public.h index 753456699b..5ef1c15734 100644 --- a/yt/yt/client/formats/public.h +++ b/yt/yt/client/formats/public.h @@ -63,27 +63,27 @@ DEFINE_ENUM(EFormatType, //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TYsonFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TYsonFormatConfig) DECLARE_REFCOUNTED_CLASS(TTableFormatConfigBase) -DECLARE_REFCOUNTED_CLASS(TYamrFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TYamrFormatConfig) DECLARE_REFCOUNTED_CLASS(TYamrFormatConfigBase) -DECLARE_REFCOUNTED_CLASS(TDsvFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TDsvFormatConfig) DECLARE_REFCOUNTED_CLASS(TDsvFormatConfigBase) -DECLARE_REFCOUNTED_CLASS(TYamredDsvFormatConfig) -DECLARE_REFCOUNTED_CLASS(TSchemafulDsvFormatConfig) -DECLARE_REFCOUNTED_CLASS(TProtobufTypeConfig) -DECLARE_REFCOUNTED_CLASS(TProtobufColumnConfig) -DECLARE_REFCOUNTED_CLASS(TProtobufTableConfig) -DECLARE_REFCOUNTED_CLASS(TProtobufFormatConfig) -DECLARE_REFCOUNTED_CLASS(TWebJsonFormatConfig) -DECLARE_REFCOUNTED_CLASS(TSkiffFormatConfig) -DECLARE_REFCOUNTED_CLASS(TYamlFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TYamredDsvFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TSchemafulDsvFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TProtobufTypeConfig) +DECLARE_REFCOUNTED_STRUCT(TProtobufColumnConfig) +DECLARE_REFCOUNTED_STRUCT(TProtobufTableConfig) +DECLARE_REFCOUNTED_STRUCT(TProtobufFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TWebJsonFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TSkiffFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TYamlFormatConfig) DECLARE_REFCOUNTED_STRUCT(IYamrConsumer) DECLARE_REFCOUNTED_STRUCT(ISchemalessFormatWriter) -DECLARE_REFCOUNTED_CLASS(TControlAttributesConfig) +DECLARE_REFCOUNTED_STRUCT(TControlAttributesConfig) struct IParser; diff --git a/yt/yt/client/journal_client/config.h b/yt/yt/client/journal_client/config.h index 23e2d7150c..b1922741e0 100644 --- a/yt/yt/client/journal_client/config.h +++ b/yt/yt/client/journal_client/config.h @@ -10,10 +10,9 @@ namespace NYT::NJournalClient { //////////////////////////////////////////////////////////////////////////////// -class TChunkReaderConfig +struct TChunkReaderConfig : public virtual NChunkClient::TReplicationReaderConfig { -public: REGISTER_YSON_STRUCT(TChunkReaderConfig); static void Register(TRegistrar registrar); diff --git a/yt/yt/client/journal_client/public.h b/yt/yt/client/journal_client/public.h index 12dbfaf6a8..5e0dc6c154 100644 --- a/yt/yt/client/journal_client/public.h +++ b/yt/yt/client/journal_client/public.h @@ -6,7 +6,7 @@ namespace NYT::NJournalClient { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TChunkReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TChunkReaderConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/logging/config.h b/yt/yt/client/logging/config.h index 8548655d4c..c9db5d72dd 100644 --- a/yt/yt/client/logging/config.h +++ b/yt/yt/client/logging/config.h @@ -20,10 +20,9 @@ namespace NYT::NLogging { //! - System events are disabled by default for format = yson logs. If you are enabling them for family = plain_text //! logs, do not forget to set system_message_family = plain_text. //! - If multiple hosts are writing to the same table, consider setting enable_host_field = true. -class TDynamicTableLogWriterConfig +struct TDynamicTableLogWriterConfig : public TLogWriterConfig { -public: static constexpr const TStringBuf WriterType = "dynamic_table"; //! Log destination. diff --git a/yt/yt/client/logging/public.h b/yt/yt/client/logging/public.h index 5e78745ed0..f37d80b60c 100644 --- a/yt/yt/client/logging/public.h +++ b/yt/yt/client/logging/public.h @@ -8,7 +8,7 @@ namespace NYT::NLogging { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TDynamicTableLogWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TDynamicTableLogWriterConfig) DECLARE_REFCOUNTED_STRUCT(IDynamicTableLogWriterFactory) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/misc/config.h b/yt/yt/client/misc/config.h index c8c82c1e06..f6321107eb 100644 --- a/yt/yt/client/misc/config.h +++ b/yt/yt/client/misc/config.h @@ -10,10 +10,9 @@ namespace NYT { //////////////////////////////////////////////////////////////////////////////// -class TWorkloadConfig +struct TWorkloadConfig : public virtual NYTree::TYsonStruct { -public: TWorkloadDescriptor WorkloadDescriptor; REGISTER_YSON_STRUCT(TWorkloadConfig); diff --git a/yt/yt/client/misc/public.h b/yt/yt/client/misc/public.h index e1eb1b6027..cb60281701 100644 --- a/yt/yt/client/misc/public.h +++ b/yt/yt/client/misc/public.h @@ -48,7 +48,7 @@ DEFINE_ENUM_UNKNOWN_VALUE(EWorkloadCategory, UserBatch); struct TWorkloadDescriptor; -DECLARE_REFCOUNTED_CLASS(TWorkloadConfig) +DECLARE_REFCOUNTED_STRUCT(TWorkloadConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/queue_client/config.h b/yt/yt/client/queue_client/config.h index a8090b6454..b4fe0f671d 100644 --- a/yt/yt/client/queue_client/config.h +++ b/yt/yt/client/queue_client/config.h @@ -12,10 +12,9 @@ namespace NYT::NQueueClient { //////////////////////////////////////////////////////////////////////////////// -class TPartitionReaderConfig +struct TPartitionReaderConfig : public NYTree::TYsonStruct { -public: i64 MaxRowCount; i64 MaxDataWeight; @@ -41,10 +40,9 @@ DEFINE_REFCOUNTED_TYPE(TPartitionReaderConfig) //! they will be trimmed automatically by the responsible queue agent. //! This is not applicable if no vital consumers exist for a queue. // TODO(achulkov2): Add example of how multiple vital/non-vital consumers and the options below interact. -class TQueueAutoTrimConfig +struct TQueueAutoTrimConfig : public NYTree::TYsonStructLite { -public: //! If set to false, no automatic trimming is performed. bool Enable; @@ -63,10 +61,9 @@ bool operator==(const TQueueAutoTrimConfig& lhs, const TQueueAutoTrimConfig& rhs //////////////////////////////////////////////////////////////////////////////// -class TQueueStaticExportConfig +struct TQueueStaticExportConfig : public NYTree::TYsonStruct { -public: //! Export will be performed at times that are multiple of this period. TDuration ExportPeriod; @@ -106,10 +103,9 @@ bool operator==(const TQueueStaticExportConfig& lhs, const TQueueStaticExportCon //////////////////////////////////////////////////////////////////////////////// -class TQueueStaticExportDestinationConfig +struct TQueueStaticExportDestinationConfig : public NYTree::TYsonStructLite { -public: NObjectClient::TObjectId OriginatingQueueId; REGISTER_YSON_STRUCT_LITE(TQueueStaticExportDestinationConfig); diff --git a/yt/yt/client/queue_client/public.h b/yt/yt/client/queue_client/public.h index 7a7a3f2eb9..3fe6ce99a5 100644 --- a/yt/yt/client/queue_client/public.h +++ b/yt/yt/client/queue_client/public.h @@ -29,9 +29,9 @@ DECLARE_REFCOUNTED_STRUCT(IProducerClient) DECLARE_REFCOUNTED_STRUCT(IProducerSession) DECLARE_REFCOUNTED_STRUCT(IPartitionReader) -DECLARE_REFCOUNTED_CLASS(TPartitionReaderConfig) -DECLARE_REFCOUNTED_CLASS(TQueueStaticExportConfig) -DECLARE_REFCOUNTED_CLASS(TQueueStaticExportDestinationConfig) +DECLARE_REFCOUNTED_STRUCT(TPartitionReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TQueueStaticExportConfig) +DECLARE_REFCOUNTED_STRUCT(TQueueStaticExportDestinationConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/table_client/config.h b/yt/yt/client/table_client/config.h index c21ed33d0d..44eeba3b6b 100644 --- a/yt/yt/client/table_client/config.h +++ b/yt/yt/client/table_client/config.h @@ -17,10 +17,9 @@ namespace NYT::NTableClient { //////////////////////////////////////////////////////////////////////////////// -class TRetentionConfig +struct TRetentionConfig : public virtual NYTree::TYsonStruct { -public: int MinDataVersions; int MaxDataVersions; TDuration MinDataTtl; @@ -43,10 +42,9 @@ DEFINE_ENUM(ESamplingMode, ((Block) (2)) ); -class TChunkReaderConfig +struct TChunkReaderConfig : public virtual NChunkClient::TBlockFetcherConfig { -public: std::optional<ESamplingMode> SamplingMode; std::optional<double> SamplingRate; std::optional<ui64> SamplingSeed; @@ -78,10 +76,9 @@ DEFINE_REFCOUNTED_TYPE(TChunkWriterTestingOptions) //////////////////////////////////////////////////////////////////////////////// -class THashTableChunkIndexWriterConfig +struct THashTableChunkIndexWriterConfig : public NYTree::TYsonStruct { -public: //! Hash table load factor. double LoadFactor; @@ -104,10 +101,9 @@ DEFINE_REFCOUNTED_TYPE(THashTableChunkIndexWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TChunkIndexesWriterConfig +struct TChunkIndexesWriterConfig : public NYTree::TYsonStruct { -public: THashTableChunkIndexWriterConfigPtr HashTable; REGISTER_YSON_STRUCT(TChunkIndexesWriterConfig); @@ -119,10 +115,9 @@ DEFINE_REFCOUNTED_TYPE(TChunkIndexesWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TSlimVersionedWriterConfig +struct TSlimVersionedWriterConfig : public NYTree::TYsonStruct { -public: double TopValueQuantile; bool EnablePerValueDictionaryEncoding; @@ -135,10 +130,9 @@ DEFINE_REFCOUNTED_TYPE(TSlimVersionedWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TChunkWriterConfig +struct TChunkWriterConfig : public NChunkClient::TEncodingWriterConfig { -public: i64 BlockSize; i64 MaxSegmentValueCount; @@ -177,10 +171,9 @@ DEFINE_REFCOUNTED_TYPE(TChunkWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TKeyFilterWriterConfig +struct TKeyFilterWriterConfig : public virtual NYTree::TYsonStruct { -public: bool Enable; i64 BlockSize; @@ -200,10 +193,9 @@ public: DEFINE_REFCOUNTED_TYPE(TKeyFilterWriterConfig) -class TKeyPrefixFilterWriterConfig +struct TKeyPrefixFilterWriterConfig : public TKeyFilterWriterConfig { -public: //! Will produce filters for key prefix of specified lengths. THashSet<int> PrefixLengths; @@ -216,10 +208,9 @@ DEFINE_REFCOUNTED_TYPE(TKeyPrefixFilterWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TDictionaryCompressionConfig +struct TDictionaryCompressionConfig : public virtual NYTree::TYsonStruct { -public: bool Enable; //! Idle period after last successful or unsuccessful building iteration. @@ -269,10 +260,9 @@ DEFINE_REFCOUNTED_TYPE(TDictionaryCompressionConfig) //////////////////////////////////////////////////////////////////////////////// -class TDictionaryCompressionSessionConfig +struct TDictionaryCompressionSessionConfig : public virtual NYTree::TYsonStruct { -public: // Compression session options. //! Level of compression algorithm. @@ -293,10 +283,9 @@ DEFINE_REFCOUNTED_TYPE(TDictionaryCompressionSessionConfig) //////////////////////////////////////////////////////////////////////////////// -class TBatchHunkReaderConfig +struct TBatchHunkReaderConfig : public virtual NYTree::TYsonStruct { -public: int MaxHunkCountPerRead; i64 MaxTotalHunkLengthPerRead; @@ -309,14 +298,13 @@ DEFINE_REFCOUNTED_TYPE(TBatchHunkReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TTableReaderConfig +struct TTableReaderConfig : public virtual NChunkClient::TMultiChunkReaderConfig , public virtual TChunkReaderConfig , public TBatchHunkReaderConfig , public NChunkClient::TChunkFragmentReaderConfig , public TDictionaryCompressionSessionConfig { -public: bool SuppressAccessTracking; bool SuppressExpirationTimeoutRenewal; EUnavailableChunkStrategy UnavailableChunkStrategy; @@ -334,7 +322,7 @@ DEFINE_REFCOUNTED_TYPE(TTableReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TTableWriterConfig +struct TTableWriterConfig : public TChunkWriterConfig , public NChunkClient::TMultiChunkWriterConfig { @@ -348,10 +336,9 @@ DEFINE_REFCOUNTED_TYPE(TTableWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TTypeConversionConfig +struct TTypeConversionConfig : public NYTree::TYsonStruct { -public: bool EnableTypeConversion; bool EnableStringToAllConversion; bool EnableAllToStringConversion; @@ -367,10 +354,9 @@ DEFINE_REFCOUNTED_TYPE(TTypeConversionConfig) //////////////////////////////////////////////////////////////////////////////// -class TInsertRowsFormatConfig +struct TInsertRowsFormatConfig : public virtual NYTree::TYsonStruct { -public: bool EnableNullToYsonEntityConversion; REGISTER_YSON_STRUCT(TInsertRowsFormatConfig); @@ -454,10 +440,9 @@ DEFINE_REFCOUNTED_TYPE(TChunkWriterOptions) //////////////////////////////////////////////////////////////////////////////// -class TVersionedRowDigestConfig +struct TVersionedRowDigestConfig : public NYTree::TYsonStruct { -public: bool Enable; TTDigestConfigPtr TDigest; @@ -487,10 +472,9 @@ struct TRowBatchReadOptions //////////////////////////////////////////////////////////////////////////////// -class TSchemalessBufferedDynamicTableWriterConfig +struct TSchemalessBufferedDynamicTableWriterConfig : public TTableWriterConfig { -public: i64 MaxBatchSize; TDuration FlushPeriod; TExponentialBackoffOptions RetryBackoff; diff --git a/yt/yt/client/table_client/public.h b/yt/yt/client/table_client/public.h index 1c15f1a8b2..ed281d943f 100644 --- a/yt/yt/client/table_client/public.h +++ b/yt/yt/client/table_client/public.h @@ -361,38 +361,38 @@ using TSchemalessWriterFactory = std::function<IUnversionedRowsetWriterPtr( DECLARE_REFCOUNTED_STRUCT(IVersionedReader) DECLARE_REFCOUNTED_STRUCT(IVersionedWriter) -DECLARE_REFCOUNTED_CLASS(THashTableChunkIndexWriterConfig) -DECLARE_REFCOUNTED_CLASS(TChunkIndexesWriterConfig) -DECLARE_REFCOUNTED_CLASS(TSlimVersionedWriterConfig) +DECLARE_REFCOUNTED_STRUCT(THashTableChunkIndexWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TChunkIndexesWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TSlimVersionedWriterConfig) DECLARE_REFCOUNTED_CLASS(TChunkWriterTestingOptions) -DECLARE_REFCOUNTED_CLASS(TChunkReaderConfig) -DECLARE_REFCOUNTED_CLASS(TChunkWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TChunkReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TChunkWriterConfig) -DECLARE_REFCOUNTED_CLASS(TKeyFilterWriterConfig) -DECLARE_REFCOUNTED_CLASS(TKeyPrefixFilterWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TKeyFilterWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TKeyPrefixFilterWriterConfig) -DECLARE_REFCOUNTED_CLASS(TDictionaryCompressionConfig) +DECLARE_REFCOUNTED_STRUCT(TDictionaryCompressionConfig) -DECLARE_REFCOUNTED_CLASS(TBatchHunkReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TBatchHunkReaderConfig) -DECLARE_REFCOUNTED_CLASS(TDictionaryCompressionSessionConfig) +DECLARE_REFCOUNTED_STRUCT(TDictionaryCompressionSessionConfig) -DECLARE_REFCOUNTED_CLASS(TTableReaderConfig) -DECLARE_REFCOUNTED_CLASS(TTableWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TTableReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TTableWriterConfig) -DECLARE_REFCOUNTED_CLASS(TRetentionConfig) +DECLARE_REFCOUNTED_STRUCT(TRetentionConfig) -DECLARE_REFCOUNTED_CLASS(TTypeConversionConfig) -DECLARE_REFCOUNTED_CLASS(TInsertRowsFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TTypeConversionConfig) +DECLARE_REFCOUNTED_STRUCT(TInsertRowsFormatConfig) DECLARE_REFCOUNTED_CLASS(TChunkReaderOptions) DECLARE_REFCOUNTED_CLASS(TChunkWriterOptions) -DECLARE_REFCOUNTED_CLASS(TVersionedRowDigestConfig) +DECLARE_REFCOUNTED_STRUCT(TVersionedRowDigestConfig) -DECLARE_REFCOUNTED_CLASS(TSchemalessBufferedDynamicTableWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TSchemalessBufferedDynamicTableWriterConfig) DECLARE_REFCOUNTED_CLASS(TSchemafulPipe) diff --git a/yt/yt/client/tablet_client/config.h b/yt/yt/client/tablet_client/config.h index 91c314ad63..2f6261d8fe 100644 --- a/yt/yt/client/tablet_client/config.h +++ b/yt/yt/client/tablet_client/config.h @@ -8,10 +8,9 @@ namespace NYT::NTabletClient { //////////////////////////////////////////////////////////////////////////////// -class TTableMountCacheConfig +struct TTableMountCacheConfig : public TAsyncExpiringCacheConfig { -public: //! If entry is requested for the first time then allow only client who requested the entry to wait for it. bool RejectIfEntryIsRequestedButNotReady; @@ -26,10 +25,9 @@ DEFINE_REFCOUNTED_TYPE(TTableMountCacheConfig) //////////////////////////////////////////////////////////////////////////////// -class TTableMountCacheDynamicConfig +struct TTableMountCacheDynamicConfig : public TAsyncExpiringCacheDynamicConfig { -public: std::optional<bool> RejectIfEntryIsRequestedButNotReady; REGISTER_YSON_STRUCT(TTableMountCacheDynamicConfig); @@ -41,10 +39,9 @@ DEFINE_REFCOUNTED_TYPE(TTableMountCacheDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TRemoteDynamicStoreReaderConfig +struct TRemoteDynamicStoreReaderConfig : public virtual NYTree::TYsonStruct { -public: TDuration ClientReadTimeout; TDuration ServerReadTimeout; TDuration ClientWriteTimeout; @@ -65,10 +62,9 @@ DEFINE_REFCOUNTED_TYPE(TRemoteDynamicStoreReaderConfig) //////////////////////////////////////////////////////////////////////////////// -class TRetryingRemoteDynamicStoreReaderConfig +struct TRetryingRemoteDynamicStoreReaderConfig : public TRemoteDynamicStoreReaderConfig { -public: //! Maximum number of locate requests. int RetryCount; diff --git a/yt/yt/client/tablet_client/public.h b/yt/yt/client/tablet_client/public.h index 23d61d1360..0d83997b84 100644 --- a/yt/yt/client/tablet_client/public.h +++ b/yt/yt/client/tablet_client/public.h @@ -250,10 +250,10 @@ DEFINE_ENUM(ETableToIndexCorrespondence, //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TTableMountCacheConfig) -DECLARE_REFCOUNTED_CLASS(TTableMountCacheDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TRemoteDynamicStoreReaderConfig) -DECLARE_REFCOUNTED_CLASS(TRetryingRemoteDynamicStoreReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TTableMountCacheConfig) +DECLARE_REFCOUNTED_STRUCT(TTableMountCacheDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TRemoteDynamicStoreReaderConfig) +DECLARE_REFCOUNTED_STRUCT(TRetryingRemoteDynamicStoreReaderConfig) DECLARE_REFCOUNTED_CLASS(TReplicatedTableOptions) DECLARE_REFCOUNTED_CLASS(TReplicationCollocationOptions) diff --git a/yt/yt/client/transaction_client/config.h b/yt/yt/client/transaction_client/config.h index 97b291de0c..d856d4e54f 100644 --- a/yt/yt/client/transaction_client/config.h +++ b/yt/yt/client/transaction_client/config.h @@ -10,11 +10,10 @@ namespace NYT::NTransactionClient { //////////////////////////////////////////////////////////////////////////////// -class TRemoteTimestampProviderConfig +struct TRemoteTimestampProviderConfig : public NRpc::TBalancingChannelConfig , public NRpc::TRetryingChannelConfig { -public: //! Timeout for RPC requests to timestamp provider. TDuration RpcTimeout; @@ -38,10 +37,9 @@ DEFINE_REFCOUNTED_TYPE(TRemoteTimestampProviderConfig) //////////////////////////////////////////////////////////////////////////////// -class TAlienTimestampProviderConfig +struct TAlienTimestampProviderConfig : public NYTree::TYsonStruct { -public: //! Clock server cell tag NObjectClient::TCellTag ClockClusterTag; @@ -54,7 +52,7 @@ public: DEFINE_REFCOUNTED_TYPE(TAlienTimestampProviderConfig) -DECLARE_REFCOUNTED_CLASS(TAlienTimestampProviderConfig) +DECLARE_REFCOUNTED_STRUCT(TAlienTimestampProviderConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/transaction_client/public.h b/yt/yt/client/transaction_client/public.h index 4a1f3a130b..7204cf5808 100644 --- a/yt/yt/client/transaction_client/public.h +++ b/yt/yt/client/transaction_client/public.h @@ -103,7 +103,7 @@ constexpr TTimestamp NotPreparedTimestamp = 0x3fffffffffffffffULL; //////////////////////////////////////////////////////////////////////////////// DECLARE_REFCOUNTED_STRUCT(ITimestampProvider) -DECLARE_REFCOUNTED_CLASS(TRemoteTimestampProviderConfig) +DECLARE_REFCOUNTED_STRUCT(TRemoteTimestampProviderConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/unittests/named_yson_token_ut.cpp b/yt/yt/client/unittests/named_yson_token_ut.cpp index e9e55c5842..fe20f0d853 100644 --- a/yt/yt/client/unittests/named_yson_token_ut.cpp +++ b/yt/yt/client/unittests/named_yson_token_ut.cpp @@ -45,6 +45,7 @@ public: { PositionalToNamedConfigInstance() = OldConfig_; } + private: TYsonConverterConfig OldConfig_; }; diff --git a/yt/yt/core/bus/tcp/config.h b/yt/yt/core/bus/tcp/config.h index d0a5bde08d..3fdb009ce2 100644 --- a/yt/yt/core/bus/tcp/config.h +++ b/yt/yt/core/bus/tcp/config.h @@ -13,10 +13,9 @@ namespace NYT::NBus { //////////////////////////////////////////////////////////////////////////////// -class TMultiplexingBandConfig +struct TMultiplexingBandConfig : public NYTree::TYsonStruct { -public: int TosLevel; THashMap<std::string, int> NetworkToTosLevel; @@ -32,10 +31,9 @@ DEFINE_REFCOUNTED_TYPE(TMultiplexingBandConfig) //////////////////////////////////////////////////////////////////////////////// -class TTcpDispatcherConfig +struct TTcpDispatcherConfig : public NYTree::TYsonStruct { -public: int ThreadPoolSize; TDuration ThreadPoolPollingPeriod; @@ -63,10 +61,9 @@ DEFINE_REFCOUNTED_TYPE(TTcpDispatcherConfig) //////////////////////////////////////////////////////////////////////////////// -class TTcpDispatcherDynamicConfig +struct TTcpDispatcherDynamicConfig : public NYTree::TYsonStruct { -public: std::optional<int> ThreadPoolSize; std::optional<TDuration> ThreadPoolPollingPeriod; @@ -91,10 +88,9 @@ DEFINE_REFCOUNTED_TYPE(TTcpDispatcherDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TBusConfig +struct TBusConfig : public NNet::TDialerConfig { -public: bool EnableQuickAck; int BindRetryCount; @@ -130,10 +126,9 @@ DEFINE_REFCOUNTED_TYPE(TBusConfig) //////////////////////////////////////////////////////////////////////////////// -class TBusDynamicConfig +struct TBusDynamicConfig : public NYTree::TYsonStruct { -public: bool NeedRejectConnectionDueMemoryOvercommit; REGISTER_YSON_STRUCT(TBusDynamicConfig); @@ -145,10 +140,9 @@ DEFINE_REFCOUNTED_TYPE(TBusDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TBusServerConfig +struct TBusServerConfig : public TBusConfig { -public: std::optional<int> Port; std::optional<std::string> UnixDomainSocketPath; int MaxBacklogSize; @@ -166,10 +160,9 @@ DEFINE_REFCOUNTED_TYPE(TBusServerConfig) //////////////////////////////////////////////////////////////////////////////// -class TBusServerDynamicConfig +struct TBusServerDynamicConfig : public TBusDynamicConfig { -public: REGISTER_YSON_STRUCT(TBusServerDynamicConfig); static void Register(TRegistrar registrar); @@ -179,10 +172,9 @@ DEFINE_REFCOUNTED_TYPE(TBusServerDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TBusClientConfig +struct TBusClientConfig : public TBusConfig { -public: std::optional<std::string> Address; std::optional<std::string> UnixDomainSocketPath; @@ -198,10 +190,9 @@ DEFINE_REFCOUNTED_TYPE(TBusClientConfig) //////////////////////////////////////////////////////////////////////////////// -class TBusClientDynamicConfig +struct TBusClientDynamicConfig : public TBusDynamicConfig { -public: REGISTER_YSON_STRUCT(TBusClientDynamicConfig); static void Register(TRegistrar registrar); diff --git a/yt/yt/core/bus/tcp/public.h b/yt/yt/core/bus/tcp/public.h index aa86f46c4b..bed9882ffe 100644 --- a/yt/yt/core/bus/tcp/public.h +++ b/yt/yt/core/bus/tcp/public.h @@ -11,18 +11,18 @@ namespace NYT::NBus { struct TBusNetworkCounters; using TBusNetworkCountersPtr = TIntrusivePtr<TBusNetworkCounters>; -DECLARE_REFCOUNTED_CLASS(TMultiplexingBandConfig) -DECLARE_REFCOUNTED_CLASS(TTcpDispatcherConfig) -DECLARE_REFCOUNTED_CLASS(TTcpDispatcherDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TMultiplexingBandConfig) +DECLARE_REFCOUNTED_STRUCT(TTcpDispatcherConfig) +DECLARE_REFCOUNTED_STRUCT(TTcpDispatcherDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TBusConfig) -DECLARE_REFCOUNTED_CLASS(TBusDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TBusConfig) +DECLARE_REFCOUNTED_STRUCT(TBusDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TBusServerConfig) -DECLARE_REFCOUNTED_CLASS(TBusServerDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TBusServerConfig) +DECLARE_REFCOUNTED_STRUCT(TBusServerDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TBusClientConfig) -DECLARE_REFCOUNTED_CLASS(TBusClientDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TBusClientConfig) +DECLARE_REFCOUNTED_STRUCT(TBusClientDynamicConfig) struct IPacketTranscoderFactory; diff --git a/yt/yt/core/crypto/config.h b/yt/yt/core/crypto/config.h index 41b79a751b..4bd7058140 100644 --- a/yt/yt/core/crypto/config.h +++ b/yt/yt/core/crypto/config.h @@ -9,10 +9,9 @@ namespace NYT::NCrypto { //////////////////////////////////////////////////////////////////////////////// //! Either an inlined value or a file reference. -class TPemBlobConfig +struct TPemBlobConfig : public NYTree::TYsonStruct { -public: std::optional<TString> FileName; std::optional<TString> Value; diff --git a/yt/yt/core/crypto/public.h b/yt/yt/core/crypto/public.h index 8e658bd6cf..9c04e5eba0 100644 --- a/yt/yt/core/crypto/public.h +++ b/yt/yt/core/crypto/public.h @@ -8,7 +8,7 @@ namespace NYT::NCrypto { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TPemBlobConfig) +DECLARE_REFCOUNTED_STRUCT(TPemBlobConfig) DECLARE_REFCOUNTED_CLASS(TSslContext) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/dns/config.h b/yt/yt/core/dns/config.h index 73a15ce820..4c8767c2fd 100644 --- a/yt/yt/core/dns/config.h +++ b/yt/yt/core/dns/config.h @@ -8,10 +8,9 @@ namespace NYT::NDns { //////////////////////////////////////////////////////////////////////////////// -class TAresDnsResolverConfig +struct TAresDnsResolverConfig : public virtual NYTree::TYsonStruct { -public: int Retries; TDuration RetryDelay; TDuration ResolveTimeout; diff --git a/yt/yt/core/dns/public.h b/yt/yt/core/dns/public.h index 175c6ab62f..d1bf234602 100644 --- a/yt/yt/core/dns/public.h +++ b/yt/yt/core/dns/public.h @@ -8,7 +8,7 @@ namespace NYT::NDns { struct TDnsResolveOptions; -DECLARE_REFCOUNTED_CLASS(TAresDnsResolverConfig) +DECLARE_REFCOUNTED_STRUCT(TAresDnsResolverConfig) DECLARE_REFCOUNTED_STRUCT(IDnsResolver) diff --git a/yt/yt/core/http/config.h b/yt/yt/core/http/config.h index 41ca0a1cda..cc510689b0 100644 --- a/yt/yt/core/http/config.h +++ b/yt/yt/core/http/config.h @@ -10,10 +10,9 @@ namespace NYT::NHttp { //////////////////////////////////////////////////////////////////////////////// -class THttpIOConfig +struct THttpIOConfig : public virtual NYTree::TYsonStruct { -public: int ReadBufferSize; int MaxRedirectCount; @@ -36,10 +35,9 @@ DEFINE_REFCOUNTED_TYPE(THttpIOConfig) //////////////////////////////////////////////////////////////////////////////// -class TServerConfig +struct TServerConfig : public THttpIOConfig { -public: //! If zero then the port is chosen automatically. int Port; @@ -74,10 +72,9 @@ DEFINE_REFCOUNTED_TYPE(TServerConfig) //////////////////////////////////////////////////////////////////////////////// -class TClientConfig +struct TClientConfig : public THttpIOConfig { -public: int MaxIdleConnections; NNet::TDialerConfigPtr Dialer; bool OmitQuestionMarkForEmptyQuery; @@ -91,10 +88,9 @@ DEFINE_REFCOUNTED_TYPE(TClientConfig) //////////////////////////////////////////////////////////////////////////////// -class TRetryingClientConfig +struct TRetryingClientConfig : public NYTree::TYsonStruct { -public: TDuration RequestTimeout; TDuration AttemptTimeout; TDuration BackoffTimeout; @@ -109,10 +105,9 @@ DEFINE_REFCOUNTED_TYPE(TRetryingClientConfig); //////////////////////////////////////////////////////////////////////////////// -class TCorsConfig +struct TCorsConfig : public NYTree::TYsonStruct { -public: bool DisableCorsCheck; std::vector<TString> HostAllowList; std::vector<TString> HostSuffixAllowList; diff --git a/yt/yt/core/http/public.h b/yt/yt/core/http/public.h index b904f89675..520b7dfc49 100644 --- a/yt/yt/core/http/public.h +++ b/yt/yt/core/http/public.h @@ -20,11 +20,11 @@ DECLARE_REFCOUNTED_STRUCT(IResponseChecker) DECLARE_REFCOUNTED_STRUCT(IRequestPathMatcher) DECLARE_REFCOUNTED_STRUCT(IHttpHandler) -DECLARE_REFCOUNTED_CLASS(THttpIOConfig) -DECLARE_REFCOUNTED_CLASS(TServerConfig) -DECLARE_REFCOUNTED_CLASS(TClientConfig) -DECLARE_REFCOUNTED_CLASS(TRetryingClientConfig) -DECLARE_REFCOUNTED_CLASS(TCorsConfig) +DECLARE_REFCOUNTED_STRUCT(THttpIOConfig) +DECLARE_REFCOUNTED_STRUCT(TServerConfig) +DECLARE_REFCOUNTED_STRUCT(TClientConfig) +DECLARE_REFCOUNTED_STRUCT(TRetryingClientConfig) +DECLARE_REFCOUNTED_STRUCT(TCorsConfig) DECLARE_REFCOUNTED_CLASS(TConnectionPool) diff --git a/yt/yt/core/https/config.h b/yt/yt/core/https/config.h index eb6f010008..ad740cc0fe 100644 --- a/yt/yt/core/https/config.h +++ b/yt/yt/core/https/config.h @@ -10,10 +10,9 @@ namespace NYT::NHttps { //////////////////////////////////////////////////////////////////////////////// -class TServerCredentialsConfig +struct TServerCredentialsConfig : public NYTree::TYsonStruct { -public: NCrypto::TPemBlobConfigPtr PrivateKey; NCrypto::TPemBlobConfigPtr CertChain; TDuration UpdatePeriod; @@ -27,10 +26,9 @@ DEFINE_REFCOUNTED_TYPE(TServerCredentialsConfig) //////////////////////////////////////////////////////////////////////////////// -class TServerConfig +struct TServerConfig : public NHttp::TServerConfig { -public: TServerCredentialsConfigPtr Credentials; REGISTER_YSON_STRUCT(TServerConfig); @@ -42,10 +40,9 @@ DEFINE_REFCOUNTED_TYPE(TServerConfig) //////////////////////////////////////////////////////////////////////////////// -class TClientCredentialsConfig +struct TClientCredentialsConfig : public NYTree::TYsonStruct { -public: NCrypto::TPemBlobConfigPtr PrivateKey; NCrypto::TPemBlobConfigPtr CertChain; @@ -58,10 +55,9 @@ DEFINE_REFCOUNTED_TYPE(TClientCredentialsConfig) //////////////////////////////////////////////////////////////////////////////// -class TClientConfig +struct TClientConfig : public NHttp::TClientConfig { -public: // If missing then builtin certificate store is used. TClientCredentialsConfigPtr Credentials; diff --git a/yt/yt/core/https/public.h b/yt/yt/core/https/public.h index effb3a114e..1a5bc745b4 100644 --- a/yt/yt/core/https/public.h +++ b/yt/yt/core/https/public.h @@ -6,10 +6,10 @@ namespace NYT::NHttps { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TServerCredentialsConfig) -DECLARE_REFCOUNTED_CLASS(TClientCredentialsConfig) -DECLARE_REFCOUNTED_CLASS(TServerConfig) -DECLARE_REFCOUNTED_CLASS(TClientConfig) +DECLARE_REFCOUNTED_STRUCT(TServerCredentialsConfig) +DECLARE_REFCOUNTED_STRUCT(TClientCredentialsConfig) +DECLARE_REFCOUNTED_STRUCT(TServerConfig) +DECLARE_REFCOUNTED_STRUCT(TClientConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/json/config.h b/yt/yt/core/json/config.h index 67ba835016..4d82eceb33 100644 --- a/yt/yt/core/json/config.h +++ b/yt/yt/core/json/config.h @@ -19,10 +19,9 @@ DEFINE_ENUM(EJsonAttributesMode, (OnDemand) ); -class TJsonFormatConfig +struct TJsonFormatConfig : public NYTree::TYsonStruct { -public: EJsonFormat Format; EJsonAttributesMode AttributesMode; bool Plain; diff --git a/yt/yt/core/json/public.h b/yt/yt/core/json/public.h index d57069f7a9..a709c4f977 100644 --- a/yt/yt/core/json/public.h +++ b/yt/yt/core/json/public.h @@ -8,7 +8,7 @@ namespace NYT::NJson { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TJsonFormatConfig) +DECLARE_REFCOUNTED_STRUCT(TJsonFormatConfig) struct IJsonConsumer; struct IJsonWriter; diff --git a/yt/yt/core/logging/config.h b/yt/yt/core/logging/config.h index f634e3af4f..2761700b7c 100644 --- a/yt/yt/core/logging/config.h +++ b/yt/yt/core/logging/config.h @@ -12,10 +12,9 @@ namespace NYT::NLogging { //////////////////////////////////////////////////////////////////////////////// -class TLogWriterConfig +struct TLogWriterConfig : public NYTree::TYsonStruct { -public: TString Type; ELogFormat Format; @@ -51,10 +50,9 @@ DEFINE_REFCOUNTED_TYPE(TLogWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TRotationPolicyConfig +struct TRotationPolicyConfig : public NYTree::TYsonStruct { -public: //! Upper limit on the total size of rotated log files. i64 MaxTotalSizeToKeep; //! Upper limit on the number of rotated log files. @@ -73,10 +71,9 @@ DEFINE_REFCOUNTED_TYPE(TRotationPolicyConfig) //////////////////////////////////////////////////////////////////////////////// -class TFileLogWriterConfig +struct TFileLogWriterConfig : public TLogWriterConfig { -public: static constexpr const TStringBuf WriterType = "file"; TString FileName; @@ -100,10 +97,9 @@ DEFINE_REFCOUNTED_TYPE(TFileLogWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TStderrLogWriterConfig +struct TStderrLogWriterConfig : public TLogWriterConfig { -public: static constexpr TStringBuf WriterType = "stderr"; REGISTER_YSON_STRUCT(TStderrLogWriterConfig); @@ -115,10 +111,9 @@ DEFINE_REFCOUNTED_TYPE(TStderrLogWriterConfig) //////////////////////////////////////////////////////////////////////////////// -class TRuleConfig +struct TRuleConfig : public NYTree::TYsonStruct { -public: std::optional<THashSet<TString>> IncludeCategories; THashSet<TString> ExcludeCategories; @@ -141,10 +136,9 @@ DEFINE_REFCOUNTED_TYPE(TRuleConfig) //////////////////////////////////////////////////////////////////////////////// -class TLogManagerConfig +struct TLogManagerConfig : public NYTree::TYsonStruct { -public: std::optional<TDuration> FlushPeriod; std::optional<TDuration> WatchPeriod; std::optional<TDuration> CheckSpacePeriod; @@ -212,10 +206,9 @@ DEFINE_REFCOUNTED_TYPE(TLogManagerConfig) //////////////////////////////////////////////////////////////////////////////// -class TLogManagerDynamicConfig +struct TLogManagerDynamicConfig : public NYTree::TYsonStruct { -public: std::optional<i64> MinDiskSpace; std::optional<int> HighBacklogWatermark; diff --git a/yt/yt/core/logging/public.h b/yt/yt/core/logging/public.h index cd9b4d1568..b24e07fba1 100644 --- a/yt/yt/core/logging/public.h +++ b/yt/yt/core/logging/public.h @@ -30,14 +30,14 @@ DEFINE_ENUM(ECompressionMethod, //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TLogManagerConfig) -DECLARE_REFCOUNTED_CLASS(TLogManagerDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TFormatterConfig) -DECLARE_REFCOUNTED_CLASS(TLogWriterConfig) -DECLARE_REFCOUNTED_CLASS(TRuleConfig) -DECLARE_REFCOUNTED_CLASS(TFileLogWriterConfig) -DECLARE_REFCOUNTED_CLASS(TRotationPolicyConfig) -DECLARE_REFCOUNTED_CLASS(TStderrLogWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TLogManagerConfig) +DECLARE_REFCOUNTED_STRUCT(TLogManagerDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TFormatterConfig) +DECLARE_REFCOUNTED_STRUCT(TLogWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TRuleConfig) +DECLARE_REFCOUNTED_STRUCT(TFileLogWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TRotationPolicyConfig) +DECLARE_REFCOUNTED_STRUCT(TStderrLogWriterConfig) struct ILogFormatter; struct ISystemLogEventProvider; diff --git a/yt/yt/core/logging/unittests/logging_ut.cpp b/yt/yt/core/logging/unittests/logging_ut.cpp index 1f00187cbf..6d9bc35b6b 100644 --- a/yt/yt/core/logging/unittests/logging_ut.cpp +++ b/yt/yt/core/logging/unittests/logging_ut.cpp @@ -1341,12 +1341,11 @@ TEST_F(TLoggingTest, Anchors) //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TTestWriterConfig) +DECLARE_REFCOUNTED_STRUCT(TTestWriterConfig) -class TTestWriterConfig +struct TTestWriterConfig : public TYsonStruct { -public: int Padding; REGISTER_YSON_STRUCT(TTestWriterConfig); diff --git a/yt/yt/core/misc/cache_config.h b/yt/yt/core/misc/cache_config.h index 24e6b2c946..19760d4346 100644 --- a/yt/yt/core/misc/cache_config.h +++ b/yt/yt/core/misc/cache_config.h @@ -8,10 +8,9 @@ namespace NYT { //////////////////////////////////////////////////////////////////////////////// -class TSlruCacheConfig +struct TSlruCacheConfig : public virtual NYTree::TYsonStruct { -public: //! The maximum number of weight units cached items are allowed to occupy. //! Zero means that no items are cached. i64 Capacity; @@ -45,10 +44,9 @@ DEFINE_REFCOUNTED_TYPE(TSlruCacheConfig) //////////////////////////////////////////////////////////////////////////////// -class TSlruCacheDynamicConfig +struct TSlruCacheDynamicConfig : public virtual NYTree::TYsonStruct { -public: //! The maximum number of weight units cached items are allowed to occupy. //! Zero means that no items are cached. std::optional<i64> Capacity; @@ -87,10 +85,9 @@ DEFINE_REFCOUNTED_TYPE(TSlruCacheDynamicConfig) * If request was unsuccessful, the entry (which contains error response) will be expired * after ExpireAfterFailedUpdateTime. */ -class TAsyncExpiringCacheConfig +struct TAsyncExpiringCacheConfig : public virtual NYTree::TYsonStruct { -public: //! Time since last finished Get() after which an entry is removed. TDuration ExpireAfterAccessTime; @@ -120,10 +117,9 @@ DEFINE_REFCOUNTED_TYPE(TAsyncExpiringCacheConfig) //////////////////////////////////////////////////////////////////////////////// -class TAsyncExpiringCacheDynamicConfig +struct TAsyncExpiringCacheDynamicConfig : public virtual NYTree::TYsonStruct { -public: std::optional<TDuration> ExpireAfterAccessTime; std::optional<TDuration> ExpireAfterSuccessfulUpdateTime; std::optional<TDuration> ExpireAfterFailedUpdateTime; diff --git a/yt/yt/core/misc/config.h b/yt/yt/core/misc/config.h index fd15aea4af..932f0f08cb 100644 --- a/yt/yt/core/misc/config.h +++ b/yt/yt/core/misc/config.h @@ -46,10 +46,9 @@ struct TConstantBackoffOptions //! TODO(arkady-e1ppa): Make configs below pairs of POD-structs and TExternalizedYsonStruct. -class TLogDigestConfig +struct TLogDigestConfig : public NYTree::TYsonStruct { -public: // We will round each sample x to the range from [(1 - RelativePrecision)*x, (1 + RelativePrecision)*x]. // This parameter affects the memory usage of the digest, it is proportional to // log(UpperBound / LowerBound) / log(1 + RelativePrecision). @@ -71,10 +70,9 @@ DEFINE_REFCOUNTED_TYPE(TLogDigestConfig) //////////////////////////////////////////////////////////////////////////////// -class THistogramDigestConfig +struct THistogramDigestConfig : public NYTree::TYsonStruct { -public: // We will round each sample x to a value from [x - AbsolutePrecision / 2, x + AbsolutePrecision / 2]. // More precisely, size of each bucket in the histogram will be equal to AbsolutePrecision. // This parameter affects the memory usage of the digest, it is proportional to ((UpperBound - LowerBound) / AbsolutePrecision). @@ -96,10 +94,9 @@ DEFINE_REFCOUNTED_TYPE(THistogramDigestConfig) //////////////////////////////////////////////////////////////////////////////// -class TAdaptiveHedgingManagerConfig +struct TAdaptiveHedgingManagerConfig : public virtual NYTree::TYsonStruct { -public: //! Percentage of primary requests that should have a hedging counterpart. //! Null is for disabled hedging. std::optional<double> MaxBackupRequestRatio; diff --git a/yt/yt/core/misc/configurable_singleton_def.h b/yt/yt/core/misc/configurable_singleton_def.h index 89ed29fcd8..8fe97e25d5 100644 --- a/yt/yt/core/misc/configurable_singleton_def.h +++ b/yt/yt/core/misc/configurable_singleton_def.h @@ -44,11 +44,10 @@ private: //////////////////////////////////////////////////////////////////////////////// -class TSingletonsConfig +struct TSingletonsConfig : public NDetail::TSingletonsConfigBase<true> , public virtual NYTree::TYsonStruct { -public: REGISTER_YSON_STRUCT(TSingletonsConfig); static void Register(TRegistrar registrar); @@ -58,11 +57,10 @@ DEFINE_REFCOUNTED_TYPE(TSingletonsConfig); //////////////////////////////////////////////////////////////////////////////// -class TSingletonsDynamicConfig +struct TSingletonsDynamicConfig : public NDetail::TSingletonsConfigBase<false> , public virtual NYTree::TYsonStruct { -public: REGISTER_YSON_STRUCT(TSingletonsDynamicConfig); static void Register(TRegistrar registrar); diff --git a/yt/yt/core/misc/public.h b/yt/yt/core/misc/public.h index e67d095ae5..6f6b86fe11 100644 --- a/yt/yt/core/misc/public.h +++ b/yt/yt/core/misc/public.h @@ -98,17 +98,17 @@ class TStringBuilder; DECLARE_REFCOUNTED_STRUCT(IDigest) DECLARE_REFCOUNTED_STRUCT(IPersistentDigest) -DECLARE_REFCOUNTED_CLASS(TSlruCacheDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TSlruCacheConfig) +DECLARE_REFCOUNTED_STRUCT(TSlruCacheDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TSlruCacheConfig) -DECLARE_REFCOUNTED_CLASS(TAsyncExpiringCacheDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TAsyncExpiringCacheConfig) +DECLARE_REFCOUNTED_STRUCT(TAsyncExpiringCacheDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TAsyncExpiringCacheConfig) -DECLARE_REFCOUNTED_CLASS(TLogDigestConfig) -DECLARE_REFCOUNTED_CLASS(THistogramDigestConfig) +DECLARE_REFCOUNTED_STRUCT(TLogDigestConfig) +DECLARE_REFCOUNTED_STRUCT(THistogramDigestConfig) -DECLARE_REFCOUNTED_CLASS(TSingletonsConfig) -DECLARE_REFCOUNTED_CLASS(TSingletonsDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TSingletonsConfig) +DECLARE_REFCOUNTED_STRUCT(TSingletonsDynamicConfig) class TSignalRegistry; @@ -162,7 +162,7 @@ struct IFairScheduler; template <class TTask> using IFairSchedulerPtr = TIntrusivePtr<IFairScheduler<TTask>>; -DECLARE_REFCOUNTED_CLASS(TAdaptiveHedgingManagerConfig) +DECLARE_REFCOUNTED_STRUCT(TAdaptiveHedgingManagerConfig) DECLARE_REFCOUNTED_STRUCT(IHedgingManager) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/net/config.h b/yt/yt/core/net/config.h index 97e4f3d798..eb65aee470 100644 --- a/yt/yt/core/net/config.h +++ b/yt/yt/core/net/config.h @@ -12,10 +12,9 @@ namespace NYT::NNet { //////////////////////////////////////////////////////////////////////////////// -class TDialerConfig +struct TDialerConfig : public NYTree::TYsonStruct { -public: bool EnableNoDelay; bool EnableAggressiveReconnect; @@ -34,11 +33,10 @@ DEFINE_REFCOUNTED_TYPE(TDialerConfig) //////////////////////////////////////////////////////////////////////////////// //! Configuration for TAddressResolver singleton. -class TAddressResolverConfig +struct TAddressResolverConfig : public TAsyncExpiringCacheConfig , public NDns::TAresDnsResolverConfig { -public: bool EnableIPv4; bool EnableIPv6; diff --git a/yt/yt/core/net/public.h b/yt/yt/core/net/public.h index ea4891db83..725dc0c517 100644 --- a/yt/yt/core/net/public.h +++ b/yt/yt/core/net/public.h @@ -28,8 +28,8 @@ DECLARE_REFCOUNTED_STRUCT(IDialer) DECLARE_REFCOUNTED_STRUCT(IAsyncDialer) DECLARE_REFCOUNTED_STRUCT(IAsyncDialerSession) -DECLARE_REFCOUNTED_CLASS(TDialerConfig) -DECLARE_REFCOUNTED_CLASS(TAddressResolverConfig) +DECLARE_REFCOUNTED_STRUCT(TDialerConfig) +DECLARE_REFCOUNTED_STRUCT(TAddressResolverConfig) YT_DEFINE_ERROR_ENUM( ((Aborted) (1500)) diff --git a/yt/yt/core/rpc/config.h b/yt/yt/core/rpc/config.h index 2884565631..c0102a03ed 100644 --- a/yt/yt/core/rpc/config.h +++ b/yt/yt/core/rpc/config.h @@ -42,10 +42,9 @@ DEFINE_REFCOUNTED_TYPE(THistogramExponentialBounds) //////////////////////////////////////////////////////////////////////////////// -class TTimeHistogramConfig +struct TTimeHistogramConfig : public NYTree::TYsonStruct { -public: std::optional<THistogramExponentialBoundsPtr> ExponentialBounds; std::optional<std::vector<TDuration>> CustomBounds; @@ -59,10 +58,9 @@ DEFINE_REFCOUNTED_TYPE(TTimeHistogramConfig) //////////////////////////////////////////////////////////////////////////////// // Common options shared between all services in one server. -class TServiceCommonConfig +struct TServiceCommonConfig : public NYTree::TYsonStruct { -public: bool EnablePerUserProfiling; TTimeHistogramConfigPtr TimeHistogram; bool EnableErrorCodeCounter; @@ -77,10 +75,9 @@ DEFINE_REFCOUNTED_TYPE(TServiceCommonConfig) //////////////////////////////////////////////////////////////////////////////// -class TServerConfig +struct TServerConfig : public TServiceCommonConfig { -public: THashMap<std::string, NYTree::INodePtr> Services; REGISTER_YSON_STRUCT(TServerConfig); @@ -93,10 +90,9 @@ DEFINE_REFCOUNTED_TYPE(TServerConfig) //////////////////////////////////////////////////////////////////////////////// // Common options shared between all services in one server. -class TServiceCommonDynamicConfig +struct TServiceCommonDynamicConfig : public NYTree::TYsonStruct { -public: std::optional<bool> EnablePerUserProfiling; std::optional<TTimeHistogramConfigPtr> TimeHistogram; std::optional<bool> EnableErrorCodeCounter; @@ -111,10 +107,9 @@ DEFINE_REFCOUNTED_TYPE(TServiceCommonDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TServerDynamicConfig +struct TServerDynamicConfig : public TServiceCommonDynamicConfig { -public: THashMap<std::string, NYTree::INodePtr> Services; REGISTER_YSON_STRUCT(TServerDynamicConfig); @@ -126,10 +121,9 @@ DEFINE_REFCOUNTED_TYPE(TServerDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TServiceConfig +struct TServiceConfig : public NYTree::TYsonStruct { -public: std::optional<bool> EnablePerUserProfiling; std::optional<bool> EnableErrorCodeCounter; std::optional<ERequestTracingMode> TracingMode; @@ -148,10 +142,9 @@ DEFINE_REFCOUNTED_TYPE(TServiceConfig) //////////////////////////////////////////////////////////////////////////////// -class TMethodConfig +struct TMethodConfig : public NYTree::TYsonStruct { -public: std::optional<bool> Heavy; std::optional<int> QueueSizeLimit; std::optional<i64> QueueByteSizeLimit; @@ -174,10 +167,9 @@ DEFINE_REFCOUNTED_TYPE(TMethodConfig) //////////////////////////////////////////////////////////////////////////////// -class TRetryingChannelConfig +struct TRetryingChannelConfig : public virtual NYTree::TYsonStruct { -public: //! Time to wait between consequent attempts. TDuration RetryBackoffTime; @@ -208,10 +200,9 @@ DEFINE_ENUM(EPeerPriorityStrategy, (PreferLocal) ); -class TViablePeerRegistryConfig +struct TViablePeerRegistryConfig : public virtual NYTree::TYsonStruct { -public: //! Timeout for |Discover| requests. TDuration DiscoverTimeout; @@ -273,10 +264,9 @@ DEFINE_REFCOUNTED_TYPE(TViablePeerRegistryConfig) //////////////////////////////////////////////////////////////////////////////// -class TDynamicChannelPoolConfig +struct TDynamicChannelPoolConfig : public TViablePeerRegistryConfig { -public: //! Maximum number of peers to query in parallel when locating alive ones. int MaxConcurrentDiscoverRequests; @@ -300,10 +290,9 @@ DEFINE_REFCOUNTED_TYPE(TDynamicChannelPoolConfig) //////////////////////////////////////////////////////////////////////////////// -class TServiceDiscoveryEndpointsConfig +struct TServiceDiscoveryEndpointsConfig : public NYTree::TYsonStruct { -public: std::optional<std::string> Cluster; //! NB: If empty (default) this vector is filled with the cluster above. std::vector<std::string> Clusters; @@ -348,10 +337,9 @@ DEFINE_REFCOUNTED_TYPE(TBalancingChannelConfigBase) //////////////////////////////////////////////////////////////////////////////// -class TBalancingChannelConfig +struct TBalancingChannelConfig : public TBalancingChannelConfigBase { -public: //! First option: static list of addresses. std::optional<std::vector<std::string>> Addresses; @@ -367,10 +355,9 @@ DEFINE_REFCOUNTED_TYPE(TBalancingChannelConfig) //////////////////////////////////////////////////////////////////////////////// -class TThrottlingChannelConfig +struct TThrottlingChannelConfig : public virtual NYTree::TYsonStruct { -public: //! Maximum allowed number of requests per second. int RateLimit; @@ -383,10 +370,9 @@ DEFINE_REFCOUNTED_TYPE(TThrottlingChannelConfig) //////////////////////////////////////////////////////////////////////////////// -class TThrottlingChannelDynamicConfig +struct TThrottlingChannelDynamicConfig : public virtual NYTree::TYsonStruct { -public: std::optional<int> RateLimit; REGISTER_YSON_STRUCT(TThrottlingChannelDynamicConfig); @@ -398,10 +384,9 @@ DEFINE_REFCOUNTED_TYPE(TThrottlingChannelDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TResponseKeeperConfig +struct TResponseKeeperConfig : public NYTree::TYsonStruct { -public: //! For how long responses are kept in memory. TDuration ExpirationTime; @@ -432,10 +417,9 @@ DEFINE_REFCOUNTED_TYPE(TResponseKeeperConfig) //////////////////////////////////////////////////////////////////////////////// -class TDispatcherConfig +struct TDispatcherConfig : public NYTree::TYsonStruct { -public: int HeavyPoolSize; int CompressionPoolSize; TDuration HeavyPoolPollingPeriod; @@ -455,10 +439,9 @@ DEFINE_REFCOUNTED_TYPE(TDispatcherConfig) //////////////////////////////////////////////////////////////////////////////// -class TDispatcherDynamicConfig +struct TDispatcherDynamicConfig : public NYTree::TYsonStruct { -public: std::optional<int> HeavyPoolSize; std::optional<int> CompressionPoolSize; std::optional<TDuration> HeavyPoolPollingPeriod; diff --git a/yt/yt/core/rpc/grpc/config.h b/yt/yt/core/rpc/grpc/config.h index 3b8f461c44..4dac0f3bd2 100644 --- a/yt/yt/core/rpc/grpc/config.h +++ b/yt/yt/core/rpc/grpc/config.h @@ -12,10 +12,9 @@ namespace NYT::NRpc::NGrpc { //////////////////////////////////////////////////////////////////////////////// -class TDispatcherConfig +struct TDispatcherConfig : public NYTree::TYsonStruct { -public: int DispatcherThreadCount; int GrpcThreadCount; int GrpcEventEngineThreadCount; @@ -29,10 +28,9 @@ DEFINE_REFCOUNTED_TYPE(TDispatcherConfig) //////////////////////////////////////////////////////////////////////////////// -class TSslPemKeyCertPairConfig +struct TSslPemKeyCertPairConfig : public NYTree::TYsonStruct { -public: NCrypto::TPemBlobConfigPtr PrivateKey; NCrypto::TPemBlobConfigPtr CertChain; @@ -55,10 +53,9 @@ DEFINE_ENUM(EClientCertificateRequest, //////////////////////////////////////////////////////////////////////////////// -class TServerCredentialsConfig +struct TServerCredentialsConfig : public NYTree::TYsonStruct { -public: NCrypto::TPemBlobConfigPtr PemRootCerts; std::vector<TSslPemKeyCertPairConfigPtr> PemKeyCertPairs; EClientCertificateRequest ClientCertificateRequest; @@ -72,10 +69,9 @@ DEFINE_REFCOUNTED_TYPE(TServerCredentialsConfig) //////////////////////////////////////////////////////////////////////////////// -class TServerAddressConfig +struct TServerAddressConfig : public NYTree::TYsonStruct { -public: std::string Address; TServerCredentialsConfigPtr Credentials; @@ -88,10 +84,9 @@ DEFINE_REFCOUNTED_TYPE(TServerAddressConfig) //////////////////////////////////////////////////////////////////////////////// -class TServerConfig +struct TServerConfig : public NYTree::TYsonStruct { -public: std::string ProfilingName; std::vector<TServerAddressConfigPtr> Addresses; @@ -106,10 +101,9 @@ DEFINE_REFCOUNTED_TYPE(TServerConfig) //////////////////////////////////////////////////////////////////////////////// -class TChannelCredentialsConfig +struct TChannelCredentialsConfig : public NYTree::TYsonStruct { -public: NCrypto::TPemBlobConfigPtr PemRootCerts; TSslPemKeyCertPairConfigPtr PemKeyCertPair; bool VerifyServerCert; @@ -139,10 +133,9 @@ DEFINE_REFCOUNTED_TYPE(TChannelConfigTemplate) //////////////////////////////////////////////////////////////////////////////// -class TChannelConfig +struct TChannelConfig : public TChannelConfigTemplate { -public: std::string Address; REGISTER_YSON_STRUCT(TChannelConfig); diff --git a/yt/yt/core/rpc/grpc/public.h b/yt/yt/core/rpc/grpc/public.h index 737faf3f4c..e46f5e3516 100644 --- a/yt/yt/core/rpc/grpc/public.h +++ b/yt/yt/core/rpc/grpc/public.h @@ -8,14 +8,14 @@ namespace NYT::NRpc::NGrpc { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TDispatcherConfig) -DECLARE_REFCOUNTED_CLASS(TSslPemKeyCertPairConfig) -DECLARE_REFCOUNTED_CLASS(TServerCredentialsConfig) -DECLARE_REFCOUNTED_CLASS(TServerAddressConfig) -DECLARE_REFCOUNTED_CLASS(TServerConfig) -DECLARE_REFCOUNTED_CLASS(TChannelCredentialsConfig) +DECLARE_REFCOUNTED_STRUCT(TDispatcherConfig) +DECLARE_REFCOUNTED_STRUCT(TSslPemKeyCertPairConfig) +DECLARE_REFCOUNTED_STRUCT(TServerCredentialsConfig) +DECLARE_REFCOUNTED_STRUCT(TServerAddressConfig) +DECLARE_REFCOUNTED_STRUCT(TServerConfig) +DECLARE_REFCOUNTED_STRUCT(TChannelCredentialsConfig) DECLARE_REFCOUNTED_CLASS(TChannelConfigTemplate) -DECLARE_REFCOUNTED_CLASS(TChannelConfig) +DECLARE_REFCOUNTED_STRUCT(TChannelConfig) DECLARE_REFCOUNTED_STRUCT(IGrpcChannel) diff --git a/yt/yt/core/rpc/http/config.h b/yt/yt/core/rpc/http/config.h index d9c184b0de..d5ff9009be 100644 --- a/yt/yt/core/rpc/http/config.h +++ b/yt/yt/core/rpc/http/config.h @@ -8,7 +8,7 @@ namespace NYT::NRpc::NHttp { //////////////////////////////////////////////////////////////////////////////// -class TServerConfig +struct TServerConfig : public NYT::NHttp::TServerConfig { }; diff --git a/yt/yt/core/rpc/http/public.h b/yt/yt/core/rpc/http/public.h index e6465d03a0..a4296a6863 100644 --- a/yt/yt/core/rpc/http/public.h +++ b/yt/yt/core/rpc/http/public.h @@ -6,7 +6,7 @@ namespace NYT::NRpc::NHttp { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TServerConfig) +DECLARE_REFCOUNTED_STRUCT(TServerConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/rpc/public.h b/yt/yt/core/rpc/public.h index 2ec1020b86..76742ffba4 100644 --- a/yt/yt/core/rpc/public.h +++ b/yt/yt/core/rpc/public.h @@ -109,24 +109,24 @@ using TTypedServiceContext = TGenericTypedServiceContext< //////////////////////////////////////////////////////////////////////////////// DECLARE_REFCOUNTED_CLASS(THistogramExponentialBounds) -DECLARE_REFCOUNTED_CLASS(TTimeHistogramConfig) -DECLARE_REFCOUNTED_CLASS(TServerConfig) -DECLARE_REFCOUNTED_CLASS(TServiceCommonConfig) -DECLARE_REFCOUNTED_CLASS(TServerDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TServiceCommonDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TServiceConfig) -DECLARE_REFCOUNTED_CLASS(TMethodConfig) -DECLARE_REFCOUNTED_CLASS(TRetryingChannelConfig) -DECLARE_REFCOUNTED_CLASS(TViablePeerRegistryConfig) -DECLARE_REFCOUNTED_CLASS(TDynamicChannelPoolConfig) -DECLARE_REFCOUNTED_CLASS(TServiceDiscoveryEndpointsConfig) +DECLARE_REFCOUNTED_STRUCT(TTimeHistogramConfig) +DECLARE_REFCOUNTED_STRUCT(TServerConfig) +DECLARE_REFCOUNTED_STRUCT(TServiceCommonConfig) +DECLARE_REFCOUNTED_STRUCT(TServerDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TServiceCommonDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TServiceConfig) +DECLARE_REFCOUNTED_STRUCT(TMethodConfig) +DECLARE_REFCOUNTED_STRUCT(TRetryingChannelConfig) +DECLARE_REFCOUNTED_STRUCT(TViablePeerRegistryConfig) +DECLARE_REFCOUNTED_STRUCT(TDynamicChannelPoolConfig) +DECLARE_REFCOUNTED_STRUCT(TServiceDiscoveryEndpointsConfig) DECLARE_REFCOUNTED_CLASS(TBalancingChannelConfigBase) -DECLARE_REFCOUNTED_CLASS(TBalancingChannelConfig) -DECLARE_REFCOUNTED_CLASS(TThrottlingChannelConfig) -DECLARE_REFCOUNTED_CLASS(TThrottlingChannelDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TResponseKeeperConfig) -DECLARE_REFCOUNTED_CLASS(TDispatcherConfig) -DECLARE_REFCOUNTED_CLASS(TDispatcherDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TBalancingChannelConfig) +DECLARE_REFCOUNTED_STRUCT(TThrottlingChannelConfig) +DECLARE_REFCOUNTED_STRUCT(TThrottlingChannelDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TResponseKeeperConfig) +DECLARE_REFCOUNTED_STRUCT(TDispatcherConfig) +DECLARE_REFCOUNTED_STRUCT(TDispatcherDynamicConfig) struct TRequestQueueThrottlerConfigs { diff --git a/yt/yt/core/service_discovery/yp/config.h b/yt/yt/core/service_discovery/yp/config.h index dc820cb21e..f87a62b7d5 100644 --- a/yt/yt/core/service_discovery/yp/config.h +++ b/yt/yt/core/service_discovery/yp/config.h @@ -10,11 +10,10 @@ namespace NYT::NServiceDiscovery::NYP { //////////////////////////////////////////////////////////////////////////////// -class TServiceDiscoveryConfig +struct TServiceDiscoveryConfig : public NRpc::TRetryingChannelConfig , public TAsyncExpiringCacheConfig { -public: bool Enable; //! Provider endpoint. diff --git a/yt/yt/core/service_discovery/yp/public.h b/yt/yt/core/service_discovery/yp/public.h index c90b9dc5a7..2c0293620a 100644 --- a/yt/yt/core/service_discovery/yp/public.h +++ b/yt/yt/core/service_discovery/yp/public.h @@ -7,7 +7,7 @@ namespace NYT::NServiceDiscovery::NYP { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TServiceDiscoveryConfig) +DECLARE_REFCOUNTED_STRUCT(TServiceDiscoveryConfig) YT_DECLARE_CONFIGURABLE_SINGLETON(TServiceDiscoveryConfig); diff --git a/yt/yt/core/yson/config.h b/yt/yt/core/yson/config.h index 7238e47605..653ade88e9 100644 --- a/yt/yt/core/yson/config.h +++ b/yt/yt/core/yson/config.h @@ -13,10 +13,9 @@ namespace NYT::NYson { //////////////////////////////////////////////////////////////////////////////// // TODO(kmokrov): Drop Utf8Check after YTORM-843 -class TProtobufInteropConfig +struct TProtobufInteropConfig : public NYTree::TYsonStruct { -public: // Default enum storage type for protobuf to yson conversion. EEnumYsonStorageType DefaultEnumYsonStorageType; // Check if string field contains actual UTF-8 string. @@ -37,10 +36,9 @@ DEFINE_REFCOUNTED_TYPE(TProtobufInteropConfig) //////////////////////////////////////////////////////////////////////////////// // TODO(kmokrov): Drop Utf8Check after YTORM-843 -class TProtobufInteropDynamicConfig +struct TProtobufInteropDynamicConfig : public NYTree::TYsonStruct { -public: // Check if string field contains actual UTF-8 string. std::optional<EUtf8Check> Utf8Check; diff --git a/yt/yt/core/yson/public.h b/yt/yt/core/yson/public.h index 1e757e1874..779450a344 100644 --- a/yt/yt/core/yson/public.h +++ b/yt/yt/core/yson/public.h @@ -83,8 +83,8 @@ DEFINE_ENUM(EEnumYsonStorageType, //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TProtobufInteropConfig); -DECLARE_REFCOUNTED_CLASS(TProtobufInteropDynamicConfig); +DECLARE_REFCOUNTED_STRUCT(TProtobufInteropConfig); +DECLARE_REFCOUNTED_STRUCT(TProtobufInteropDynamicConfig); //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/ytalloc/config.h b/yt/yt/core/ytalloc/config.h index fca956e0e6..ff546c85b7 100644 --- a/yt/yt/core/ytalloc/config.h +++ b/yt/yt/core/ytalloc/config.h @@ -8,10 +8,9 @@ namespace NYT::NYTAlloc { //////////////////////////////////////////////////////////////////////////////// -class TYTAllocConfig +struct TYTAllocConfig : public NYTree::TYsonStruct { -public: std::optional<bool> EnableAllocationProfiling; std::optional<double> AllocationProfilingSamplingRate; std::optional<std::vector<int>> SmallArenasToProfile; @@ -34,10 +33,9 @@ public: DEFINE_REFCOUNTED_TYPE(TYTAllocConfig) -class TYTProfilingConfig +struct TYTProfilingConfig : public NYTree::TYsonStruct { -public: std::optional<bool> EnableDetailedAllocationStatistics; REGISTER_YSON_STRUCT(TYTProfilingConfig); diff --git a/yt/yt/core/ytalloc/public.h b/yt/yt/core/ytalloc/public.h index 61444eff7f..d633088b11 100644 --- a/yt/yt/core/ytalloc/public.h +++ b/yt/yt/core/ytalloc/public.h @@ -6,8 +6,8 @@ namespace NYT::NYTAlloc { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TYTAllocConfig) -DECLARE_REFCOUNTED_CLASS(TYTProfilingConfig) +DECLARE_REFCOUNTED_STRUCT(TYTAllocConfig) +DECLARE_REFCOUNTED_STRUCT(TYTProfilingConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/ytree/unittests/yson_struct_ut.cpp b/yt/yt/core/ytree/unittests/yson_struct_ut.cpp index 7621c07eaf..f38c233f44 100644 --- a/yt/yt/core/ytree/unittests/yson_struct_ut.cpp +++ b/yt/yt/core/ytree/unittests/yson_struct_ut.cpp @@ -66,10 +66,9 @@ using TTestSubconfigPtr = TIntrusivePtr<TTestSubconfig>; //////////////////////////////////////////////////////////////////////////////// -class TTestConfig +struct TTestConfig : public TYsonStruct { -public: TString MyString; TTestSubconfigPtr Subconfig; std::vector<TTestSubconfigPtr> SubconfigList; @@ -1896,10 +1895,9 @@ TEST(TYsonStructTest, UniversalParameterAccessor) //////////////////////////////////////////////////////////////////////////////// -class TVirtualInheritanceConfig +struct TVirtualInheritanceConfig : public virtual TYsonStruct { -public: int Value; REGISTER_YSON_STRUCT(TVirtualInheritanceConfig); @@ -1965,10 +1963,9 @@ TEST(TYsonStructTest, RegisterBaseFieldInDerived) //////////////////////////////////////////////////////////////////////////////// -class TClassLevelPostprocessConfig +struct TClassLevelPostprocessConfig : public TYsonStruct { -public: int Value; REGISTER_YSON_STRUCT(TClassLevelPostprocessConfig); @@ -2003,10 +2000,9 @@ TEST(TYsonStructTest, ClassLevelPostprocess) //////////////////////////////////////////////////////////////////////////////// -class TRecursiveConfig +struct TRecursiveConfig : public TYsonStruct { -public: TIntrusivePtr<TRecursiveConfig> Subconfig; int Value; diff --git a/yt/yt/library/quantile_digest/config.h b/yt/yt/library/quantile_digest/config.h index 27193cd427..f63e3d680d 100644 --- a/yt/yt/library/quantile_digest/config.h +++ b/yt/yt/library/quantile_digest/config.h @@ -8,10 +8,9 @@ namespace NYT { //////////////////////////////////////////////////////////////////////////////// -class TTDigestConfig +struct TTDigestConfig : public NYTree::TYsonStruct { -public: double Delta; double CompressionFrequency; diff --git a/yt/yt/library/quantile_digest/public.h b/yt/yt/library/quantile_digest/public.h index 228fe17f42..6592518cd8 100644 --- a/yt/yt/library/quantile_digest/public.h +++ b/yt/yt/library/quantile_digest/public.h @@ -9,7 +9,7 @@ namespace NYT { DECLARE_REFCOUNTED_STRUCT(IQuantileDigest) -DECLARE_REFCOUNTED_CLASS(TTDigestConfig) +DECLARE_REFCOUNTED_STRUCT(TTDigestConfig) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/library/tracing/jaeger/public.h b/yt/yt/library/tracing/jaeger/public.h index 9eeaead1d9..873ec9702d 100644 --- a/yt/yt/library/tracing/jaeger/public.h +++ b/yt/yt/library/tracing/jaeger/public.h @@ -9,10 +9,10 @@ namespace NYT::NTracing { //////////////////////////////////////////////////////////////////////////////// DECLARE_REFCOUNTED_CLASS(TSampler) -DECLARE_REFCOUNTED_CLASS(TSamplerConfig) +DECLARE_REFCOUNTED_STRUCT(TSamplerConfig) -DECLARE_REFCOUNTED_CLASS(TJaegerTracerDynamicConfig) -DECLARE_REFCOUNTED_CLASS(TJaegerTracerConfig) +DECLARE_REFCOUNTED_STRUCT(TJaegerTracerDynamicConfig) +DECLARE_REFCOUNTED_STRUCT(TJaegerTracerConfig) YT_DECLARE_RECONFIGURABLE_SINGLETON(TJaegerTracerConfig, TJaegerTracerDynamicConfig); diff --git a/yt/yt/library/tracing/jaeger/sampler.h b/yt/yt/library/tracing/jaeger/sampler.h index f6ed7359b5..03ada6bf9f 100644 --- a/yt/yt/library/tracing/jaeger/sampler.h +++ b/yt/yt/library/tracing/jaeger/sampler.h @@ -12,10 +12,9 @@ namespace NYT::NTracing { //////////////////////////////////////////////////////////////////////////////// -class TSamplerConfig +struct TSamplerConfig : public NYTree::TYsonStruct { -public: //! Request is sampled with probability P. double GlobalSampleRate; diff --git a/yt/yt/library/tracing/jaeger/tracer.h b/yt/yt/library/tracing/jaeger/tracer.h index 13e91ab005..26f00434dc 100644 --- a/yt/yt/library/tracing/jaeger/tracer.h +++ b/yt/yt/library/tracing/jaeger/tracer.h @@ -24,10 +24,9 @@ namespace NYT::NTracing { //////////////////////////////////////////////////////////////////////////////// -class TJaegerTracerDynamicConfig +struct TJaegerTracerDynamicConfig : public NYTree::TYsonStruct { -public: NRpc::NGrpc::TChannelConfigPtr CollectorChannel; std::optional<i64> MaxRequestSize; @@ -47,10 +46,9 @@ DEFINE_REFCOUNTED_TYPE(TJaegerTracerDynamicConfig) //////////////////////////////////////////////////////////////////////////////// -class TJaegerTracerConfig +struct TJaegerTracerConfig : public NYTree::TYsonStruct { -public: NRpc::NGrpc::TChannelConfigPtr CollectorChannelConfig; TDuration FlushPeriod; diff --git a/yt/yt/library/tvm/service/config.h b/yt/yt/library/tvm/service/config.h index 6a27a2b7eb..e9fededf27 100644 --- a/yt/yt/library/tvm/service/config.h +++ b/yt/yt/library/tvm/service/config.h @@ -8,10 +8,9 @@ namespace NYT::NAuth { //////////////////////////////////////////////////////////////////////////////// -class TTvmServiceConfig +struct TTvmServiceConfig : public virtual NYTree::TYsonStruct { -public: bool UseTvmTool; // TvmClient settings diff --git a/yt/yt/library/tvm/service/public.h b/yt/yt/library/tvm/service/public.h index 89b3c4e60d..03d5ead6fb 100644 --- a/yt/yt/library/tvm/service/public.h +++ b/yt/yt/library/tvm/service/public.h @@ -9,7 +9,7 @@ namespace NYT::NAuth { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_CLASS(TTvmServiceConfig) +DECLARE_REFCOUNTED_STRUCT(TTvmServiceConfig) DECLARE_REFCOUNTED_STRUCT(ITvmService) DECLARE_REFCOUNTED_STRUCT(IDynamicTvmService) |