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

Improve rules creation using GeoFence batch #10537

Closed
etj opened this issue Jan 16, 2023 · 0 comments · Fixed by #10538
Closed

Improve rules creation using GeoFence batch #10537

etj opened this issue Jan 16, 2023 · 0 comments · Fixed by #10538
Assignees
Labels
enhancement master performance Issues regarding server Performance and Speed

Comments

@etj
Copy link
Contributor

etj commented Jan 16, 2023

The creation of the Rules in GeoFence should be as quick as possibile, since it may lead to excessive waiting time and, in some cases, to the failure of the logic related to guardian/geofence sync.

At the moment, in order to create a rule in GeoFence, 3 REST API calls are invoked:

  • get the number of rules
  • get the last rule (in order to read its priority)
  • create the new rule after the last existing rule

(btw, the priority computation at the moment is wrong, since it reuses the last used priority)

In order to improve the performance of rule creation, we can leverage on the use of GeoFence batch;
refs:

Instead of issuing REST calls for creating a single rule, we can

  • compute the rule priority using the existing 2 REST calls (pls note that this is a shortcoming due to the bad implementation of the rule insertion in the embedded geofence, since the original GeoFence API allowed more flexibility in the rule piority positioning
  • create a Batch with all the needed rules
  • add the rules in GeoFence in a single transactional call
@etj etj self-assigned this Jan 16, 2023
@etj etj added performance Issues regarding server Performance and Speed enhancement master labels Jan 16, 2023
@etj etj changed the title Improve rules creation on GeoFence Improve rules creation using GeoFence batch Jan 16, 2023
@etj etj linked a pull request Jan 16, 2023 that will close this issue
12 tasks
afabiani added a commit that referenced this issue Jan 23, 2023
* [Fixes #10537] Improve rules creation using GeoFence batch

* - code improvements accordingly to the PR comments

* - code improvements accordingly to the PR comments

* - Test fixes

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
github-actions bot pushed a commit that referenced this issue Jan 23, 2023
* [Fixes #10537] Improve rules creation using GeoFence batch

* - code improvements accordingly to the PR comments

* - code improvements accordingly to the PR comments

* - Test fixes

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit d101ead)
afabiani pushed a commit that referenced this issue Jan 23, 2023
…10567)

* [Fixes #10537] Improve rules creation using GeoFence batch

* - code improvements accordingly to the PR comments

* - code improvements accordingly to the PR comments

* - Test fixes

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit d101ead)

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
afabiani added a commit that referenced this issue Jan 26, 2023
#10585)

* [Code Formatting] Revert formatting on conflicting files

* [Fixes #10537] Improve rules creation using GeoFence batch - more improvements

* [#10574] Align code formatting with black

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
github-actions bot pushed a commit that referenced this issue Jan 26, 2023
#10585)

* [Code Formatting] Revert formatting on conflicting files

* [Fixes #10537] Improve rules creation using GeoFence batch - more improvements

* [#10574] Align code formatting with black

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit 36f414d)
afabiani pushed a commit that referenced this issue Jan 26, 2023
#10585) (#10588)

* [Code Formatting] Revert formatting on conflicting files

* [Fixes #10537] Improve rules creation using GeoFence batch - more improvements

* [#10574] Align code formatting with black

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit 36f414d)

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
ridoo pushed a commit to Thuenen-GeoNode-Development/geonode that referenced this issue Sep 18, 2023
…oNode#10538) (GeoNode#10567)

* [Fixes GeoNode#10537] Improve rules creation using GeoFence batch

* - code improvements accordingly to the PR comments

* - code improvements accordingly to the PR comments

* - Test fixes

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit d101ead)

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
ridoo pushed a commit to Thuenen-GeoNode-Development/geonode that referenced this issue Sep 18, 2023
…ore imp… (GeoNode#10585) (GeoNode#10588)

* [Code Formatting] Revert formatting on conflicting files

* [Fixes GeoNode#10537] Improve rules creation using GeoFence batch - more improvements

* [GeoNode#10574] Align code formatting with black

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit 36f414d)

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
ridoo pushed a commit to Thuenen-GeoNode-Development/geonode that referenced this issue Feb 22, 2024
…oNode#10538) (GeoNode#10567)

* [Fixes GeoNode#10537] Improve rules creation using GeoFence batch

* - code improvements accordingly to the PR comments

* - code improvements accordingly to the PR comments

* - Test fixes

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit d101ead)

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
ridoo pushed a commit to Thuenen-GeoNode-Development/geonode that referenced this issue Feb 22, 2024
…ore imp… (GeoNode#10585) (GeoNode#10588)

* [Code Formatting] Revert formatting on conflicting files

* [Fixes GeoNode#10537] Improve rules creation using GeoFence batch - more improvements

* [GeoNode#10574] Align code formatting with black

Co-authored-by: afabiani <alessio.fabiani@geosolutionsgroup.com>
(cherry picked from commit 36f414d)

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement master performance Issues regarding server Performance and Speed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant