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

Rename continuous aggregate policy API (+restructure) #2368

Merged
merged 2 commits into from Sep 11, 2020

Conversation

erimatnor
Copy link
Contributor

@erimatnor erimatnor commented Sep 11, 2020

This PR contains two commits:

The first change simplifies the name of the functions for adding and
removing a continuous aggregate policy. The functions are renamed from:

  • add_refresh_continuous_aggregate_policy
  • remove_refresh_continuous_aggregate_policy

to

  • add_continuous_aggregate_policy
  • remove_continuous_aggregate_policy

The second change restructures the SQL API for policies and jobs.

The SQL definitions for policy and job APIs are moved to their
separate files to improve code structure. Previously, all of these
user-visible API functions were located in the bgw_scheduler.sql
file, mixing internal and public functions and APIs.

To improved the structure, all API-related functions are now located
in their own distinct SQL files that have the _api.sql file
ending. Internal policy functions have been moved to
policy_internal.sql.

Fixes #2320

@codecov
Copy link

codecov bot commented Sep 11, 2020

Codecov Report

Merging #2368 into master will decrease coverage by 0.04%.
The diff coverage is 97.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2368      +/-   ##
==========================================
- Coverage   90.38%   90.33%   -0.05%     
==========================================
  Files         213      213              
  Lines       34825    34900      +75     
==========================================
+ Hits        31476    31528      +52     
- Misses       3349     3372      +23     
Impacted Files Coverage Δ
src/chunk.h 100.00% <ø> (ø)
src/cross_module_fn.c 56.81% <0.00%> (ø)
tsl/src/init.c 88.88% <ø> (ø)
src/hypertable.c 88.55% <86.36%> (-0.07%) ⬇️
src/tablespace.c 95.80% <97.43%> (+0.15%) ⬆️
src/chunk.c 95.32% <100.00%> (-0.07%) ⬇️
src/continuous_agg.c 93.18% <100.00%> (-0.01%) ⬇️
src/process_utility.c 93.83% <100.00%> (+0.04%) ⬆️
src/time_utils.c 98.07% <100.00%> (+0.03%) ⬆️
tsl/src/bgw_policy/job.c 92.35% <100.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9565cbd...3d4e442. Read the comment docs.

@erimatnor erimatnor marked this pull request as ready for review September 11, 2020 08:48
@erimatnor erimatnor requested a review from a team as a code owner September 11, 2020 08:48
@erimatnor erimatnor requested review from pmwkaa, mkindahl, gayyappan, svenklemm, k-rus and a team and removed request for a team and gayyappan September 11, 2020 08:48
Copy link
Member

@svenklemm svenklemm left a comment

Choose a reason for hiding this comment

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

Lots tab->space changes in the diff, would be good if we could prevent that by enforcing that style in CI

@erimatnor
Copy link
Contributor Author

erimatnor commented Sep 11, 2020

Lots tab->space changes in the diff, would be good if we could prevent that by enforcing that style in CI

I agree, this mostly applies to SQL code though and we've talked about enforcing a standard formatter. Let's do that. In the meantime, I'll try to clean things up for this commit.

This change simplifies the name of the functions for adding and
removing a continuous aggregate policy. The functions are renamed
from:

- `add_refresh_continuous_aggregate_policy`
- `remove_refresh_continuous_aggregate_policy`

to

- `add_continuous_aggregate_policy`
- `remove_continuous_aggregate_policy`

Fixes timescale#2320
This moves the SQL definitions for policy and job APIs to their
separate files to improve code structure. Previously, all of these
user-visible API functions were located in the `bgw_scheduler.sql`
file, mixing internal and public functions and APIs.

To improved the structure, all API-related functions are now located
in their own distinct SQL files that have the `_api.sql` file
ending. Internal policy functions have been moved to
`policy_internal.sql`.
@erimatnor erimatnor merged commit 1bf4580 into timescale:master Sep 11, 2020
@erimatnor erimatnor deleted the rename-cagg-policy branch September 11, 2020 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename continuous aggregate policy API
3 participants