-
Notifications
You must be signed in to change notification settings - Fork 31
Fix init of affected-by reverse map, and add checks/error message if it's empty #1488
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6a7bc11
Fix affected-by reversemap initialization in lifecycle startup
jdcasey df12b21
Add logging to note when the affected-by cache is altered, and anothe…
jdcasey 7b6d08d
Refactor InfinispanStoreDataManager.init() to startup actions, add so…
jdcasey 869e9a6
adding another ftest that initializes store data at boot instead of a…
jdcasey 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -511,4 +511,5 @@ protected Set<Group> affectedByFromStores( final Collection<StoreKey> keys ) | |
|
|
||
| return groups; | ||
| } | ||
|
|
||
| } | ||
37 changes: 37 additions & 0 deletions
37
...in/java/org/commonjava/indy/infinispan/data/InfinispanStoreDataByPkgMapStartupAction.java
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,37 @@ | ||
| package org.commonjava.indy.infinispan.data; | ||
|
|
||
| import org.commonjava.indy.action.IndyLifecycleException; | ||
| import org.commonjava.indy.action.StartupAction; | ||
| import org.commonjava.indy.data.StoreDataManager; | ||
|
|
||
| import javax.inject.Inject; | ||
|
|
||
| public class InfinispanStoreDataByPkgMapStartupAction | ||
| implements StartupAction | ||
| { | ||
|
|
||
| @Inject | ||
| private StoreDataManager storeDataManager; | ||
|
|
||
| @Override | ||
| public void start() | ||
| throws IndyLifecycleException | ||
| { | ||
| if ( storeDataManager instanceof InfinispanStoreDataManager ) | ||
| { | ||
| ((InfinispanStoreDataManager)storeDataManager).initByPkgMap(); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public int getStartupPriority() | ||
| { | ||
| return 11; | ||
| } | ||
|
|
||
| @Override | ||
| public String getId() | ||
| { | ||
| return "Infinispan by-pkg map initializer"; | ||
| } | ||
| } |
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
38 changes: 38 additions & 0 deletions
38
.../java/org/commonjava/indy/infinispan/data/InfinispanStoreDataReverseMapStartupAction.java
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,38 @@ | ||
| package org.commonjava.indy.infinispan.data; | ||
|
|
||
| import org.commonjava.indy.action.IndyLifecycleException; | ||
| import org.commonjava.indy.action.StartupAction; | ||
| import org.commonjava.indy.data.IndyDataException; | ||
| import org.commonjava.indy.data.StoreDataManager; | ||
|
|
||
| import javax.enterprise.context.ApplicationScoped; | ||
| import javax.inject.Inject; | ||
|
|
||
| @ApplicationScoped | ||
| public class InfinispanStoreDataReverseMapStartupAction | ||
| implements StartupAction | ||
| { | ||
| @Inject | ||
| private StoreDataManager storeDataManager; | ||
|
|
||
| @Override | ||
| public void start() | ||
| { | ||
| if ( storeDataManager instanceof InfinispanStoreDataManager ) | ||
| { | ||
| ( (InfinispanStoreDataManager) storeDataManager ).initAffectedBy(); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public int getStartupPriority() | ||
| { | ||
| return 10; | ||
| } | ||
|
|
||
| @Override | ||
| public String getId() | ||
| { | ||
| return "Infinispan affected-by reverse-map initializer"; | ||
| } | ||
| } | ||
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.
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.
One concern for this startup action: will this be conflict with InfinispanStoreDataManager.init()? I think the init() also did some initialization on the reverse-map.
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.
So, this is a great point. It probably indicates that we found a different bug with the new functional test, when we used the migration action as a data-loading mechanism. I've moved both by-pkg and affected-by out to startup actions, so they'll work with migrated data as well as stuff we already have stored.
I'm going to work on a different test setup that doesn't use the migration action to load the initial repo definitions, and see if I can get it to break.