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

SDK DDB client update and search interface implementation #2590

Conversation

arjunkumargiri
Copy link
Contributor

Description

SDK DDB client update and search interface implementation.

  • Added implementation of DDB update
  • Search requests are routed to search SDK client
  • Update create and search to write as json attribute instead of a string under source attribute.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@arjunkumargiri arjunkumargiri temporarily deployed to ml-commons-cicd-env June 26, 2024 03:28 — with GitHub Actions Inactive
@arjunkumargiri arjunkumargiri temporarily deployed to ml-commons-cicd-env June 26, 2024 03:28 — with GitHub Actions Inactive
@arjunkumargiri arjunkumargiri temporarily deployed to ml-commons-cicd-env June 26, 2024 03:28 — with GitHub Actions Inactive
@arjunkumargiri arjunkumargiri temporarily deployed to ml-commons-cicd-env June 26, 2024 03:28 — with GitHub Actions Inactive
@arjunkumargiri arjunkumargiri temporarily deployed to ml-commons-cicd-env June 26, 2024 03:28 — with GitHub Actions Inactive
@arjunkumargiri arjunkumargiri temporarily deployed to ml-commons-cicd-env June 26, 2024 03:28 — with GitHub Actions Inactive
dynamoDbClient.putItem(putItemRequest);
return new PutDataObjectResponse.Builder().id(id).created(true).build();
} catch (IOException e) {
throw new OpenSearchStatusException("Failed to parse data object " + request.id(), RestStatus.BAD_REQUEST);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if parsing data object is fine, but indexing failed for some other reason may be DDB was not reachable, or throttled or some other reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DDB would through runtime exception which will not be wrapped.

private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();

@VisibleForTesting
public static Map<String, AttributeValue> convertJsonObjectToItem(JsonNode jsonNode) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

convertJsonObjectToDDbAttributeMap? as this method is only taking care of Dynamodb? Same goes for the other method name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename the class too? JsonTransformer sounds too generic in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update method name, however would like to keep the name generic to support other json transformation functions in future

Signed-off-by: Arjun kumar Giri <[email protected]>
@dhrubo-os dhrubo-os merged commit 34fca30 into opensearch-project:feature/multi_tenancy Jun 27, 2024
6 of 9 checks passed
@arjunkumargiri arjunkumargiri deleted the multi_tenancy branch June 27, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants