Push classification caching to be an internal detail of semantic classification. #58326
Push classification caching to be an internal detail of semantic classification. #58326CyrusNajmabadi merged 17 commits intodotnet:mainfrom
Conversation
| TextSpan textSpan, | ||
| Checksum checksum, | ||
| StorageDatabase database, | ||
| CancellationToken cancellationToken); |
There was a problem hiding this comment.
merged the semantic caching service with the semantic classification service.
| if (_uniqueItems.Add(item)) | ||
| _nextBatch.Add(item); | ||
| } | ||
| } |
There was a problem hiding this comment.
this was just a move for clarity. This needs to be called under a lock. so i moved this into the only method that calls this to make sure no one else accidentally calls this incorrectly outsdie of hte lock.
...ces/Remote/ServiceHub/Services/SemanticClassification/RemoteSemanticClassificationService.cs
Outdated
Show resolved
Hide resolved
…on/RemoteSemanticClassificationService.cs
…di/roslyn into classificationQueue
| } | ||
| } | ||
|
|
||
| private static async Task AddSemanticClassificationsAsync( |
There was a problem hiding this comment.
all special logic about caching moved into the classification service itself.
| @@ -1,77 +0,0 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
There was a problem hiding this comment.
no more incremental analysis to cause this work to happen. instead, we just use the pull requests on the OOP server to enqueue work to classify the full doc.
|
|
||
| private static async Task<bool> TryGetCachedClassificationsAsync( | ||
| Document document, TextSpan textSpan, ArrayBuilder<ClassifiedSpan> result, | ||
| RemoteHostClient client, bool isFullyLoaded, CancellationToken cancellationToken) |
There was a problem hiding this comment.
importantly, this work should not be pushed into the OOP client. the idea here is that we want to make this request without syncing over the full solution. so we must make the decision on the client to checked for cached results first, and if not go to normal results.
| /// </summary> | ||
| internal interface IRemoteSemanticClassificationCacheService | ||
| { | ||
| ValueTask CacheSemanticClassificationsAsync( |
There was a problem hiding this comment.
this method is gone completely. the client does not choose when things are cached.
| TextSpan textSpan, | ||
| Checksum checksum, | ||
| StorageDatabase database, | ||
| CancellationToken cancellationToken); |
There was a problem hiding this comment.
this method moved to the normal classification service.
...ces/Remote/ServiceHub/Services/SemanticClassification/RemoteSemanticClassificationService.cs
Outdated
Show resolved
Hide resolved
…on/RemoteSemanticClassificationService.cs
…di/roslyn into classificationQueue
|
@allisonchou this is available for you now. Semantic classification caching should now work transparently. |
|
Awesome, thanks so much Cyrus! |
No description provided.