-
Notifications
You must be signed in to change notification settings - Fork 322
#3171 Solved the problem of systematic data archiving #3173
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
Open
Patrykb0802
wants to merge
7
commits into
release/2.8.0
Choose a base branch
from
feature/#3171_Solved_the_problem_of_systematic_data_archiving
base: release/2.8.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6b40ab5
#3171 Solved the problem of systematic data archiving
Patrykb0802 ed6caea
#3171 Solved the problem of systematic data archiving
Patrykb0802 dc37796
#3171 Solved the problem of systematic data archiving
Patrykb0802 28dbf80
#3171 Solved the problem of systematic data archiving
Patrykb0802 520524d
#3171 Solved the problem of systematic data archiving
Patrykb0802 9d35f3d
#3171 Solved the problem of systematic data archiving
Patrykb0802 997c788
#3171 Solved the problem of systematic data archiving
Patrykb0802 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| <!-- | ||
| Scada-LTS | ||
| Data Archiving Help | ||
| @author PatrykB | ||
| --> | ||
| <h1>Overview</h1> | ||
| <p> | ||
| The Data Archiving module allows you to automatically copy and/or delete old data from selected database tables | ||
| to an external archival database. This helps reduce the size of the primary database while keeping historical data accessible. | ||
| </p> | ||
|
|
||
| <p> | ||
| Archiving is configured using flexible rules which define how old the data must be to be archived or deleted, which tables to process, | ||
| and what action to take (copy or delete). You can also define the destination archive database and how frequently the archiving process runs. | ||
| </p> | ||
|
|
||
| <p> | ||
| Option <b>Default values limit for purge</b> is related to property that can be set inside Point properties in Logging properties. | ||
| It indicates how many values will be left in database after purging data when purge strategy with <b>Values limit</b> is selected for a given datapoint. | ||
| This default value is used during datapoint creation. | ||
| </p> | ||
|
|
||
| <h2>Settings</h2> | ||
| <p>The configuration consists of the following options:</p> | ||
| <ul> | ||
| <li><b>Enable data archiving:</b> Activates or deactivates the archiving mechanism.</li> | ||
| <li><b>Archive database URL:</b> JDBC URL of the target archive database (e.g., <code>jdbc:mysql://localhost:3308/scadalts_archive</code>).</li> | ||
| <li><b>Archive database username:</b> Username for the archive database.</li> | ||
| <li><b>Archive database password:</b> Password for the archive database user.</li> | ||
| <li><b>Batch size:</b> Number of records processed in each step during archiving. Helps manage memory and performance.</li> | ||
| <li><b>Archive frequency (cron):</b> Cron expression that determines how often the archiving task is run (e.g., <code>0 0 1 * * ?</code> for daily at 1:00 AM).</li> | ||
| <li><b>Archiving Rules:</b> List of individual tasks that define what data should be archived or deleted.</li> | ||
| </ul> | ||
|
|
||
| <h2>Archiving Rules</h2> | ||
| <p>Each archiving rule specifies:</p> | ||
| <ul> | ||
| <li><b>Older than:</b> How old the data must be to qualify (e.g., 30 days).</li> | ||
| <li><b>Action:</b> Whether to <b>Archive</b> (copy to archive DB) or <b>Delete</b> (from main DB if already archived).</li> | ||
| <li><b>Table:</b> Which data table to apply the rule to (e.g., <code>pointValues</code>, <code>events</code>).</li> | ||
| </ul> | ||
|
|
||
| <h2>Usage Example</h2> | ||
| <p>Archive historical point values older than 30 days to a secondary MySQL database.</p> | ||
| <ol> | ||
| <li>Enable the "Enable data archiving" checkbox.</li> | ||
| <li>Set the Archive database URL to: <code>jdbc:mysql://localhost:3308/scadalts_archive</code></li> | ||
| <li>Set username and password for the archive database.</li> | ||
| <li>Set Batch size to <code>1000</code> (default).</li> | ||
| <li>Set Archive frequency to <code>0 0 1 * * ?</code> (every day at 1:00 AM).</li> | ||
| <li>In Archiving Rules, add a new rule:</li> | ||
| <ul> | ||
| <li><b>Older than:</b> 30 day(s)</li> | ||
| <li><b>Action:</b> Archive</li> | ||
| <li><b>Table:</b> pointValues</li> | ||
| </ul> | ||
| <li>Save configuration.</li> | ||
| <li>At 1:00 AM each day, Scada-LTS will move records from <code>pointValues</code> older than 30 days to the archive database.</li> | ||
| </ol> | ||
|
|
||
| <h2>Additional Notes</h2> | ||
| <ul> | ||
| <li>Ensure that the archive database has the same schema structure as the source tables.</li> | ||
| <li>The archiving engine will automatically copy table structure if the archive table doesn't exist.</li> | ||
| <li>Deleted data cannot be recovered unless previously archived.</li> | ||
| <li>It is recommended to regularly back up both your main and archive databases.</li> | ||
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| <!-- | ||
| Scada-LTS | ||
| Data Archiving Help | ||
| @author PatrykB | ||
| --> | ||
| <h1>Overview</h1> | ||
| <p> | ||
| The Data Archiving module allows you to automatically copy and/or delete old data from selected database tables | ||
| to an external archival database. This helps reduce the size of the primary database while keeping historical data accessible. | ||
| </p> | ||
|
|
||
| <p> | ||
| Archiving is configured using flexible rules which define how old the data must be to be archived or deleted, which tables to process, | ||
| and what action to take (copy or delete). You can also define the destination archive database and how frequently the archiving process runs. | ||
| </p> | ||
|
|
||
| <p> | ||
| Option <b>Default values limit for purge</b> is related to property that can be set inside Point properties in Logging properties. | ||
| It indicates how many values will be left in database after purging data when purge strategy with <b>Values limit</b> is selected for a given datapoint. | ||
| This default value is used during datapoint creation. | ||
| </p> | ||
|
|
||
| <h2>Settings</h2> | ||
| <p>The configuration consists of the following options:</p> | ||
| <ul> | ||
| <li><b>Enable data archiving:</b> Activates or deactivates the archiving mechanism.</li> | ||
| <li><b>Archive database URL:</b> JDBC URL of the target archive database (e.g., <code>jdbc:mysql://localhost:3308/scadalts_archive</code>).</li> | ||
| <li><b>Archive database username:</b> Username for the archive database.</li> | ||
| <li><b>Archive database password:</b> Password for the archive database user.</li> | ||
| <li><b>Batch size:</b> Number of records processed in each step during archiving. Helps manage memory and performance.</li> | ||
| <li><b>Archive frequency (cron):</b> Cron expression that determines how often the archiving task is run (e.g., <code>0 0 1 * * ?</code> for daily at 1:00 AM).</li> | ||
| <li><b>Archiving Rules:</b> List of individual tasks that define what data should be archived or deleted.</li> | ||
| </ul> | ||
|
|
||
| <h2>Archiving Rules</h2> | ||
| <p>Each archiving rule specifies:</p> | ||
| <ul> | ||
| <li><b>Older than:</b> How old the data must be to qualify (e.g., 30 days).</li> | ||
| <li><b>Action:</b> Whether to <b>Archive</b> (copy to archive DB) or <b>Delete</b> (from main DB if already archived).</li> | ||
| <li><b>Table:</b> Which data table to apply the rule to (e.g., <code>pointValues</code>, <code>events</code>).</li> | ||
| </ul> | ||
|
|
||
| <h2>Usage Example</h2> | ||
| <p>Archive historical point values older than 30 days to a secondary MySQL database.</p> | ||
| <ol> | ||
| <li>Enable the "Enable data archiving" checkbox.</li> | ||
| <li>Set the Archive database URL to: <code>jdbc:mysql://localhost:3308/scadalts_archive</code></li> | ||
| <li>Set username and password for the archive database.</li> | ||
| <li>Set Batch size to <code>1000</code> (default).</li> | ||
| <li>Set Archive frequency to <code>0 0 1 * * ?</code> (every day at 1:00 AM).</li> | ||
| <li>In Archiving Rules, add a new rule:</li> | ||
| <ul> | ||
| <li><b>Older than:</b> 30 day(s)</li> | ||
| <li><b>Action:</b> Archive</li> | ||
| <li><b>Table:</b> pointValues</li> | ||
| </ul> | ||
| <li>Save configuration.</li> | ||
| <li>At 1:00 AM each day, Scada-LTS will move records from <code>pointValues</code> older than 30 days to the archive database.</li> | ||
| </ol> | ||
|
|
||
| <h2>Additional Notes</h2> | ||
| <ul> | ||
| <li>Ensure that the archive database has the same schema structure as the source tables.</li> | ||
| <li>The archiving engine will automatically copy table structure if the archive table doesn't exist.</li> | ||
| <li>Deleted data cannot be recovered unless previously archived.</li> | ||
| <li>It is recommended to regularly back up both your main and archive databases.</li> | ||
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| <!-- | ||
| Scada-LTS | ||
| Data Archiving Help | ||
| @author PatrykB | ||
| --> | ||
| <h1>Overview</h1> | ||
| <p> | ||
| The Data Archiving module allows you to automatically copy and/or delete old data from selected database tables | ||
| to an external archival database. This helps reduce the size of the primary database while keeping historical data accessible. | ||
| </p> | ||
|
|
||
| <p> | ||
| Archiving is configured using flexible rules which define how old the data must be to be archived or deleted, which tables to process, | ||
| and what action to take (copy or delete). You can also define the destination archive database and how frequently the archiving process runs. | ||
| </p> | ||
|
|
||
| <p> | ||
| Option <b>Default values limit for purge</b> is related to property that can be set inside Point properties in Logging properties. | ||
| It indicates how many values will be left in database after purging data when purge strategy with <b>Values limit</b> is selected for a given datapoint. | ||
| This default value is used during datapoint creation. | ||
| </p> | ||
|
|
||
| <h2>Settings</h2> | ||
| <p>The configuration consists of the following options:</p> | ||
| <ul> | ||
| <li><b>Enable data archiving:</b> Activates or deactivates the archiving mechanism.</li> | ||
| <li><b>Archive database URL:</b> JDBC URL of the target archive database (e.g., <code>jdbc:mysql://localhost:3308/scadalts_archive</code>).</li> | ||
| <li><b>Archive database username:</b> Username for the archive database.</li> | ||
| <li><b>Archive database password:</b> Password for the archive database user.</li> | ||
| <li><b>Batch size:</b> Number of records processed in each step during archiving. Helps manage memory and performance.</li> | ||
| <li><b>Archive frequency (cron):</b> Cron expression that determines how often the archiving task is run (e.g., <code>0 0 1 * * ?</code> for daily at 1:00 AM).</li> | ||
| <li><b>Archiving Rules:</b> List of individual tasks that define what data should be archived or deleted.</li> | ||
| </ul> | ||
|
|
||
| <h2>Archiving Rules</h2> | ||
| <p>Each archiving rule specifies:</p> | ||
| <ul> | ||
| <li><b>Older than:</b> How old the data must be to qualify (e.g., 30 days).</li> | ||
| <li><b>Action:</b> Whether to <b>Archive</b> (copy to archive DB) or <b>Delete</b> (from main DB if already archived).</li> | ||
| <li><b>Table:</b> Which data table to apply the rule to (e.g., <code>pointValues</code>, <code>events</code>).</li> | ||
| </ul> | ||
|
|
||
| <h2>Usage Example</h2> | ||
| <p>Archive historical point values older than 30 days to a secondary MySQL database.</p> | ||
| <ol> | ||
| <li>Enable the "Enable data archiving" checkbox.</li> | ||
| <li>Set the Archive database URL to: <code>jdbc:mysql://localhost:3308/scadalts_archive</code></li> | ||
| <li>Set username and password for the archive database.</li> | ||
| <li>Set Batch size to <code>1000</code> (default).</li> | ||
| <li>Set Archive frequency to <code>0 0 1 * * ?</code> (every day at 1:00 AM).</li> | ||
| <li>In Archiving Rules, add a new rule:</li> | ||
| <ul> | ||
| <li><b>Older than:</b> 30 day(s)</li> | ||
| <li><b>Action:</b> Archive</li> | ||
| <li><b>Table:</b> pointValues</li> | ||
| </ul> | ||
| <li>Save configuration.</li> | ||
| <li>At 1:00 AM each day, Scada-LTS will move records from <code>pointValues</code> older than 30 days to the archive database.</li> | ||
| </ol> | ||
|
|
||
| <h2>Additional Notes</h2> | ||
| <ul> | ||
| <li>Ensure that the archive database has the same schema structure as the source tables.</li> | ||
| <li>The archiving engine will automatically copy table structure if the archive table doesn't exist.</li> | ||
| <li>Deleted data cannot be recovered unless previously archived.</li> | ||
| <li>It is recommended to regularly back up both your main and archive databases.</li> | ||
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| <!-- | ||
| Scada-LTS | ||
| Data Archiving Help | ||
| @author PatrykB | ||
| --> | ||
| <h1>Overview</h1> | ||
| <p> | ||
| The Data Archiving module allows you to automatically copy and/or delete old data from selected database tables | ||
| to an external archival database. This helps reduce the size of the primary database while keeping historical data accessible. | ||
| </p> | ||
|
|
||
| <p> | ||
| Archiving is configured using flexible rules which define how old the data must be to be archived or deleted, which tables to process, | ||
| and what action to take (copy or delete). You can also define the destination archive database and how frequently the archiving process runs. | ||
| </p> | ||
|
|
||
| <p> | ||
| Option <b>Default values limit for purge</b> is related to property that can be set inside Point properties in Logging properties. | ||
| It indicates how many values will be left in database after purging data when purge strategy with <b>Values limit</b> is selected for a given datapoint. | ||
| This default value is used during datapoint creation. | ||
| </p> | ||
|
|
||
| <h2>Settings</h2> | ||
| <p>The configuration consists of the following options:</p> | ||
| <ul> | ||
| <li><b>Enable data archiving:</b> Activates or deactivates the archiving mechanism.</li> | ||
| <li><b>Archive database URL:</b> JDBC URL of the target archive database (e.g., <code>jdbc:mysql://localhost:3308/scadalts_archive</code>).</li> | ||
| <li><b>Archive database username:</b> Username for the archive database.</li> | ||
| <li><b>Archive database password:</b> Password for the archive database user.</li> | ||
| <li><b>Batch size:</b> Number of records processed in each step during archiving. Helps manage memory and performance.</li> | ||
| <li><b>Archive frequency (cron):</b> Cron expression that determines how often the archiving task is run (e.g., <code>0 0 1 * * ?</code> for daily at 1:00 AM).</li> | ||
| <li><b>Archiving Rules:</b> List of individual tasks that define what data should be archived or deleted.</li> | ||
| </ul> | ||
|
|
||
| <h2>Archiving Rules</h2> | ||
| <p>Each archiving rule specifies:</p> | ||
| <ul> | ||
| <li><b>Older than:</b> How old the data must be to qualify (e.g., 30 days).</li> | ||
| <li><b>Action:</b> Whether to <b>Archive</b> (copy to archive DB) or <b>Delete</b> (from main DB if already archived).</li> | ||
| <li><b>Table:</b> Which data table to apply the rule to (e.g., <code>pointValues</code>, <code>events</code>).</li> | ||
| </ul> | ||
|
|
||
| <h2>Usage Example</h2> | ||
| <p>Archive historical point values older than 30 days to a secondary MySQL database.</p> | ||
| <ol> | ||
| <li>Enable the "Enable data archiving" checkbox.</li> | ||
| <li>Set the Archive database URL to: <code>jdbc:mysql://localhost:3308/scadalts_archive</code></li> | ||
| <li>Set username and password for the archive database.</li> | ||
| <li>Set Batch size to <code>1000</code> (default).</li> | ||
| <li>Set Archive frequency to <code>0 0 1 * * ?</code> (every day at 1:00 AM).</li> | ||
| <li>In Archiving Rules, add a new rule:</li> | ||
| <ul> | ||
| <li><b>Older than:</b> 30 day(s)</li> | ||
| <li><b>Action:</b> Archive</li> | ||
| <li><b>Table:</b> pointValues</li> | ||
| </ul> | ||
| <li>Save configuration.</li> | ||
| <li>At 1:00 AM each day, Scada-LTS will move records from <code>pointValues</code> older than 30 days to the archive database.</li> | ||
| </ol> | ||
|
|
||
| <h2>Additional Notes</h2> | ||
| <ul> | ||
| <li>Ensure that the archive database has the same schema structure as the source tables.</li> | ||
| <li>The archiving engine will automatically copy table structure if the archive table doesn't exist.</li> | ||
| <li>Deleted data cannot be recovered unless previously archived.</li> | ||
| <li>It is recommended to regularly back up both your main and archive databases.</li> | ||
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spring wiring likely injects a provider that ArchiveService doesn’t use.
archiveServiceis constructed witharchiveQueryProvider, butArchiveService.runArchive()currently creates a provider viaArchiveQueryProviderFactory.forTarget(...)instead. Either:🤖 Prompt for AI Agents