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

optimize temporary and permanent limits db writings and db reading #82

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

EtienneLt
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
@EtienneLt EtienneLt self-assigned this Nov 21, 2024
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
@jonenst jonenst changed the title optimize temporary limits db writings and db reading optimize temporary and permanent limits db writings and db reading Nov 29, 2024
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
<customChange class="com.powsybl.network.store.server.migrations.PermanentLimitsMigration"/>
<customChange class="com.powsybl.network.store.server.migrations.TemporaryLimitsMigration"/>
<renameTable oldTableName="newpermanentlimits"
newTableName="permanentlimits"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Before this, drop permanentlimit table.

And rename to permanentlimit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I rename to permanentlimits and it was permanentlimit before do you agree ? same for temporarylimits

Copy link
Contributor

Choose a reason for hiding this comment

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

We can keep permanentlimit I think. All table names use the singular

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed with Etienne L: we keep the plurial as one row of permanentLimits contains several permanent limits

<renameTable oldTableName="newpermanentlimits"
newTableName="permanentlimits"/>
<renameTable oldTableName="newtemporarylimits"
newTableName="temporarylimits"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Copy link

sonarcloud bot commented Dec 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
76.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@@ -0,0 +1,22 @@
-- will be used in next deployment
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of doing the liquibase migration by doing a java change that just calls the same method as the one used for users

static final String SELECTED_OPERATIONAL_LIMITS_GROUP_ID_COLUMN = "selectedOperationalLimitsGroupId";
static final String TEMPORARY_LIMITS_TABLE = "newtemporarylimits";
static final String TEMPORARY_LIMITS = "temporarylimits";
static final String OLD_TEMPORARY_LIMITS = "temporarylimit";
Copy link
Contributor

Choose a reason for hiding this comment

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

need to find a better name than old because this code is going to stay if it goes in the liquibase changeset. Maybe "V211LimitMigration"

return "delete from temporarylimit where " +
NETWORK_UUID_COLUMN + " = ? and " +
VARIANT_NUM_COLUMN + " = ?";
public static String buildOldTemporaryLimitWithInClauseQuery(String columnNameForInClause, int numberOfValues) {
Copy link
Contributor

Choose a reason for hiding this comment

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

move to the folder of the liquibase migrations

@jonenst
Copy link
Contributor

jonenst commented Dec 13, 2024

Do we need an extra management endpoint to externally migrate the data or is it enough to call the regular GET endpoint? probably the get is enough

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.

3 participants