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

Refactor mlayer #355

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

Kranthi-Guribilli
Copy link
Contributor

@Kranthi-Guribilli Kranthi-Guribilli commented May 8, 2024

  • Currently the mlayer service delegates all the data manipulation logic to the database service which is not the ideal way to do things.

  • Moving data manipulation logic from dbservice to mlayer service:

    • So, inorder to achieve this we have to shift the data manipulation logic to MlayerServiceImpl from the following
    • database/mlayer/
      • MlayerDomain - No changes
      • MlayerInstance - No changes
      • MlayerProvider - Done
        • Data Manipulation Logic: Moved the data manipulation logic, which includes processing the result from the database service call i.e., elastic search result, from the database service to the Mlayer service. This ensures that the Mlayer service is responsible for preparing the query and processing the results.
        • Handler Callback: The handler callback now delegates the result handling to the processProviderData method if the request contains an instance parameter. Otherwise, it directly handles the result from the database service call.
      • MlayerGeoQuery - Done

        Previously, the logic to manipulate the request data to create a query was done inside the database service. Now, moved this logic to the getMlayerGeoQuery method within the Mlayer service. This includes extracting instance and id from the request, constructing a query string, and passing it to the database service.

      • MlayerPopularDatasets - Done
      • MlayerDataset - Done

@jenkins-datakaveri
Copy link
Collaborator

Can one of the admins verify this patch?

@pranavrd
Copy link
Contributor

pranavrd commented May 8, 2024

ok to test

accessPolicy.put("OPEN", 0);

JsonArray accessPoliciesArray =
recordObject.getJsonObject("access_policies").getJsonArray("buckets");
Copy link
Contributor

Choose a reason for hiding this comment

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

This line will give error when the elastic index will be empty. It can be handled using 204 error if output from elastic is empty with no results. Reference: #364

@pranavrd pranavrd added the wontmerge Expiremental PRs label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontmerge Expiremental PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants