From 5e1be3e9c1146c0c02fdd94bcab5ffdb3e6ea27d Mon Sep 17 00:00:00 2001 From: MASES Public Developers Team <94312179+masesdevelopers@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:20:06 +0200 Subject: [PATCH] Updated documentation (#83) * First cleanup with copyright update * Other docs fix * Used interface instead of class --- LICENSE | 2 +- src/documentation/articles/kafkadbcontext.md | 20 +- ...fkaCSharpRuntimeAnnotationCodeGenerator.cs | 8 +- .../Internal/KafkaDesignTimeServices.cs | 9 +- .../Internal/KafkaLoggerExtensions.cs | 9 +- .../Internal/KafkaLoggingDefinitions.cs | 9 +- src/net/KEFCore/Diagnostics/KafkaEventId.cs | 2 +- .../KafkaDatabaseFacadeExtensions.cs | 2 +- .../KafkaDbContextOptionsExtensions.cs | 38 +- .../KafkaEntityTypeBuilderExtensions.cs | 2 +- .../Extensions/KafkaEntityTypeExtensions.cs | 2 +- .../KafkaServiceCollectionExtensions.cs | 2 +- ...kaDbContextOptionsBuilderInfrastructure.cs | 2 +- .../Internal/IKafkaSingletonOptions.cs | 9 +- .../Internal/KafkaModelValidator.cs | 9 +- .../Internal/KafkaOptionsExtension.cs | 9 +- .../Internal/KafkaSingletonOptions.cs | 11 +- .../KEFCore/Infrastructure/KafkaDbContext.cs | 57 ++- .../KafkaDbContextOptionsBuilder.cs | 24 +- src/net/KEFCore/KEFCore.cs | 2 +- .../DefiningQueryRewritingConvention.cs | 2 +- .../Conventions/KafkaConventionSetBuilder.cs | 4 +- .../Properties/KafkaStrings.Designer.cs | 4 - .../KEFCore/Query/Internal/AnonymousObject.cs | 11 +- .../CollectionResultShaperExpression.cs | 9 +- .../Internal/EntityProjectionExpression.cs | 9 +- ...aExpressionTranslatingExpressionVisitor.cs | 9 +- ...KafkaProjectionBindingExpressionVisitor.cs | 9 +- .../Query/Internal/KafkaQueryContext.cs | 10 +- .../Internal/KafkaQueryContextFactory.cs | 9 +- .../Internal/KafkaQueryExpression.Helper.cs | 9 +- .../Query/Internal/KafkaQueryExpression.cs | 9 +- ...yableMethodTranslatingExpressionVisitor.cs | 9 +- ...thodTranslatingExpressionVisitorFactory.cs | 9 +- ...ingExpressionVisitor.QueryingEnumerable.cs | 9 +- ...erExpressionProcessingExpressionVisitor.cs | 9 +- ...kaShapedQueryCompilingExpressionVisitor.cs | 9 +- ...afkaShapedQueryExpressionVisitorFactory.cs | 9 +- .../Query/Internal/KafkaTableExpression.cs | 9 +- .../Internal/SingleResultShaperExpression.cs | 9 +- .../Storage/Internal/EntityTypeProducer.cs | 13 +- .../Storage/Internal/IEntityTypeProducer.cs | 9 +- .../KEFCore/Storage/Internal/IKafkaCluster.cs | 9 +- .../Storage/Internal/IKafkaClusterCache.cs | 9 +- .../Storage/Internal/IKafkaDatabase.cs | 9 +- .../KEFCore/Storage/Internal/IKafkaRowBag.cs | 9 +- .../KEFCore/Storage/Internal/IKafkaTable.cs | 11 +- .../Storage/Internal/IKafkaTableFactory.cs | 9 +- .../KEFCore/Storage/Internal/KafkaCluster.cs | 9 +- .../Storage/Internal/KafkaClusterCache.cs | 9 +- .../Internal/KafkaClusterCacheExtensions.cs | 9 +- .../KEFCore/Storage/Internal/KafkaDatabase.cs | 9 +- .../Storage/Internal/KafkaDatabaseCreator.cs | 9 +- .../KEFCore/Storage/Internal/KafkaRowBag.cs | 9 +- .../Internal/KafkaStreamsBaseRetriever.cs | 348 +++++++++--------- .../KEFCore/Storage/Internal/KafkaTable.cs | 9 +- .../Storage/Internal/KafkaTableFactory.cs | 9 +- .../Storage/Internal/KafkaTableSnapshot.cs | 9 +- .../Storage/Internal/KafkaTransaction.cs | 9 +- .../Internal/KafkaTransactionManager.cs | 9 +- .../Storage/Internal/KafkaTypeMapping.cs | 9 +- .../Internal/KafkaTypeMappingSource.cs | 9 +- .../Internal/IKafkaIntegerValueGenerator.cs | 12 +- .../Internal/KafkaIntegerValueGenerator.cs | 12 +- .../Internal/KafkaValueGeneratorSelector.cs | 12 +- 65 files changed, 629 insertions(+), 344 deletions(-) diff --git a/LICENSE b/LICENSE index 28f1ee49..ba7090fb 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 MASES s.r.l. + Copyright 2023 MASES s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/documentation/articles/kafkadbcontext.md b/src/documentation/articles/kafkadbcontext.md index 01e084a1..d785d8e6 100644 --- a/src/documentation/articles/kafkadbcontext.md +++ b/src/documentation/articles/kafkadbcontext.md @@ -1,16 +1,26 @@ # KEFCore: KafkaDbContext -`KafkaDbContext` is a special class to define the `DbContext` to use with EntityFrameworkCore: -- it inherits from `DbContext`: to define the model, and/or creating the database, see [getting started](https://docs.microsoft.com/ef/core/get-started/) in the docs -- it defines the following properties: +`KafkaDbContext` is a special class which helps to define the `DbContext` and use Entity Framework Core with Apache Kafka: +- `KafkaDbContext` inherits from `DbContext`: to define the model, and/or creating the database, see [getting started](https://docs.microsoft.com/ef/core/get-started/) in the docs and [KEFCore usage](usage.md) +- `KafkaDbContext` defines the following properties: - **BootstrapServers**: the server hosting the broker of Apache Kafka - **ApplicationId**: the application identifier used to identify the context - **DbName**: the user defined name which declares the database name, it is used to prepend every Topic which belongs to this database - **DefaultNumPartitions**: the default number of partitions used when topics are created for each entity - **DefaultReplicationFactor**: the replication factor to use when data are stored in Apache Kafka + - **DefaultConsumerInstances**: the consumer instances to be allocated when UseCompactedReplicator is **true** - **UsePersistentStorage**: set to **true** to use a persintent storage between multiple application startup - - **UseProducerByEntity**: use a different producer for each enity of EntityFrameworkCore model + - **UseCompactedReplicator**: Use `KNetCompactedReplicator` instead of Apache Kafka Streams to manage data to or from topics - **ProducerConfigBuilder**: parameters to use for Producer - - **StreamsConfigBuilder**: parameters to use for Stream application + - **StreamsConfigBuilder**: parameters to use for Apche Kafka Streams application - **TopicConfigBuilder**: parameters to use on topic creation for each entity +## How to use `KafkaDbContext` class + +The most simple example of usage can be found in [KEFCore usage](usage.md). By default, `KafkaDbContext` automatically manages `OnConfiguring` method of `DbContext`: +- checks for mandatory opions like **BootstrapServers** and **DbName** +- setup the options to use an Apache Kafka cluster + + + + diff --git a/src/net/KEFCore/Design/Internal/KafkaCSharpRuntimeAnnotationCodeGenerator.cs b/src/net/KEFCore/Design/Internal/KafkaCSharpRuntimeAnnotationCodeGenerator.cs index 3c90d231..cfe7625a 100644 --- a/src/net/KEFCore/Design/Internal/KafkaCSharpRuntimeAnnotationCodeGenerator.cs +++ b/src/net/KEFCore/Design/Internal/KafkaCSharpRuntimeAnnotationCodeGenerator.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,12 @@ namespace MASES.EntityFrameworkCore.KNet.Design.Internal; #pragma warning disable EF1001 // Internal EF Core API usage. +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaCSharpRuntimeAnnotationCodeGenerator : CSharpRuntimeAnnotationCodeGenerator { public KafkaCSharpRuntimeAnnotationCodeGenerator( diff --git a/src/net/KEFCore/Design/Internal/KafkaDesignTimeServices.cs b/src/net/KEFCore/Design/Internal/KafkaDesignTimeServices.cs index 423d4128..a60384b1 100644 --- a/src/net/KEFCore/Design/Internal/KafkaDesignTimeServices.cs +++ b/src/net/KEFCore/Design/Internal/KafkaDesignTimeServices.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,12 @@ [assembly: DesignTimeProviderServices("MASES.EntityFrameworkCore.KNet.Design.Internal.KafkaDesignTimeServices")] namespace MASES.EntityFrameworkCore.KNet.Design.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaDesignTimeServices : IDesignTimeServices { public virtual void ConfigureDesignTimeServices(IServiceCollection serviceCollection) diff --git a/src/net/KEFCore/Diagnostics/Internal/KafkaLoggerExtensions.cs b/src/net/KEFCore/Diagnostics/Internal/KafkaLoggerExtensions.cs index 53013d0d..c27cbeb6 100644 --- a/src/net/KEFCore/Diagnostics/Internal/KafkaLoggerExtensions.cs +++ b/src/net/KEFCore/Diagnostics/Internal/KafkaLoggerExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,12 @@ using MASES.EntityFrameworkCore.KNet.Internal; namespace MASES.EntityFrameworkCore.KNet.Diagnostics.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public static class KafkaLoggerExtensions { public static void TransactionIgnoredWarning( diff --git a/src/net/KEFCore/Diagnostics/Internal/KafkaLoggingDefinitions.cs b/src/net/KEFCore/Diagnostics/Internal/KafkaLoggingDefinitions.cs index 16c67f2a..0062a21d 100644 --- a/src/net/KEFCore/Diagnostics/Internal/KafkaLoggingDefinitions.cs +++ b/src/net/KEFCore/Diagnostics/Internal/KafkaLoggingDefinitions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Diagnostics.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaLoggingDefinitions : LoggingDefinitions { public EventDefinitionBase? LogSavedChanges; diff --git a/src/net/KEFCore/Diagnostics/KafkaEventId.cs b/src/net/KEFCore/Diagnostics/KafkaEventId.cs index bea11eb9..09675ee4 100644 --- a/src/net/KEFCore/Diagnostics/KafkaEventId.cs +++ b/src/net/KEFCore/Diagnostics/KafkaEventId.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Extensions/KafkaDatabaseFacadeExtensions.cs b/src/net/KEFCore/Extensions/KafkaDatabaseFacadeExtensions.cs index 978003b5..1a2b08b1 100644 --- a/src/net/KEFCore/Extensions/KafkaDatabaseFacadeExtensions.cs +++ b/src/net/KEFCore/Extensions/KafkaDatabaseFacadeExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Extensions/KafkaDbContextOptionsExtensions.cs b/src/net/KEFCore/Extensions/KafkaDbContextOptionsExtensions.cs index bf142526..2eb08c28 100644 --- a/src/net/KEFCore/Extensions/KafkaDbContextOptionsExtensions.cs +++ b/src/net/KEFCore/Extensions/KafkaDbContextOptionsExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,63 +31,63 @@ namespace MASES.EntityFrameworkCore.KNet; public static class KafkaDbContextOptionsExtensions { /// - /// Configures the context to connect to an Kafka database. - /// The Kafka database is shared anywhere the same name is used, but only for a given + /// Configures the context to connect to an Apache Kafka cluster. + /// The Apache Kafka cluster is shared anywhere the same name is used, but only for a given /// service provider. /// /// /// See Using DbContextOptions, and - /// The EF Core Kafka database provider for more information and examples. + /// The EF Core Apache Kafka cluster provider for more information and examples. /// /// The type of context being configured. /// The builder being used to configure the context. /// - /// The name of the application will use . This allows the scope of the Kafka database to be controlled - /// independently of the context. The Kafka database is shared anywhere the same name is used. + /// The name of the application will use . This allows the scope of the Apache Kafka cluster to be controlled + /// independently of the context. The Apache Kafka cluster is shared anywhere the same name is used. /// /// - /// The name of the Kafka database. This allows the scope of the Kafka database to be controlled - /// independently of the context. The Kafka database is shared anywhere the same name is used. + /// The name of the Apache Kafka cluster. This allows the scope of the Apache Kafka cluster to be controlled + /// independently of the context. The Apache Kafka cluster is shared anywhere the same name is used. /// /// /// The bootstrap servers of the Kafka cluster. /// - /// An optional action to allow additional Kafka specific configuration. + /// An optional action to allow additional Apache Kafka cluster specific configuration. /// The options builder so that further configuration can be chained. - public static DbContextOptionsBuilder UseKafkaDatabase( + public static DbContextOptionsBuilder UseKafkaCluster( this DbContextOptionsBuilder optionsBuilder, string applicationId, string databaseName, string bootstrapServers, Action? kafkaOptionsAction = null) where TContext : DbContext - => (DbContextOptionsBuilder)UseKafkaDatabase( + => (DbContextOptionsBuilder)UseKafkaCluster( (DbContextOptionsBuilder)optionsBuilder, applicationId, databaseName, bootstrapServers, kafkaOptionsAction); /// - /// Configures the context to connect to a named Kafka database. - /// The Kafka database is shared anywhere the same name is used, but only for a given + /// Configures the context to connect to a named Apache Kafka cluster. + /// The Apache Kafka cluster is shared anywhere the same name is used, but only for a given /// service provider. /// /// /// See Using DbContextOptions, and - /// The EF Core Kafka database provider for more information and examples. + /// The EF Core Apache Kafka cluster provider for more information and examples. /// /// The builder being used to configure the context. /// - /// The name of the application will use . This allows the scope of the Kafka database to be controlled - /// independently of the context. The Kafka database is shared anywhere the same name is used. + /// The name of the application will use . This allows the scope of the Apache Kafka cluster to be controlled + /// independently of the context. The Apache Kafka cluster is shared anywhere the same name is used. /// /// - /// The name of the Kafka database. This allows the scope of the Kafka database to be controlled - /// independently of the context. The Kafka database is shared anywhere the same name is used. + /// The name of the Apache Kafka cluster. This allows the scope of the Apache Kafka cluster to be controlled + /// independently of the context. The Apache Kafka cluster is shared anywhere the same name is used. /// /// /// The bootstrap servers of the Kafka cluster. /// /// An optional action to allow additional Kafka specific configuration. /// The options builder so that further configuration can be chained. - public static DbContextOptionsBuilder UseKafkaDatabase( + public static DbContextOptionsBuilder UseKafkaCluster( this DbContextOptionsBuilder optionsBuilder, string applicationId, string databaseName, diff --git a/src/net/KEFCore/Extensions/KafkaEntityTypeBuilderExtensions.cs b/src/net/KEFCore/Extensions/KafkaEntityTypeBuilderExtensions.cs index f9c66750..ba28565f 100644 --- a/src/net/KEFCore/Extensions/KafkaEntityTypeBuilderExtensions.cs +++ b/src/net/KEFCore/Extensions/KafkaEntityTypeBuilderExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Extensions/KafkaEntityTypeExtensions.cs b/src/net/KEFCore/Extensions/KafkaEntityTypeExtensions.cs index bb892bff..9a158759 100644 --- a/src/net/KEFCore/Extensions/KafkaEntityTypeExtensions.cs +++ b/src/net/KEFCore/Extensions/KafkaEntityTypeExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Extensions/KafkaServiceCollectionExtensions.cs b/src/net/KEFCore/Extensions/KafkaServiceCollectionExtensions.cs index 1de4991f..ef69994f 100644 --- a/src/net/KEFCore/Extensions/KafkaServiceCollectionExtensions.cs +++ b/src/net/KEFCore/Extensions/KafkaServiceCollectionExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Infrastructure/IKafkaDbContextOptionsBuilderInfrastructure.cs b/src/net/KEFCore/Infrastructure/IKafkaDbContextOptionsBuilderInfrastructure.cs index 982fdef4..e1052d33 100644 --- a/src/net/KEFCore/Infrastructure/IKafkaDbContextOptionsBuilderInfrastructure.cs +++ b/src/net/KEFCore/Infrastructure/IKafkaDbContextOptionsBuilderInfrastructure.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Infrastructure/Internal/IKafkaSingletonOptions.cs b/src/net/KEFCore/Infrastructure/Internal/IKafkaSingletonOptions.cs index d10ac5b8..19de56c9 100644 --- a/src/net/KEFCore/Infrastructure/Internal/IKafkaSingletonOptions.cs +++ b/src/net/KEFCore/Infrastructure/Internal/IKafkaSingletonOptions.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,12 @@ using MASES.KNet.Streams; namespace MASES.EntityFrameworkCore.KNet.Infrastructure.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaSingletonOptions : ISingletonOptions { bool UseNameMatching { get; } diff --git a/src/net/KEFCore/Infrastructure/Internal/KafkaModelValidator.cs b/src/net/KEFCore/Infrastructure/Internal/KafkaModelValidator.cs index 82bed95c..68648e8b 100644 --- a/src/net/KEFCore/Infrastructure/Internal/KafkaModelValidator.cs +++ b/src/net/KEFCore/Infrastructure/Internal/KafkaModelValidator.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Infrastructure.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaModelValidator : ModelValidator { public KafkaModelValidator(ModelValidatorDependencies dependencies) diff --git a/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs b/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs index 5d0d9e31..5fdbb9b2 100644 --- a/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs +++ b/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,12 @@ using System.Globalization; namespace MASES.EntityFrameworkCore.KNet.Infrastructure.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaOptionsExtension : IDbContextOptionsExtension { private bool _useNameMatching = true; diff --git a/src/net/KEFCore/Infrastructure/Internal/KafkaSingletonOptions.cs b/src/net/KEFCore/Infrastructure/Internal/KafkaSingletonOptions.cs index ffae2fd6..ec2ea120 100644 --- a/src/net/KEFCore/Infrastructure/Internal/KafkaSingletonOptions.cs +++ b/src/net/KEFCore/Infrastructure/Internal/KafkaSingletonOptions.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,12 @@ using MASES.KNet.Streams; namespace MASES.EntityFrameworkCore.KNet.Infrastructure.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaSingletonOptions : IKafkaSingletonOptions { public virtual void Initialize(IDbContextOptions options) @@ -55,7 +60,7 @@ public virtual void Validate(IDbContextOptions options) { throw new InvalidOperationException( CoreStrings.SingletonOptionChanged( - nameof(KafkaDbContextOptionsExtensions.UseKafkaDatabase), + nameof(KafkaDbContextOptionsExtensions.UseKafkaCluster), nameof(DbContextOptionsBuilder.UseInternalServiceProvider))); } } diff --git a/src/net/KEFCore/Infrastructure/KafkaDbContext.cs b/src/net/KEFCore/Infrastructure/KafkaDbContext.cs index 2924bfce..ef429045 100644 --- a/src/net/KEFCore/Infrastructure/KafkaDbContext.cs +++ b/src/net/KEFCore/Infrastructure/KafkaDbContext.cs @@ -1,8 +1,5 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +23,42 @@ namespace MASES.EntityFrameworkCore.KNet.Infrastructure; /// -/// Allows Kafka specific configuration to be performed on . +/// A instance represents a session with the Apache Kafka cluster and can be used to query and save +/// instances of your entities. extends and it is a combination of the Unit Of Work and Repository patterns. /// +/// +/// +/// Entity Framework Core does not support multiple parallel operations being run on the same instance. This +/// includes both parallel execution of async queries and any explicit concurrent use from multiple threads. +/// Therefore, always await async calls immediately, or use separate DbContext instances for operations that execute +/// in parallel. See Avoiding DbContext threading issues for more information +/// and examples. +/// +/// +/// Typically you create a class that derives from DbContext and contains +/// properties for each entity in the model. If the properties have a public setter, +/// they are automatically initialized when the instance of the derived context is created. +/// +/// +/// Typically you don't need to override the method to configure the database (and +/// other options) to be used for the context, just set the properties associated to class. +/// Alternatively, if you would rather perform configuration externally instead of inline in your context, you can use +/// (or ) to externally create an instance of +/// (or ) and pass it to a base constructor of . +/// +/// +/// The model is discovered by running a set of conventions over the entity classes found in the +/// properties on the derived context. To further configure the model that +/// is discovered by convention, you can override the method. +/// +/// +/// See KafkaDbContext configuration and initialization, +/// DbContext lifetime, configuration, and initialization, +/// Querying data with EF Core, +/// Changing tracking, and +/// Saving data with EF Core for more information and examples. +/// +/// public class KafkaDbContext : DbContext { #if DEBUG_PERFORMANCE @@ -98,19 +129,19 @@ public KafkaDbContext(DbContextOptions options) : base(options) /// public virtual string? DbName { get; set; } /// - /// Database number of partitions + /// Default number of partitions associated to each topic /// public virtual int DefaultNumPartitions { get; set; } = 10; /// - /// Database replication factor + /// Default replication factor associated to each topic /// public virtual short DefaultReplicationFactor { get; set; } = 1; /// - /// Database consumr instances used in conjunction with + /// Default consumr instances used in conjunction with /// public virtual int? DefaultConsumerInstances { get; set; } = null; /// - /// Use persistent storage + /// Use persistent storage when Apache Kafka Streams is in use /// public virtual bool UsePersistentStorage { get; set; } = false; ///// @@ -136,14 +167,10 @@ public KafkaDbContext(DbContextOptions options) : base(options) /// protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - if (BootstrapServers == null) - { - throw new ArgumentNullException(nameof(BootstrapServers)); - } - + if (BootstrapServers == null) throw new ArgumentNullException(nameof(BootstrapServers)); if (DbName == null) throw new ArgumentNullException(nameof(DbName)); - optionsBuilder.UseKafkaDatabase(ApplicationId, DbName, BootstrapServers, (o) => + optionsBuilder.UseKafkaCluster(ApplicationId, DbName, BootstrapServers, (o) => { o.StreamsConfig(StreamsConfigBuilder ?? o.EmptyStreamsConfigBuilder).WithDefaultNumPartitions(DefaultNumPartitions); o.WithUsePersistentStorage(UsePersistentStorage); diff --git a/src/net/KEFCore/Infrastructure/KafkaDbContextOptionsBuilder.cs b/src/net/KEFCore/Infrastructure/KafkaDbContextOptionsBuilder.cs index 0b43f008..78328061 100644 --- a/src/net/KEFCore/Infrastructure/KafkaDbContextOptionsBuilder.cs +++ b/src/net/KEFCore/Infrastructure/KafkaDbContextOptionsBuilder.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ namespace MASES.EntityFrameworkCore.KNet.Infrastructure; /// /// Instances of this class are returned from a call to /// +/// cref="KafkaDbContextOptionsExtensions.UseKafkaCluster(DbContextOptionsBuilder, string, string, string, Action{KafkaDbContextOptionsBuilder}?)" /> /// and it is not designed to be directly constructed in your application code. /// /// @@ -63,17 +63,25 @@ public KafkaDbContextOptionsBuilder(DbContextOptionsBuilder optionsBuilder) protected virtual DbContextOptionsBuilder OptionsBuilder { get; } /// - DbContextOptionsBuilder IKafkaDbContextOptionsBuilderInfrastructure.OptionsBuilder - => OptionsBuilder; - + DbContextOptionsBuilder IKafkaDbContextOptionsBuilderInfrastructure.OptionsBuilder => OptionsBuilder; + /// + /// The default configuration + /// + /// The default configuration. public ProducerConfigBuilder EmptyProducerConfigBuilder => ProducerConfigBuilder.Create(); - + /// + /// The default configuration + /// + /// The default configuration. public StreamsConfigBuilder EmptyStreamsConfigBuilder => StreamsConfigBuilder.Create(); - + /// + /// The default configuration + /// + /// The default configuration. public TopicConfigBuilder EmptyTopicConfigBuilder => TopicConfigBuilder.Create(); /// - /// Enables name matching on instead of matching + /// Enables name matching on instead of matching /// /// /// See Using DbContextOptions, and diff --git a/src/net/KEFCore/KEFCore.cs b/src/net/KEFCore/KEFCore.cs index f743e683..80b83f70 100644 --- a/src/net/KEFCore/KEFCore.cs +++ b/src/net/KEFCore/KEFCore.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Metadata/Conventions/DefiningQueryRewritingConvention.cs b/src/net/KEFCore/Metadata/Conventions/DefiningQueryRewritingConvention.cs index 1bcb4869..5fced9c1 100644 --- a/src/net/KEFCore/Metadata/Conventions/DefiningQueryRewritingConvention.cs +++ b/src/net/KEFCore/Metadata/Conventions/DefiningQueryRewritingConvention.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/net/KEFCore/Metadata/Conventions/KafkaConventionSetBuilder.cs b/src/net/KEFCore/Metadata/Conventions/KafkaConventionSetBuilder.cs index a124a17b..b123c267 100644 --- a/src/net/KEFCore/Metadata/Conventions/KafkaConventionSetBuilder.cs +++ b/src/net/KEFCore/Metadata/Conventions/KafkaConventionSetBuilder.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,7 +95,7 @@ private static IServiceScope CreateServiceScope() .AddEntityFrameworkKafkaDatabase() .AddDbContext( (p, o) => - o.UseKafkaDatabase(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString()) + o.UseKafkaCluster(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString()) .UseInternalServiceProvider(p)) .BuildServiceProvider(); diff --git a/src/net/KEFCore/Properties/KafkaStrings.Designer.cs b/src/net/KEFCore/Properties/KafkaStrings.Designer.cs index bb45ce69..2151b1d7 100644 --- a/src/net/KEFCore/Properties/KafkaStrings.Designer.cs +++ b/src/net/KEFCore/Properties/KafkaStrings.Designer.cs @@ -1,12 +1,8 @@ // -using System; -using System.Reflection; using System.Resources; -using System.Threading; using MASES.EntityFrameworkCore.KNet.Diagnostics; using Microsoft.EntityFrameworkCore.Internal; -using Microsoft.Extensions.Logging; #nullable enable diff --git a/src/net/KEFCore/Query/Internal/AnonymousObject.cs b/src/net/KEFCore/Query/Internal/AnonymousObject.cs index bf5ad1bf..7fff5f8b 100644 --- a/src/net/KEFCore/Query/Internal/AnonymousObject.cs +++ b/src/net/KEFCore/Query/Internal/AnonymousObject.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,13 @@ * Refer to LICENSE for more information. */ -using JetBrains.Annotations; - namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public readonly struct AnonymousObject { private readonly object[] _values; diff --git a/src/net/KEFCore/Query/Internal/CollectionResultShaperExpression.cs b/src/net/KEFCore/Query/Internal/CollectionResultShaperExpression.cs index 5d447fb7..b177f1e9 100644 --- a/src/net/KEFCore/Query/Internal/CollectionResultShaperExpression.cs +++ b/src/net/KEFCore/Query/Internal/CollectionResultShaperExpression.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class CollectionResultShaperExpression : Expression, IPrintableExpression { public CollectionResultShaperExpression( diff --git a/src/net/KEFCore/Query/Internal/EntityProjectionExpression.cs b/src/net/KEFCore/Query/Internal/EntityProjectionExpression.cs index 436df31a..8d296ce5 100644 --- a/src/net/KEFCore/Query/Internal/EntityProjectionExpression.cs +++ b/src/net/KEFCore/Query/Internal/EntityProjectionExpression.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,12 @@ using MASES.EntityFrameworkCore.KNet.Internal; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class EntityProjectionExpression : Expression, IPrintableExpression { private readonly IReadOnlyDictionary _readExpressionMap; diff --git a/src/net/KEFCore/Query/Internal/KafkaExpressionTranslatingExpressionVisitor.cs b/src/net/KEFCore/Query/Internal/KafkaExpressionTranslatingExpressionVisitor.cs index 1b3a0316..16e6b3e3 100644 --- a/src/net/KEFCore/Query/Internal/KafkaExpressionTranslatingExpressionVisitor.cs +++ b/src/net/KEFCore/Query/Internal/KafkaExpressionTranslatingExpressionVisitor.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,12 @@ using ExpressionExtensions = Microsoft.EntityFrameworkCore.Infrastructure.ExpressionExtensions; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaExpressionTranslatingExpressionVisitor : ExpressionVisitor { private const string RuntimeParameterPrefix = QueryCompilationContext.QueryParameterPrefix + "entity_equality_"; diff --git a/src/net/KEFCore/Query/Internal/KafkaProjectionBindingExpressionVisitor.cs b/src/net/KEFCore/Query/Internal/KafkaProjectionBindingExpressionVisitor.cs index 69a6b96c..c56ce010 100644 --- a/src/net/KEFCore/Query/Internal/KafkaProjectionBindingExpressionVisitor.cs +++ b/src/net/KEFCore/Query/Internal/KafkaProjectionBindingExpressionVisitor.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,12 @@ using System.Diagnostics.CodeAnalysis; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaProjectionBindingExpressionVisitor : ExpressionVisitor { private readonly KafkaQueryableMethodTranslatingExpressionVisitor _queryableMethodTranslatingExpressionVisitor; diff --git a/src/net/KEFCore/Query/Internal/KafkaQueryContext.cs b/src/net/KEFCore/Query/Internal/KafkaQueryContext.cs index 86b2d318..669a5a46 100644 --- a/src/net/KEFCore/Query/Internal/KafkaQueryContext.cs +++ b/src/net/KEFCore/Query/Internal/KafkaQueryContext.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,15 @@ */ using MASES.EntityFrameworkCore.KNet.Storage.Internal; +using System.Collections.Concurrent; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaQueryContext : QueryContext { private readonly IKafkaCluster _cluster; diff --git a/src/net/KEFCore/Query/Internal/KafkaQueryContextFactory.cs b/src/net/KEFCore/Query/Internal/KafkaQueryContextFactory.cs index 68cdb7af..3adfba7a 100644 --- a/src/net/KEFCore/Query/Internal/KafkaQueryContextFactory.cs +++ b/src/net/KEFCore/Query/Internal/KafkaQueryContextFactory.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,12 @@ using MASES.EntityFrameworkCore.KNet.Storage.Internal; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaQueryContextFactory : IQueryContextFactory { private readonly IKafkaCluster _cluster; diff --git a/src/net/KEFCore/Query/Internal/KafkaQueryExpression.Helper.cs b/src/net/KEFCore/Query/Internal/KafkaQueryExpression.Helper.cs index 1f81499c..c70587b9 100644 --- a/src/net/KEFCore/Query/Internal/KafkaQueryExpression.Helper.cs +++ b/src/net/KEFCore/Query/Internal/KafkaQueryExpression.Helper.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,12 @@ using System.Linq; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public partial class KafkaQueryExpression { private sealed class ResultEnumerable : IEnumerable diff --git a/src/net/KEFCore/Query/Internal/KafkaQueryExpression.cs b/src/net/KEFCore/Query/Internal/KafkaQueryExpression.cs index c4e6dd93..8ff2b23d 100644 --- a/src/net/KEFCore/Query/Internal/KafkaQueryExpression.cs +++ b/src/net/KEFCore/Query/Internal/KafkaQueryExpression.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,12 @@ using ExpressionExtensions = Microsoft.EntityFrameworkCore.Infrastructure.ExpressionExtensions; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public partial class KafkaQueryExpression : Expression, IPrintableExpression { private static readonly ConstructorInfo ValueBufferConstructor diff --git a/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitor.cs b/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitor.cs index 34fdb34e..611620a0 100644 --- a/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitor.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaQueryableMethodTranslatingExpressionVisitor : QueryableMethodTranslatingExpressionVisitor { private readonly KafkaExpressionTranslatingExpressionVisitor _expressionTranslator; diff --git a/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitorFactory.cs b/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitorFactory.cs index 70645246..2a7ab11f 100644 --- a/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitorFactory.cs +++ b/src/net/KEFCore/Query/Internal/KafkaQueryableMethodTranslatingExpressionVisitorFactory.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaQueryableMethodTranslatingExpressionVisitorFactory : IQueryableMethodTranslatingExpressionVisitorFactory { public KafkaQueryableMethodTranslatingExpressionVisitorFactory( diff --git a/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs b/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs index 14a3178f..4698bc7b 100644 --- a/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs +++ b/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,12 @@ using MASES.EntityFrameworkCore.KNet.Internal; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public partial class KafkaShapedQueryCompilingExpressionVisitor { private sealed class QueryingEnumerable : IAsyncEnumerable, IEnumerable, IQueryingEnumerable diff --git a/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.ShaperExpressionProcessingExpressionVisitor.cs b/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.ShaperExpressionProcessingExpressionVisitor.cs index d107f2a3..a56dc93f 100644 --- a/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.ShaperExpressionProcessingExpressionVisitor.cs +++ b/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.ShaperExpressionProcessingExpressionVisitor.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,12 @@ using ExpressionExtensions = Microsoft.EntityFrameworkCore.Infrastructure.ExpressionExtensions; namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public partial class KafkaShapedQueryCompilingExpressionVisitor { private sealed class ShaperExpressionProcessingExpressionVisitor : ExpressionVisitor diff --git a/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.cs b/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.cs index a0a6bdf5..1d110592 100644 --- a/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.cs +++ b/src/net/KEFCore/Query/Internal/KafkaShapedQueryCompilingExpressionVisitor.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public partial class KafkaShapedQueryCompilingExpressionVisitor : ShapedQueryCompilingExpressionVisitor { private readonly Type _contextType; diff --git a/src/net/KEFCore/Query/Internal/KafkaShapedQueryExpressionVisitorFactory.cs b/src/net/KEFCore/Query/Internal/KafkaShapedQueryExpressionVisitorFactory.cs index c734fba1..e91741a5 100644 --- a/src/net/KEFCore/Query/Internal/KafkaShapedQueryExpressionVisitorFactory.cs +++ b/src/net/KEFCore/Query/Internal/KafkaShapedQueryExpressionVisitorFactory.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaShapedQueryCompilingExpressionVisitorFactory : IShapedQueryCompilingExpressionVisitorFactory { public KafkaShapedQueryCompilingExpressionVisitorFactory( diff --git a/src/net/KEFCore/Query/Internal/KafkaTableExpression.cs b/src/net/KEFCore/Query/Internal/KafkaTableExpression.cs index 9b59365c..7fd627da 100644 --- a/src/net/KEFCore/Query/Internal/KafkaTableExpression.cs +++ b/src/net/KEFCore/Query/Internal/KafkaTableExpression.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTableExpression : Expression, IPrintableExpression { public KafkaTableExpression(IEntityType entityType) diff --git a/src/net/KEFCore/Query/Internal/SingleResultShaperExpression.cs b/src/net/KEFCore/Query/Internal/SingleResultShaperExpression.cs index fd04e96f..a4ab613d 100644 --- a/src/net/KEFCore/Query/Internal/SingleResultShaperExpression.cs +++ b/src/net/KEFCore/Query/Internal/SingleResultShaperExpression.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Query.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class SingleResultShaperExpression : Expression, IPrintableExpression { public SingleResultShaperExpression( diff --git a/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs b/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs index 6d629483..4dd7e6a6 100644 --- a/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs +++ b/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,12 @@ using System.Collections; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class EntityTypeProducer : IEntityTypeProducer where TKey : notnull { private readonly bool _useCompactedReplicator; @@ -38,8 +43,8 @@ public class EntityTypeProducer : IEntityTypeProducer where TKey : notnull private readonly IKNetCompactedReplicator>? _kafkaCompactedReplicator; private readonly IKNetProducer>? _kafkaProducer; private readonly IKafkaStreamsBaseRetriever _streamData; - private readonly KNetSerDes _keySerdes; - private readonly KNetSerDes> _valueSerdes; + private readonly IKNetSerDes _keySerdes; + private readonly IKNetSerDes> _valueSerdes; #region KNetCompactedReplicatorEnumerable class KNetCompactedReplicatorEnumerable : IEnumerable diff --git a/src/net/KEFCore/Storage/Internal/IEntityTypeProducer.cs b/src/net/KEFCore/Storage/Internal/IEntityTypeProducer.cs index 84b81db0..57d1a720 100644 --- a/src/net/KEFCore/Storage/Internal/IEntityTypeProducer.cs +++ b/src/net/KEFCore/Storage/Internal/IEntityTypeProducer.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,12 @@ using Org.Apache.Kafka.Clients.Producer; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IEntityTypeProducer : IDisposable { IEntityType EntityType { get; } diff --git a/src/net/KEFCore/Storage/Internal/IKafkaCluster.cs b/src/net/KEFCore/Storage/Internal/IKafkaCluster.cs index 022d50e8..f2108593 100644 --- a/src/net/KEFCore/Storage/Internal/IKafkaCluster.cs +++ b/src/net/KEFCore/Storage/Internal/IKafkaCluster.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ using MASES.EntityFrameworkCore.KNet.ValueGeneration.Internal; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaCluster : IDisposable { bool EnsureDeleted(IUpdateAdapterFactory updateAdapterFactory, IModel designModel, IDiagnosticsLogger updateLogger); diff --git a/src/net/KEFCore/Storage/Internal/IKafkaClusterCache.cs b/src/net/KEFCore/Storage/Internal/IKafkaClusterCache.cs index 4e9f5db0..c46d9858 100644 --- a/src/net/KEFCore/Storage/Internal/IKafkaClusterCache.cs +++ b/src/net/KEFCore/Storage/Internal/IKafkaClusterCache.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,12 @@ using MASES.EntityFrameworkCore.KNet.Infrastructure.Internal; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaClusterCache { IKafkaCluster GetCluster(KafkaOptionsExtension options); diff --git a/src/net/KEFCore/Storage/Internal/IKafkaDatabase.cs b/src/net/KEFCore/Storage/Internal/IKafkaDatabase.cs index e2aee765..1e00226d 100644 --- a/src/net/KEFCore/Storage/Internal/IKafkaDatabase.cs +++ b/src/net/KEFCore/Storage/Internal/IKafkaDatabase.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaDatabase : IDatabase, IDisposable { IKafkaCluster Cluster { get; } diff --git a/src/net/KEFCore/Storage/Internal/IKafkaRowBag.cs b/src/net/KEFCore/Storage/Internal/IKafkaRowBag.cs index 9ea24303..cf3650b5 100644 --- a/src/net/KEFCore/Storage/Internal/IKafkaRowBag.cs +++ b/src/net/KEFCore/Storage/Internal/IKafkaRowBag.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,12 @@ #nullable enable namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaRowBag { IUpdateEntry UpdateEntry { get; } diff --git a/src/net/KEFCore/Storage/Internal/IKafkaTable.cs b/src/net/KEFCore/Storage/Internal/IKafkaTable.cs index e3db233c..55cb0b97 100644 --- a/src/net/KEFCore/Storage/Internal/IKafkaTable.cs +++ b/src/net/KEFCore/Storage/Internal/IKafkaTable.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,14 @@ #nullable enable using MASES.EntityFrameworkCore.KNet.ValueGeneration.Internal; -using Java.Util.Concurrent; -using Org.Apache.Kafka.Clients.Producer; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaTable : IEntityTypeProducer { IReadOnlyList SnapshotRows(); diff --git a/src/net/KEFCore/Storage/Internal/IKafkaTableFactory.cs b/src/net/KEFCore/Storage/Internal/IKafkaTableFactory.cs index 2e1d3a0b..5d57e5f6 100644 --- a/src/net/KEFCore/Storage/Internal/IKafkaTableFactory.cs +++ b/src/net/KEFCore/Storage/Internal/IKafkaTableFactory.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaTableFactory { IKafkaTable Create(IKafkaCluster cluster, IEntityType entityType); diff --git a/src/net/KEFCore/Storage/Internal/KafkaCluster.cs b/src/net/KEFCore/Storage/Internal/KafkaCluster.cs index e2cbdf1d..8164d8f1 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaCluster.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaCluster.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,12 @@ using Org.Apache.Kafka.Tools; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaCluster : IKafkaCluster { private readonly KafkaOptionsExtension _options; diff --git a/src/net/KEFCore/Storage/Internal/KafkaClusterCache.cs b/src/net/KEFCore/Storage/Internal/KafkaClusterCache.cs index 24462a29..aa1024a1 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaClusterCache.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaClusterCache.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,12 @@ using MASES.EntityFrameworkCore.KNet.Infrastructure.Internal; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaClusterCache : IKafkaClusterCache { private readonly IKafkaTableFactory _tableFactory; diff --git a/src/net/KEFCore/Storage/Internal/KafkaClusterCacheExtensions.cs b/src/net/KEFCore/Storage/Internal/KafkaClusterCacheExtensions.cs index 1c6e7583..f63e927a 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaClusterCacheExtensions.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaClusterCacheExtensions.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,12 @@ using MASES.EntityFrameworkCore.KNet.Infrastructure.Internal; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public static class KafkaClusterCacheExtensions { public static IKafkaCluster GetCluster(this IKafkaClusterCache storeCache, IDbContextOptions options) diff --git a/src/net/KEFCore/Storage/Internal/KafkaDatabase.cs b/src/net/KEFCore/Storage/Internal/KafkaDatabase.cs index 0d2b7768..7a0f6c41 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaDatabase.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaDatabase.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaDatabase : Database, IKafkaDatabase { private readonly IKafkaClusterCache _clusterCache; diff --git a/src/net/KEFCore/Storage/Internal/KafkaDatabaseCreator.cs b/src/net/KEFCore/Storage/Internal/KafkaDatabaseCreator.cs index 57cd1a4b..b4b30b69 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaDatabaseCreator.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaDatabaseCreator.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaDatabaseCreator : IDatabaseCreator { private readonly IDatabase _database; diff --git a/src/net/KEFCore/Storage/Internal/KafkaRowBag.cs b/src/net/KEFCore/Storage/Internal/KafkaRowBag.cs index f82838b9..8e8e4d88 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaRowBag.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaRowBag.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,12 @@ #nullable enable namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaRowBag : IKafkaRowBag { public KafkaRowBag(IUpdateEntry entry, string topicName, TKey key, IProperty[] properties, object?[]? row) diff --git a/src/net/KEFCore/Storage/Internal/KafkaStreamsBaseRetriever.cs b/src/net/KEFCore/Storage/Internal/KafkaStreamsBaseRetriever.cs index 885e4ea6..4132a4f0 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaStreamsBaseRetriever.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaStreamsBaseRetriever.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,169 +28,180 @@ using Org.Apache.Kafka.Streams.State; using static Org.Apache.Kafka.Streams.Errors.StreamsUncaughtExceptionHandler; -namespace MASES.EntityFrameworkCore.KNet.Storage.Internal -{ - public interface IKafkaStreamsBaseRetriever : IEnumerable, IDisposable - { - } +namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - public class KafkaStreamsBaseRetriever : IKafkaStreamsBaseRetriever - where TValue : IEntityTypeData - { - private readonly IKafkaCluster _kafkaCluster; - private readonly IEntityType _entityType; - private readonly IKNetSerDes _keySerdes; - private readonly IKNetSerDes _valueSerdes; - private readonly StreamsBuilder _builder; - private readonly KStream _root; +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// +public interface IKafkaStreamsBaseRetriever : IEnumerable, IDisposable +{ +} +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// +public class KafkaStreamsBaseRetriever : IKafkaStreamsBaseRetriever + where TValue : IEntityTypeData +{ + private readonly IKafkaCluster _kafkaCluster; + private readonly IEntityType _entityType; + private readonly IKNetSerDes _keySerdes; + private readonly IKNetSerDes _valueSerdes; + private readonly StreamsBuilder _builder; + private readonly KStream _root; - private readonly AutoResetEvent _dataReceived = new(false); - private readonly AutoResetEvent _resetEvent = new(false); - private readonly AutoResetEvent _stateChanged = new(false); - private readonly AutoResetEvent _exceptionSet = new(false); + private readonly AutoResetEvent _dataReceived = new(false); + private readonly AutoResetEvent _resetEvent = new(false); + private readonly AutoResetEvent _stateChanged = new(false); + private readonly AutoResetEvent _exceptionSet = new(false); - private KafkaStreams? _streams = null; - private StreamsUncaughtExceptionHandler? _errorHandler; - private KafkaStreams.StateListener? _stateListener; + private KafkaStreams? _streams = null; + private StreamsUncaughtExceptionHandler? _errorHandler; + private KafkaStreams.StateListener? _stateListener; - private readonly string _storageId; - private Exception? _resultException = null; - private KafkaStreams.State _currentState = KafkaStreams.State.NOT_RUNNING; - private ReadOnlyKeyValueStore? keyValueStore; + private readonly string _storageId; + private Exception? _resultException = null; + private KafkaStreams.State _currentState = KafkaStreams.State.NOT_RUNNING; + private ReadOnlyKeyValueStore? keyValueStore; - public KafkaStreamsBaseRetriever(IKafkaCluster kafkaCluster, IEntityType entityType, IKNetSerDes keySerdes, IKNetSerDes valueSerdes, string storageId, StreamsBuilder builder, KStream root) - { - _kafkaCluster = kafkaCluster; - _entityType = entityType; - _keySerdes = keySerdes; - _valueSerdes = valueSerdes; - _builder = builder; - _root = root; - _storageId = _kafkaCluster.Options.UsePersistentStorage ? storageId : Process.GetCurrentProcess().ProcessName + "-" + storageId; + public KafkaStreamsBaseRetriever(IKafkaCluster kafkaCluster, IEntityType entityType, IKNetSerDes keySerdes, IKNetSerDes valueSerdes, string storageId, StreamsBuilder builder, KStream root) + { + _kafkaCluster = kafkaCluster; + _entityType = entityType; + _keySerdes = keySerdes; + _valueSerdes = valueSerdes; + _builder = builder; + _root = root; + _storageId = _kafkaCluster.Options.UsePersistentStorage ? storageId : Process.GetCurrentProcess().ProcessName + "-" + storageId; - StartTopology(_builder, _root); - } + StartTopology(_builder, _root); + } - private void StartTopology(StreamsBuilder builder, KStream root) - { - var storeSupplier = _kafkaCluster.Options.UsePersistentStorage ? Stores.PersistentKeyValueStore(_storageId) : Stores.InMemoryKeyValueStore(_storageId); - var materialized = Materialized>.As(storeSupplier); - root.ToTable(materialized); + private void StartTopology(StreamsBuilder builder, KStream root) + { + var storeSupplier = _kafkaCluster.Options.UsePersistentStorage ? Stores.PersistentKeyValueStore(_storageId) : Stores.InMemoryKeyValueStore(_storageId); + var materialized = Materialized>.As(storeSupplier); + root.ToTable(materialized); - _streams = new(builder.Build(), _kafkaCluster.Options.StreamsOptions(_entityType)); + _streams = new(builder.Build(), _kafkaCluster.Options.StreamsOptions(_entityType)); - _errorHandler = new() + _errorHandler = new() + { + OnHandle = (exception) => { - OnHandle = (exception) => - { - _resultException = exception; - _exceptionSet.Set(); - return StreamThreadExceptionResponse.SHUTDOWN_APPLICATION; - } - }; + _resultException = exception; + _exceptionSet.Set(); + return StreamThreadExceptionResponse.SHUTDOWN_APPLICATION; + } + }; - _stateListener = new() + _stateListener = new() + { + OnOnChange = (newState, oldState) => { - OnOnChange = (newState, oldState) => - { - _currentState = newState; + _currentState = newState; #if DEBUG_PERFORMANCE Infrastructure.KafkaDbContext.ReportString($"StateListener of {_entityType.Name} oldState: {oldState} newState: {newState} on {DateTime.Now:HH:mm:ss.FFFFFFF}"); #endif - if (_stateChanged != null && !_stateChanged.SafeWaitHandle.IsClosed) _stateChanged.Set(); - } - }; + if (_stateChanged != null && !_stateChanged.SafeWaitHandle.IsClosed) _stateChanged.Set(); + } + }; - _streams.SetUncaughtExceptionHandler(_errorHandler); - _streams.SetStateListener(_stateListener); + _streams.SetUncaughtExceptionHandler(_errorHandler); + _streams.SetStateListener(_stateListener); - ThreadPool.QueueUserWorkItem((o) => + ThreadPool.QueueUserWorkItem((o) => + { + int waitingTime = Timeout.Infinite; + Stopwatch watcher = new(); + try { - int waitingTime = Timeout.Infinite; - Stopwatch watcher = new(); - try + _resetEvent.Set(); + var index = WaitHandle.WaitAny(new WaitHandle[] { _stateChanged, _exceptionSet }); + if (index == 1) return; + while (true) { - _resetEvent.Set(); - var index = WaitHandle.WaitAny(new WaitHandle[] { _stateChanged, _exceptionSet }); - if (index == 1) return; - while (true) + index = WaitHandle.WaitAny(new WaitHandle[] { _stateChanged, _dataReceived, _exceptionSet }, waitingTime); + if (index == 2) return; + if (_currentState.Equals(KafkaStreams.State.CREATED) || _currentState.Equals(KafkaStreams.State.REBALANCING)) { - index = WaitHandle.WaitAny(new WaitHandle[] { _stateChanged, _dataReceived, _exceptionSet }, waitingTime); - if (index == 2) return; - if (_currentState.Equals(KafkaStreams.State.CREATED) || _currentState.Equals(KafkaStreams.State.REBALANCING)) + if (index == WaitHandle.WaitTimeout) { - if (index == WaitHandle.WaitTimeout) - { #if DEBUG_PERFORMANCE Infrastructure.KafkaDbContext.ReportString($"State of {_entityType.Name}: {_currentState} No handle set within {waitingTime} ms"); #endif - continue; - } - } - else // exit external wait thread - { - return; + continue; } } + else // exit external wait thread + { + return; + } } - catch (Exception e) - { - _resultException = e; - } - finally - { - _resetEvent.Set(); - } - }); - _resetEvent.WaitOne(); - _streams.Start(); + } + catch (Exception e) + { + _resultException = e; + } + finally + { + _resetEvent.Set(); + } + }); + _resetEvent.WaitOne(); + _streams.Start(); #if DEBUG_PERFORMANCE Infrastructure.KafkaDbContext.ReportString($"KafkaStreamsBaseRetriever on {_entityType.Name} started on {DateTime.Now:HH:mm:ss.FFFFFFF}"); #endif - _resetEvent.WaitOne(); // wait running state - if (_resultException != null) throw _resultException; + _resetEvent.WaitOne(); // wait running state + if (_resultException != null) throw _resultException; - keyValueStore ??= _streams?.Store(StoreQueryParameters>.FromNameAndType(_storageId, QueryableStoreTypes.KeyValueStore())); - } + keyValueStore ??= _streams?.Store(StoreQueryParameters>.FromNameAndType(_storageId, QueryableStoreTypes.KeyValueStore())); + } - public IEnumerator GetEnumerator() - { - if (_resultException != null) throw _resultException; + public IEnumerator GetEnumerator() + { + if (_resultException != null) throw _resultException; #if DEBUG_PERFORMANCE Infrastructure.KafkaDbContext.ReportString($"Requested KafkaEnumerator for {_entityType.Name} on {DateTime.Now:HH:mm:ss.FFFFFFF}"); #endif - return new KafkaEnumerator(_kafkaCluster, _entityType, _keySerdes, _valueSerdes, keyValueStore); - } + return new KafkaEnumerator(_kafkaCluster, _entityType, _keySerdes, _valueSerdes, keyValueStore); + } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } - public void Dispose() - { - _streams?.Close(); - _dataReceived?.Dispose(); - _resetEvent?.Dispose(); - _exceptionSet?.Dispose(); - _errorHandler?.Dispose(); - _stateListener?.Dispose(); - _stateChanged?.Dispose(); + public void Dispose() + { + _streams?.Close(); + _dataReceived?.Dispose(); + _resetEvent?.Dispose(); + _exceptionSet?.Dispose(); + _errorHandler?.Dispose(); + _stateListener?.Dispose(); + _stateChanged?.Dispose(); - _streams = null; - _errorHandler = null; - _stateListener = null; - } + _streams = null; + _errorHandler = null; + _stateListener = null; + } - class KafkaEnumerator : IEnumerator - { - private readonly IKafkaCluster _kafkaCluster; - private readonly IEntityType _entityType; - private readonly IKNetSerDes _keySerdes; - private readonly IKNetSerDes _valueSerdes; - private readonly ReadOnlyKeyValueStore? _keyValueStore; - private KeyValueIterator? keyValueIterator = null; - private IEnumerator>? keyValueEnumerator = null; + class KafkaEnumerator : IEnumerator + { + private readonly IKafkaCluster _kafkaCluster; + private readonly IEntityType _entityType; + private readonly IKNetSerDes _keySerdes; + private readonly IKNetSerDes _valueSerdes; + private readonly ReadOnlyKeyValueStore? _keyValueStore; + private KeyValueIterator? keyValueIterator = null; + private IEnumerator>? keyValueEnumerator = null; #if DEBUG_PERFORMANCE Stopwatch _moveNextSw = new Stopwatch(); @@ -199,55 +210,55 @@ class KafkaEnumerator : IEnumerator Stopwatch _valueBufferSw = new Stopwatch(); #endif - public KafkaEnumerator(IKafkaCluster kafkaCluster, IEntityType entityType, IKNetSerDes keySerdes, IKNetSerDes valueSerdes, ReadOnlyKeyValueStore? keyValueStore) - { - if (keyValueStore == null) throw new ArgumentNullException(nameof(keyValueStore)); - _kafkaCluster = kafkaCluster ?? throw new ArgumentNullException(nameof(kafkaCluster)); - _entityType = entityType; - _keySerdes = keySerdes ?? throw new ArgumentNullException(nameof(keySerdes)); - _valueSerdes = valueSerdes ?? throw new ArgumentNullException(nameof(valueSerdes)); - _keyValueStore = keyValueStore; + public KafkaEnumerator(IKafkaCluster kafkaCluster, IEntityType entityType, IKNetSerDes keySerdes, IKNetSerDes valueSerdes, ReadOnlyKeyValueStore? keyValueStore) + { + if (keyValueStore == null) throw new ArgumentNullException(nameof(keyValueStore)); + _kafkaCluster = kafkaCluster ?? throw new ArgumentNullException(nameof(kafkaCluster)); + _entityType = entityType; + _keySerdes = keySerdes ?? throw new ArgumentNullException(nameof(keySerdes)); + _valueSerdes = valueSerdes ?? throw new ArgumentNullException(nameof(valueSerdes)); + _keyValueStore = keyValueStore; #if DEBUG_PERFORMANCE Infrastructure.KafkaDbContext.ReportString($"KafkaEnumerator for {_entityType.Name} - ApproximateNumEntries {_keyValueStore?.ApproximateNumEntries()}"); #endif - keyValueIterator = _keyValueStore?.All(); - keyValueEnumerator = keyValueIterator?.ToIEnumerator(); - } + keyValueIterator = _keyValueStore?.All(); + keyValueEnumerator = keyValueIterator?.ToIEnumerator(); + } - public ValueBuffer Current + public ValueBuffer Current + { + get { - get - { #if DEBUG_PERFORMANCE try { _currentSw.Start(); #endif - if (keyValueEnumerator != null) - { - var kv = keyValueEnumerator.Current; - object? v = kv.value; + if (keyValueEnumerator != null) + { + var kv = keyValueEnumerator.Current; + object? v = kv.value; #if DEBUG_PERFORMANCE _valueSerdesSw.Start(); #endif - TValue entityTypeData = _valueSerdes.DeserializeWithHeaders(null, null, v as byte[]); + TValue entityTypeData = _valueSerdes.DeserializeWithHeaders(null, null, v as byte[]); #if DEBUG_PERFORMANCE _valueSerdesSw.Stop(); _valueBufferSw.Start(); #endif - object[] array = null; - entityTypeData.GetData(_entityType, ref array); + object[] array = null; + entityTypeData.GetData(_entityType, ref array); #if DEBUG_PERFORMANCE _valueBufferSw.Stop(); #endif - var data = new ValueBuffer(array); - if (data.IsEmpty) - { - throw new InvalidOperationException("Data is Empty"); - } - return data; + var data = new ValueBuffer(array); + if (data.IsEmpty) + { + throw new InvalidOperationException("Data is Empty"); } - throw new InvalidOperationException("InvalidEnumerator"); + return data; + } + throw new InvalidOperationException("InvalidEnumerator"); #if DEBUG_PERFORMANCE } finally @@ -255,39 +266,38 @@ public ValueBuffer Current _currentSw.Stop(); } #endif - } } + } - object System.Collections.IEnumerator.Current => Current; + object System.Collections.IEnumerator.Current => Current; - public void Dispose() - { + public void Dispose() + { #if DEBUG_PERFORMANCE Infrastructure.KafkaDbContext.ReportString($"KafkaEnumerator _moveNextSw: {_moveNextSw.Elapsed} _currentSw: {_currentSw.Elapsed} _valueSerdesSw: {_valueSerdesSw.Elapsed} _valueBufferSw: {_valueBufferSw.Elapsed}"); #endif - keyValueIterator?.Dispose(); - } + keyValueIterator?.Dispose(); + } - public bool MoveNext() - { + public bool MoveNext() + { #if DEBUG_PERFORMANCE try { _moveNextSw.Start(); #endif - return (keyValueEnumerator != null) && keyValueEnumerator.MoveNext(); + return (keyValueEnumerator != null) && keyValueEnumerator.MoveNext(); #if DEBUG_PERFORMANCE } finally { _moveNextSw.Stop(); } #endif - } + } - public void Reset() - { - keyValueIterator?.Dispose(); - keyValueIterator = _keyValueStore?.All(); - keyValueEnumerator = keyValueIterator?.ToIEnumerator(); - } + public void Reset() + { + keyValueIterator?.Dispose(); + keyValueIterator = _keyValueStore?.All(); + keyValueEnumerator = keyValueIterator?.ToIEnumerator(); } } } diff --git a/src/net/KEFCore/Storage/Internal/KafkaTable.cs b/src/net/KEFCore/Storage/Internal/KafkaTable.cs index d6923dfb..e3431d25 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaTable.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaTable.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,12 @@ using Microsoft.EntityFrameworkCore.Metadata.Internal; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTable : IKafkaTable where TKey : notnull { diff --git a/src/net/KEFCore/Storage/Internal/KafkaTableFactory.cs b/src/net/KEFCore/Storage/Internal/KafkaTableFactory.cs index ac2f0f2b..91836803 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaTableFactory.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaTableFactory.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,12 @@ using Org.Apache.Kafka.Common; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTableFactory : IKafkaTableFactory { private readonly bool _sensitiveLoggingEnabled; diff --git a/src/net/KEFCore/Storage/Internal/KafkaTableSnapshot.cs b/src/net/KEFCore/Storage/Internal/KafkaTableSnapshot.cs index 3d19b40b..a4167a2d 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaTableSnapshot.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaTableSnapshot.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTableSnapshot { public KafkaTableSnapshot( diff --git a/src/net/KEFCore/Storage/Internal/KafkaTransaction.cs b/src/net/KEFCore/Storage/Internal/KafkaTransaction.cs index 986deb31..0a654a4e 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaTransaction.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaTransaction.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTransaction : IDbContextTransaction { public virtual Guid TransactionId { get; } = Guid.NewGuid(); diff --git a/src/net/KEFCore/Storage/Internal/KafkaTransactionManager.cs b/src/net/KEFCore/Storage/Internal/KafkaTransactionManager.cs index 77f849ad..463c37c2 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaTransactionManager.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaTransactionManager.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,12 @@ using MASES.EntityFrameworkCore.KNet.Internal; namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTransactionManager : IDbContextTransactionManager, ITransactionEnlistmentManager { private static readonly KafkaTransaction StubTransaction = new(); diff --git a/src/net/KEFCore/Storage/Internal/KafkaTypeMapping.cs b/src/net/KEFCore/Storage/Internal/KafkaTypeMapping.cs index 16f318de..7a4aa453 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaTypeMapping.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaTypeMapping.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTypeMapping : CoreTypeMapping { public KafkaTypeMapping( diff --git a/src/net/KEFCore/Storage/Internal/KafkaTypeMappingSource.cs b/src/net/KEFCore/Storage/Internal/KafkaTypeMappingSource.cs index 0e29e185..9f5473cd 100644 --- a/src/net/KEFCore/Storage/Internal/KafkaTypeMappingSource.cs +++ b/src/net/KEFCore/Storage/Internal/KafkaTypeMappingSource.cs @@ -1,5 +1,5 @@ /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.Storage.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaTypeMappingSource : TypeMappingSource { public KafkaTypeMappingSource(TypeMappingSourceDependencies dependencies) diff --git a/src/net/KEFCore/ValueGeneration/Internal/IKafkaIntegerValueGenerator.cs b/src/net/KEFCore/ValueGeneration/Internal/IKafkaIntegerValueGenerator.cs index 2cd7408a..18a4ebc1 100644 --- a/src/net/KEFCore/ValueGeneration/Internal/IKafkaIntegerValueGenerator.cs +++ b/src/net/KEFCore/ValueGeneration/Internal/IKafkaIntegerValueGenerator.cs @@ -1,8 +1,5 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +17,12 @@ */ namespace MASES.EntityFrameworkCore.KNet.ValueGeneration.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public interface IKafkaIntegerValueGenerator { void Bump(object?[] row); diff --git a/src/net/KEFCore/ValueGeneration/Internal/KafkaIntegerValueGenerator.cs b/src/net/KEFCore/ValueGeneration/Internal/KafkaIntegerValueGenerator.cs index 4dd23ee3..a2bda1e7 100644 --- a/src/net/KEFCore/ValueGeneration/Internal/KafkaIntegerValueGenerator.cs +++ b/src/net/KEFCore/ValueGeneration/Internal/KafkaIntegerValueGenerator.cs @@ -1,8 +1,5 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - /* -*Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +19,12 @@ using System.Globalization; namespace MASES.EntityFrameworkCore.KNet.ValueGeneration.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaIntegerValueGenerator : ValueGenerator, IKafkaIntegerValueGenerator { private readonly int _propertyIndex; diff --git a/src/net/KEFCore/ValueGeneration/Internal/KafkaValueGeneratorSelector.cs b/src/net/KEFCore/ValueGeneration/Internal/KafkaValueGeneratorSelector.cs index 693f2fdf..4d57e3dc 100644 --- a/src/net/KEFCore/ValueGeneration/Internal/KafkaValueGeneratorSelector.cs +++ b/src/net/KEFCore/ValueGeneration/Internal/KafkaValueGeneratorSelector.cs @@ -1,8 +1,5 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - /* -* Copyright 2022 MASES s.r.l. +* Copyright 2023 MASES s.r.l. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +19,12 @@ using MASES.EntityFrameworkCore.KNet.Storage.Internal; namespace MASES.EntityFrameworkCore.KNet.ValueGeneration.Internal; - +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// any release. You should only use it directly in your code with extreme caution and knowing that +/// doing so can result in application failures when updating to a new Entity Framework Core release. +/// public class KafkaValueGeneratorSelector : ValueGeneratorSelector { private readonly IKafkaCluster _kafkaCluster;