Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search SDK Sync Stack Integration #32286

Merged
merged 13 commits into from
Feb 7, 2023
Merged

Conversation

g2vinay
Copy link
Member

@g2vinay g2vinay commented Nov 22, 2022

Integrates Sync Stack in Azure Search Documents SDK

Note: Test Coverage needs to be added for async clients for this PR to be merged. #32360

Sync Stack Coverage

Onboards these key components in Azure Search SDK to Sync Stack.
image

Public APIs Added

Azure Core

image

Azure Search SDK

Search Paged Iterable

Applies to Suugest and AutoCompleteIterable.

image

@ghost ghost added Azure.Core azure-core Search labels Nov 22, 2022
@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 22, 2022

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-core
azure-search-documents

@g2vinay g2vinay marked this pull request as ready for review November 29, 2022 18:34
@g2vinay g2vinay changed the title Search SDK Sync Stack Integration [WIP] Search SDK Sync Stack Integration Nov 29, 2022
@@ -80,7 +80,7 @@ public PagedIterableBase(PagedFluxBase<T, P> pagedFluxBase) {
*
* @param provider the Page Retrieval Provider
*/
PagedIterableBase(Supplier<PageRetrieverSync<String, P>> provider) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intended?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is needed to unblock the custom Paged Iterable implementations in Search SDK.

@g2vinay g2vinay requested a review from samvaity as a code owner January 31, 2023 20:37
@g2vinay g2vinay requested a review from JimSuplizio as a code owner January 31, 2023 20:37
@g2vinay g2vinay force-pushed the kv-search-sync-stack branch from a48a6b3 to 05218b9 Compare February 3, 2023 02:08
return new SimpleResponse<>(response, Utility.convertValue(response.getValue(), modelClass));
} catch (IOException ex) {
throw LOGGER.logExceptionAsError(
new RuntimeException("Failed to deserialize document.", ex));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use UncheckedIOException here instead of RuntimeException. Also how does this handle with the wrapping utility method?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is unique with exception handling.
Localized exception handling for this method instead of using utility flow.

Comment on lines +736 to +740
Boolean includeTotalCountInternal = null;
if (searchOptions != null) {
includeTotalCountInternal = searchOptions.isTotalCountIncluded();
}
Boolean includeTotalCount = includeTotalCountInternal;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO for myself, file an issue against the autorest.java repo to clean up this pattern, this can be replaced with a terser and more readable pattern.

Boolean includeTotalCount = (searchOptions != null) ? searchOptions.isTotalCountIncluded() : null;

@@ -111,7 +111,7 @@ This swagger is ready for C# and Java.
output-folder: ../
java: true
use: '@autorest/java@4.1.2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the version of Autorest need to be updated here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure, if @srnagar has released the Autorest version with sync stack support.
if its available, we can update it.

createInstance(modelClass));
return new SimpleResponse<>(response, doc);
} catch (SearchErrorException ex) {
throw LOGGER.logExceptionAsError(DocumentResponseConversions.mapSearchErrorException(ex));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alzimmermsft, should we log this exception here ?
is this already logged somewhere in core pipeline flow ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's likely already logged somewhere else in the pipeline but I'm not 100% certain where this would happen. I think we can punt on this for a holistic discussion on logging and prevention of duplicative error logging.

@g2vinay g2vinay merged commit 6158e5f into Azure:main Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants