Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-3225

Implement cluster-safe cache on top of PreferencesService in KEW

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.1, KFS Release 3.0
    • Component/s: Development
    • Labels:
      None
    • Similar issues:
      KULRICE-7258Implement caching on ExtensionRepositoryService
      KULRICE-5715Implement caching of legacy KEW rules on the RuleService by "doc type + rule template"
      KULRICE-5208Implement KEW caching services as SOAP and allow for them to be easily exported to the Bus that way
      KULRICE-2315Implement caching of data to the IdentityManagementService implementation
      KULRICE-3006Implement Parameter caching in the ParameterProxyService
      KULRICE-8327Implement caching for Message Service
      KULRICE-3007Implement caching in the RiceApplicationConfigurationMediationServiceImpl
      KULRICE-2452Implement cluster-aware caching on KNS System Parameters
      KULRICE-5319Implement caching on remote soap services
      KULRICE-2385Implement caching on the IdentityManagementService - Phase 2
    • Application Requirement:
      KFS

      Description

      This may or may not need to happen for 1.0 depending on whether we decide this is a significant performance issue in our load testing.

        Issue Links

          Activity

          Hide
          Eric Westfall added a comment -

          See the linked KFSMI-3817 issue for more details on this. I've assigned to Peter since he is working on performance and load testing but I've also included Jeremy on this since he's done some work implementing cluster-safe caches in Rice.

          Show
          Eric Westfall added a comment - See the linked KFSMI-3817 issue for more details on this. I've assigned to Peter since he is working on performance and load testing but I've also included Jeremy on this since he's done some work implementing cluster-safe caches in Rice.
          Hide
          Peter Giles (Inactive) added a comment -

          KEWSpringBeans.xml:

          • Added spring configuration to wrap the PreferencesService with a CachingInterceptor
          Show
          Peter Giles (Inactive) added a comment - KEWSpringBeans.xml: Added spring configuration to wrap the PreferencesService with a CachingInterceptor
          Hide
          Peter Giles (Inactive) added a comment -

          more work to do here, since things can be changed out from under us by UserOptionsService

          Show
          Peter Giles (Inactive) added a comment - more work to do here, since things can be changed out from under us by UserOptionsService
          Hide
          Jeremy Hanson added a comment -

          When you take care of this, could you make sure that the PreferencesServiceTest.testPreferencesDefaultSave() test passes? It is currently failing with an assertion error:

          java.lang.AssertionError: Preferences should now require a save again.
          at org.junit.Assert.fail(Assert.java:74)
          at org.junit.Assert.assertTrue(Assert.java:37)
          at org.kuali.rice.kew.preferences.PreferencesServiceTest.testPreferencesDefaultSave(PreferencesServiceTest.java:77)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
          at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
          at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
          at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
          at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
          at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
          at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
          at org.kuali.rice.test.runners.RiceUnitTestClassRunner.invokeTestMethod(RiceUnitTestClassRunner.java:44)
          at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
          at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
          at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
          at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
          at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

          Show
          Jeremy Hanson added a comment - When you take care of this, could you make sure that the PreferencesServiceTest.testPreferencesDefaultSave() test passes? It is currently failing with an assertion error: java.lang.AssertionError: Preferences should now require a save again. at org.junit.Assert.fail(Assert.java:74) at org.junit.Assert.assertTrue(Assert.java:37) at org.kuali.rice.kew.preferences.PreferencesServiceTest.testPreferencesDefaultSave(PreferencesServiceTest.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.kuali.rice.test.runners.RiceUnitTestClassRunner.invokeTestMethod(RiceUnitTestClassRunner.java:44) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
          Hide
          Peter Giles (Inactive) added a comment -

          Yeah, I saw that. It's due to the issue I called out above. I'll make sure it passes before I close this issue.

          Show
          Peter Giles (Inactive) added a comment - Yeah, I saw that. It's due to the issue I called out above. I'll make sure it passes before I close this issue.
          Hide
          Peter Giles (Inactive) added a comment -

          Changed to a more specific approach in order to attempt to improve cache performance. Also corrected the issue that was breaking PreferencesServiceTest.

          UserOptionsDAO.java:
          UserOptionsDAOOjbImpl.java:
          UserOptionsDAOJpaImpl.java:

          • Added public void save(Collection<UserOptions> userOptions) to allow multiple UserOptions to be saved in a single transaction

          UserOptionsService.java:

          • added public void save(String principalId, Map<String,String> optionsMap) to allow multiple UserOptions to be saved in one call. This will cut down on cluster cache chatter from repeated calls in PreferencesServiceImpl.

          UserOptionsServiceImpl.java:

          • added implementation for new interface method above.

          UserOptionsServiceCache.java: (added)

          • decorator to UserOptionsService caches calls to findByOptionId and clears cache entries intelligently on update/delete type calls.

          CachingInterceptor.java:

          • fixed bug in cache key generation

          KEWSpringBeans.xml:

          • changed configuration to use UserOptionsServiceCache as enUserOptionsService bean
          Show
          Peter Giles (Inactive) added a comment - Changed to a more specific approach in order to attempt to improve cache performance. Also corrected the issue that was breaking PreferencesServiceTest. UserOptionsDAO.java: UserOptionsDAOOjbImpl.java: UserOptionsDAOJpaImpl.java: Added public void save(Collection<UserOptions> userOptions) to allow multiple UserOptions to be saved in a single transaction UserOptionsService.java: added public void save(String principalId, Map<String,String> optionsMap) to allow multiple UserOptions to be saved in one call. This will cut down on cluster cache chatter from repeated calls in PreferencesServiceImpl. UserOptionsServiceImpl.java: added implementation for new interface method above. UserOptionsServiceCache.java: (added) decorator to UserOptionsService caches calls to findByOptionId and clears cache entries intelligently on update/delete type calls. CachingInterceptor.java: fixed bug in cache key generation KEWSpringBeans.xml: changed configuration to use UserOptionsServiceCache as enUserOptionsService bean

            People

            • Assignee:
              Peter Giles (Inactive)
              Reporter:
              Jerry Neal (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Structure Helper Panel