GeoTools
  1. GeoTools
  2. GEOT-1286

Add Concurrency Support to CRS Authority

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.4-M0, 2.5-M1
    • Fix Version/s: 2.5.9
    • Component/s: referencing
    • Labels:
      None

      Description

      Please see http://docs.codehaus.org/display/GEOTOOLS/Improve+CRSAuthority+Concurrency+Caching+and+Connection+Use for the design under discussion.

      In a high-volume environment, geotools does not perform well. This request is to improve the CRS Authority Factories so we can attack them with many many concurrent users and live to tell the tale. We also need to ensure that desktop and scientific applications do not suffer a significant performance hit as a result of this change. The current implementation has a caching technique, and this must be maintained and shown to work as well.

      For the sake of discussion we will look at a concrete example, FactoryOnOracleSQL/FactoryUsingOracleSQL (located in /unsupported/epsg-oracle and /library/referencing).

      Allowing Multiple Users
      1. Use an ObjectPool of workers (ie FactoryUsingOracleSQL)
      2. Make FactoryUsingOracleSQL Threadsafe
      3. Use Fire and Forget Worker Factory

      Cache Handling:
      4. Minimalize Connection Use Time
      5. Hack Cache to Package Visibility
      6. Worker Factory per Thread
      7. Isolate Cache into a Separate Object and Inject
      8. Seperate out responsibilities so "worker" just provides Definition and does not need the cache

      Connection use:
      9. Use ObjectPool lifecycle methods
      10. Swap out Connection for DataSource
      11. Use ConnectionPolicy Stratagy Object

      The above solutions have been packaged up as four alternatives on this page:
      http://docs.codehaus.org/display/GEOTOOLS/CRS+Authorty+Alternative+Proposals

      Worker Pool
      -Threads: Use ObjectPool to manage multiple workers

      • Cache: Isolate cache into seperate object, and inject into workers so they can perform their own cache check
      • Connection: Use ObjectPool lifecycle methods to close connection, tune ObjectPool within limts of provided DataSource

      Fire and Forget

      • Threads: Create a FactoryUsingOracleSQL as needed in a "Fire and Forget" manner
      • Cache: Workers can keep a back pointer, and call the parent to check the cache
      • Connection : Workers must limit connection use to just the duration of the executeStatement

      Worker DAO Pool

      • Threads : Use ObjectPool to manage multiple workers
      • Cache : Limit cache use to OracleEPSGAuthority, limit the scope of workers to only providing the definition (not object creation)
      • Connection: Use ObjectPool lifecycle methods to close connection, tune ObjectPool within limits of provided DataSource

      Just do it:

      • Threads: Create a Collection of Workers and manage it ourselves, keeping track of the Thread so we recursively use the same worker
      • Cache: Workers can keep a back pointer, and call the parent to check the cache
      • Connection: Choose a connection policy strategy object based on a new Hint

        Issue Links

          Activity

          Hide
          Jody Garnett added a comment -
          I will assign this bug to you for now then.
          Show
          Jody Garnett added a comment - I will assign this bug to you for now then.
          Hide
          Martin Desruisseaux added a comment -
          Code review and rewrite done in geotidy.
          Show
          Martin Desruisseaux added a comment - Code review and rewrite done in geotidy.
          Hide
          Jody Garnett added a comment -
          Attach patch isolates database connection/creation so it can be used by all implementations
          Show
          Jody Garnett added a comment - Attach patch isolates database connection/creation so it can be used by all implementations
          Hide
          Jody Garnett added a comment -
          Review geot-1286.patch it allows the mediator/delegate combo to use your new database in a jar. Basically catches us up to the point where we can run the code and see what is working or not.
          Show
          Jody Garnett added a comment - Review geot-1286.patch it allows the mediator/delegate combo to use your new database in a jar. Basically catches us up to the point where we can run the code and see what is working or not.
          Hide
          Jody Garnett added a comment -
          I have with drawn this change proposal and patch as its time has passed due to lack of review while the work was funded.
          Show
          Jody Garnett added a comment - I have with drawn this change proposal and patch as its time has passed due to lack of review while the work was funded.

            People

            • Assignee:
              Jody Garnett
              Reporter:
              Cory Horner
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: