修复优化代码

This commit is contained in:
xuejiaming 2022-09-28 13:43:04 +08:00
parent f975f6459d
commit b436cf7242
2 changed files with 17 additions and 80 deletions

View File

@ -29,74 +29,11 @@ namespace ShardingCore.Sharding.MergeEngines.Executors.Enumerables.Abstractions
{
}
// protected abstract IStreamMergeCombine GetStreamMergeCombine();
public override ICircuitBreaker CreateCircuitBreaker()
{
return new EnumerableCircuitBreaker(GetStreamMergeContext());
}
// protected override void MergeParallelExecuteResult(
// LinkedList<IStreamMergeAsyncEnumerator<TResult>> previewResults,
// IEnumerable<IStreamMergeAsyncEnumerator<TResult>> parallelResults, bool async)
// {
// var previewResultsCount = previewResults.Count;
// if (previewResultsCount > 1)
// {
// throw new ShardingCoreInvalidOperationException(
// $"{typeof(TResult)} {nameof(previewResults)} has more than one element in container");
// }
//
// var parallelCount = parallelResults.Count();
// if (parallelCount == 0)
// return;
// //聚合
// if (previewResults is LinkedList<IStreamMergeAsyncEnumerator<TResult>>
// previewInMemoryStreamEnumeratorResults &&
// parallelResults is IEnumerable<IStreamMergeAsyncEnumerator<TResult>> parallelStreamEnumeratorResults)
// {
// var mergeAsyncEnumerators = new LinkedList<IStreamMergeAsyncEnumerator<TResult>>();
// if (previewResultsCount == 1)
// {
// mergeAsyncEnumerators.AddLast(previewInMemoryStreamEnumeratorResults.First());
// }
//
// foreach (var parallelStreamEnumeratorResult in parallelStreamEnumeratorResults)
// {
// mergeAsyncEnumerators.AddLast(parallelStreamEnumeratorResult);
// }
//
// var combineStreamMergeAsyncEnumerator =
// CombineInMemoryStreamMergeAsyncEnumerator(mergeAsyncEnumerators.ToArray());
// // var streamMergeContext = GetStreamMergeContext();
// // IStreamMergeAsyncEnumerator<TResult> inMemoryStreamMergeAsyncEnumerator =streamMergeContext.HasGroupQuery()&&streamMergeContext.GroupQueryMemoryMerge()?
// // new InMemoryGroupByOrderStreamMergeAsyncEnumerator<TResult>(streamMergeContext,combineStreamMergeAsyncEnumerator,async):
// // new InMemoryStreamMergeAsyncEnumerator<TResult>(combineStreamMergeAsyncEnumerator, async);
// var inMemoryStreamMergeAsyncEnumerator= new InMemoryStreamMergeAsyncEnumerator<TResult>(combineStreamMergeAsyncEnumerator, async);
// previewInMemoryStreamEnumeratorResults.Clear();
// previewInMemoryStreamEnumeratorResults.AddLast(inMemoryStreamMergeAsyncEnumerator);
// //合并
// return;
// }
//
// throw new ShardingCoreInvalidOperationException(
// $"{typeof(TResult)} is not {typeof(IStreamMergeAsyncEnumerator<TResult>)}");
// }
// /// <summary>
// /// 合并成一个迭代器
// /// </summary>
// /// <param name="streamsAsyncEnumerators"></param>
// /// <returns></returns>
// public abstract IStreamMergeAsyncEnumerator<TResult> CombineStreamMergeAsyncEnumerator(
// IStreamMergeAsyncEnumerator<TResult>[] streamsAsyncEnumerators);
//
// public virtual IStreamMergeAsyncEnumerator<TResult> CombineInMemoryStreamMergeAsyncEnumerator(
// IStreamMergeAsyncEnumerator<TResult>[] streamsAsyncEnumerators)
// {
// return CombineStreamMergeAsyncEnumerator(streamsAsyncEnumerators);
// }
/// <summary>
/// 开启异步线程获取并发迭代器
/// </summary>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2;netcoreapp3;net5;net6</TargetFrameworks>
<Version>$(NET6_0)</Version>
<Version>$(EFCORE)</Version>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<DefineConstants>TRACE;DEBUG;</DefineConstants>
<LangVersion>latest</LangVersion>
@ -33,29 +33,29 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp2|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp2|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp2|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp2|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp3|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp3|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net5|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net5|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net5|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net5|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6|AnyCPU'">
<NoWarn>1701;1702;1591;</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Core\VirtualRoutes\RouteConditions\**" />