Skip to content

Feature/242 refactor datamanager architecture#256

Merged
abdessamad-abdoun merged 8 commits into
feature/corese-nextfrom
feature/242-refactor-datamanager-architecture
Jan 28, 2026
Merged

Feature/242 refactor datamanager architecture#256
abdessamad-abdoun merged 8 commits into
feature/corese-nextfrom
feature/242-refactor-datamanager-architecture

Conversation

@abdessamad-abdoun
Copy link
Copy Markdown
Contributor

No description provided.

@abdessamad-abdoun abdessamad-abdoun added this to the V5.0.0b milestone Jan 14, 2026
@abdessamad-abdoun abdessamad-abdoun self-assigned this Jan 14, 2026
@abdessamad-abdoun abdessamad-abdoun added the Refactoring Issue created during the 2025 refactoring effort label Jan 14, 2026
@github-actions
Copy link
Copy Markdown

Overall Project 50.28% -0.66% 🍏
Files changed 48.32%

File Coverage
MetadataOperations.java 100% 🍏
DataManagerLifecycle.java 100% 🍏
LifecycleState.java 94.64% -5.36% 🍏
IsolationLevel.java 92.86% -7.14% 🍏
DataManagerConfig.java 83.61% -16.39% 🍏
CoreseGraphDataManager.java 81.32% -10.99% 🍏
MutationOperations.java 78.13% -21.88% 🍏
MetadataOperationsImpl.java 73.76% -26.24% 🍏
LifecycleManagerImpl.java 70.3% -29.7% 🍏
GraphStatistics.java 67.46% -32.54% 🍏
MutationOperationsImpl.java 61.79% -38.21% 🍏
EdgePattern.java 57.97% -42.03%
MutationResult.java 56.4% -43.6%
QueryOperationsImpl.java 54.88% -45.12%
CoreseGraphDataManagerBuilder.java 45.71% -14.29%
BulkOperationsImpl.java 37.4% -62.6%
TransactionManagerImpl.java 14.22% -85.78%
DataManagerRead.java 0% -20.45%
DataManagerUpdate.java 0% -10.96%
DataManager.java 0% 🍏
DataManagerJava.java 0% -28.41%
QueryOperations.java 0%
DataManagerException.java 0%
ErrorCode.java 0%
TransactionImpl.java 0%
TransactionState.java 0%
TransactionManager.java 0%

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 14, 2026

Test Results

1 088 tests  +86   1 088 ✅ +86   35s ⏱️ -4s
   78 suites + 6       0 💤 ± 0 
   78 files   + 6       0 ❌ ± 0 

Results for commit c1e5458. ± Comparison against base commit d907bba.

♻️ This comment has been updated with latest results.

@MaillPierre MaillPierre linked an issue Jan 21, 2026 that may be closed by this pull request
@@ -0,0 +1,64 @@
package fr.inria.corese.core.storage.api.dataManager.lifecycle;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Le package fr.inria.corese.core.storage.api.dataManager.lifecycle utilise une majuscule (dataManager). Pour respecter les conventions Java il est préférable d'utiliser uniquement des minuscules

* @param config New configuration
* @throws DataManagerException if restart fails
*/
default void restart(DataManagerConfig config) throws DataManagerException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Atomicité de restart() : La méthode par défaut enchaîne un shutdown() puis un initialize(). Si l'initialisation échoue, le composant reste arrêté et l'état précédent est perdu. Il serait plus robuste d'ajouter un bloc try-catch pour tenter de restaurer l'ancienne configuration en cas d'échec, ou au moins de documenter explicitement ce risque.

void shutdown() throws DataManagerException;

/**
* Restarts the DataManager with a new configuration.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

La Javadoc de restart(config) devrait mentionner qu'elle lance une IllegalArgumentException si la config est null, par souci de cohérence avec initialize(config)

*
* @return true if initialized (RUNNING state), false otherwise
*/
boolean isInitialized();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On a isInitialized() ici et isUsable() dans LifecycleState. Pour éviter les incohérences futures, isInitialized() devrait simplement déléguer à getState().isUsable().

*
* @return true if usable (RUNNING)
*/
public boolean isUsable() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Le nom isUsable() est bien, mais comme l'état s'appelle RUNNING, une méthode isRunning() serait peut-être plus intuitive

public static final class Builder {
private final Map<String, Object> properties = new HashMap<>();
private boolean transactionSupport = false;
private String storagePath = "http://ns.inria.fr/corese/dataset";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

La valeur codée en dur (http://ns.inria.fr/corese/dataset) est très spécifique et arbitraire.

* @throws DataManagerException if operation fails
* @throws IllegalArgumentException if context is null
*/
MutationResult declareContext(Node context) throws DataManagerException;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Toutes les méthodes de cette interface concernent des opérations de masse ou structurelles, mais declareContext ne porte que sur un seul Node. Est-ce qu'une version declareContexts(List) ne serait pas plus cohérente avec le nom de l'interface BulkOperations ?

* @return This builder (for chaining)
*/
public Builder storagePath(String path) {
if (path != null && !path.isEmpty()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remplacer les vérifications silencieuses (if != null) par des IllegalArgumentException pour les méthodes property() et storagePath().

@abdessamad-abdoun abdessamad-abdoun force-pushed the feature/242-refactor-datamanager-architecture branch from d58eb66 to 4c63d3d Compare January 27, 2026 13:22
@github-actions
Copy link
Copy Markdown

Overall Project 50.37% -0.71% 🍏
Files changed 46.37%

File Coverage
MetadataOperations.java 100% 🍏
LifecycleState.java 94.64% -5.36% 🍏
IsolationLevel.java 92.86% -7.14% 🍏
CoreseJsonTripleCallback.java 85.62% 🍏
MutationOperations.java 78.13% -21.88% 🍏
CoreseGraphDataManager.java 78.02% -14.29% 🍏
DataBrokerLocal.java 75.86% 🍏
MetadataOperationsImpl.java 73.76% -26.24% 🍏
DataManagerConfig.java 73.68% -26.32% 🍏
LifecycleManagerImpl.java 71.78% -28.22% 🍏
RuleEngine.java 71.39% 🍏
Distance.java 70.86% 🍏
CoreseRDFaTripleSink.java 70.71% 🍏
GraphStatistics.java 67.46% -32.54% 🍏
Transformer.java 63.39% 🍏
Cleaner.java 61.82% 🍏
MutationOperationsImpl.java 61.79% -38.21% 🍏
ProducerImpl.java 60.87% 🍏
TripleCreatorBase.java 58.47% 🍏
EdgePattern.java 57.97% -42.03%
MutationResult.java 56.4% -43.6%
Load.java 56.31% 🍏
QueryOperationsImpl.java 54.88% -45.12%
QueryProcess.java 52.19% 🍏
CoreseGraphDataManagerBuilder.java 45.71% -14.29%
PluginImpl.java 33.14% 🍏
BulkOperationsImpl.java 32.18% -67.82%
DataManagerLifecycle.java 30.61% -69.39%
TransactionManagerImpl.java 14.22% -85.78%
DatasetManager.java 0% 🍏
ProviderService.java 0% 🍏
StorageFactory.java 0% 🍏
Data.java 0% 🍏
MetadataManager.java 0% 🍏
DataBrokerConstructExtern.java 0% 🍏
DataBrokerExtern.java 0% 🍏
DataManagerJava.java 0% -28.41%
Shacl.java 0% 🍏
DataBroker.java 0% 🍏
QueryOperations.java 0%
TransactionManager.java 0%
TransactionState.java 0%
ErrorCode.java 0%
DataManagerException.java 0%
TransactionImpl.java 0%
BrokerDistanceDataManager.java 0% 🍏
ClosureDataManager.java 0% 🍏
DataManager.java 0% 🍏
DataManagerUpdate.java 0% -10.96%
DataManagerRead.java 0% -20.45%
AddTripleHelperDataManager.java 0% 🍏

* @return this builder instance
* @throws IllegalArgumentException if path is null, empty, or blank
*/
public Builder storagePath(String path) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't get why this is a required parameter ?
What if the datamanager is in-memory ? Is there a storage path ?

*
* @return true if predicate is specified
*/
public boolean isPredicate() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For this function and all the similar one: "isPredicate" -> "hasPredicate"

*/
public class GraphStatistics {

private final long edgeCount;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Count attributes should not be final, as they will increase or decrease with each modification to the models.

/**
* Builder for GraphStatistics.
*/
public static class Builder {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Following comment on R10, not sure if this class is suitable for the builder pattern

@abdessamad-abdoun abdessamad-abdoun force-pushed the feature/242-refactor-datamanager-architecture branch from 6b39e92 to c1e5458 Compare January 28, 2026 13:15
@github-actions
Copy link
Copy Markdown

Overall Project 50.37% -0.78% 🍏
Files changed 42.84%

File Coverage
MetadataOperations.java 100% 🍏
LifecycleState.java 94.64% -5.36% 🍏
IsolationLevel.java 92.86% -7.14% 🍏
CoreseJsonTripleCallback.java 85.62% 🍏
MutationOperations.java 78.13% -21.88% 🍏
CoreseGraphDataManager.java 78.02% -14.29% 🍏
DataBrokerLocal.java 75.86% 🍏
MetadataOperationsImpl.java 73.76% -26.24% 🍏
DataManagerConfig.java 73.45% -26.55% 🍏
RuleEngine.java 71.39% 🍏
LifecycleManagerImpl.java 71.07% -28.93% 🍏
Distance.java 70.86% 🍏
CoreseRDFaTripleSink.java 70.71% 🍏
Transformer.java 63.39% 🍏
Cleaner.java 61.82% 🍏
MutationOperationsImpl.java 61.79% -38.21% 🍏
ProducerImpl.java 60.87% 🍏
TripleCreatorBase.java 58.47% 🍏
EdgePattern.java 57.97% -42.03%
MutationResult.java 56.4% -43.6%
Load.java 56.31% 🍏
QueryOperationsImpl.java 54.88% -45.12%
QueryProcess.java 52.19% 🍏
CoreseGraphDataManagerBuilder.java 45.71% -14.29%
PluginImpl.java 33.14% 🍏
GraphStatistics.java 33.07% -66.93%
BulkOperationsImpl.java 32.18% -67.82%
DataManagerLifecycle.java 30.61% -69.39%
TransactionManagerImpl.java 14.22% -85.78%
DatasetManager.java 0% 🍏
ProviderService.java 0% 🍏
StorageFactory.java 0% 🍏
Data.java 0% 🍏
MetadataManager.java 0% 🍏
DataBrokerConstructExtern.java 0% 🍏
DataBrokerExtern.java 0% 🍏
DataManagerJava.java 0% -28.41%
Shacl.java 0% 🍏
DataBroker.java 0% 🍏
QueryOperations.java 0%
TransactionManager.java 0%
TransactionState.java 0%
ErrorCode.java 0%
DataManagerException.java 0%
TransactionImpl.java 0%
BrokerDistanceDataManager.java 0% 🍏
ClosureDataManager.java 0% 🍏
DataManager.java 0% 🍏
DataManagerUpdate.java 0% -10.96%
DataManagerRead.java 0% -20.45%
AddTripleHelperDataManager.java 0% 🍏

@github-actions
Copy link
Copy Markdown

Overall Project 50.37% -0.78% 🍏
Files changed 42.84%

File Coverage
MetadataOperations.java 100% 🍏
LifecycleState.java 94.64% -5.36% 🍏
IsolationLevel.java 92.86% -7.14% 🍏
CoreseJsonTripleCallback.java 85.62% 🍏
MutationOperations.java 78.13% -21.88% 🍏
CoreseGraphDataManager.java 78.02% -14.29% 🍏
DataBrokerLocal.java 75.86% 🍏
MetadataOperationsImpl.java 73.76% -26.24% 🍏
DataManagerConfig.java 73.45% -26.55% 🍏
RuleEngine.java 71.39% 🍏
LifecycleManagerImpl.java 71.07% -28.93% 🍏
Distance.java 70.86% 🍏
CoreseRDFaTripleSink.java 70.71% 🍏
Transformer.java 63.39% 🍏
Cleaner.java 61.82% 🍏
MutationOperationsImpl.java 61.79% -38.21% 🍏
ProducerImpl.java 60.87% 🍏
TripleCreatorBase.java 58.47% 🍏
EdgePattern.java 57.97% -42.03%
MutationResult.java 56.4% -43.6%
Load.java 56.31% 🍏
QueryOperationsImpl.java 54.88% -45.12%
QueryProcess.java 52.19% 🍏
CoreseGraphDataManagerBuilder.java 45.71% -14.29%
PluginImpl.java 33.14% 🍏
GraphStatistics.java 33.07% -66.93%
BulkOperationsImpl.java 32.18% -67.82%
DataManagerLifecycle.java 30.61% -69.39%
TransactionManagerImpl.java 14.22% -85.78%
DatasetManager.java 0% 🍏
ProviderService.java 0% 🍏
StorageFactory.java 0% 🍏
Data.java 0% 🍏
MetadataManager.java 0% 🍏
DataBrokerConstructExtern.java 0% 🍏
DataBrokerExtern.java 0% 🍏
DataManagerJava.java 0% -28.41%
Shacl.java 0% 🍏
DataBroker.java 0% 🍏
QueryOperations.java 0%
TransactionManager.java 0%
TransactionState.java 0%
ErrorCode.java 0%
DataManagerException.java 0%
TransactionImpl.java 0%
BrokerDistanceDataManager.java 0% 🍏
ClosureDataManager.java 0% 🍏
DataManager.java 0% 🍏
DataManagerUpdate.java 0% -10.96%
DataManagerRead.java 0% -20.45%
AddTripleHelperDataManager.java 0% 🍏

@abdessamad-abdoun abdessamad-abdoun merged commit f4b18cb into feature/corese-next Jan 28, 2026
2 checks passed
@abdessamad-abdoun abdessamad-abdoun deleted the feature/242-refactor-datamanager-architecture branch February 3, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactoring Issue created during the 2025 refactoring effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor DataManager architecture

3 participants