3 Replies Latest reply on Mar 17, 2004 11:02 PM by Bela Ban

    CacheLoader

    klchan Newbie

      I presume the CacheLoader Interface is used for persisting the cache to either file or database. Correct me if I am wrong?

      I like to know if there is any implementation of the CacheLoader right now? If not, when will there be an implementation or how should I implement/use it?

      I like to use it to re-populate the cache from database after a server restart. I have a cluster of 2 machines and each machine has its own local database.

      Any advice or help is greatly appreciated.

      thanks.

        • 1. Re: CacheLoader
          Bela Ban Master

          // I presume the CacheLoader Interface is used for
          // persisting the cache to either file or database.
          // Correct me if I am wrong?

          Yes.


          // I like to know if there is any implementation of the
          // CacheLoader right now? If not, when will there be
          // an implementation or how should I implement/use it?


          No, there is not yet an implementation. I'm still working on the use cases. You can look at the use case document, it is in cache/docs/design/CacheLoader.txt (CVS head).

          I have the use case down for a shared cacheloader, but I want to go through use cases in which each node has its own local DB. This might change the interfaces slightly. I hope to be done by mid April.
          The tasks that remain are
          - flesh out the interface, see whether it covers all use cases
          - Call the cacheloader at the right time from TreeCache

          // I like to use it to re-populate the cache from
          // database after a server restart. I have a cluster of
          // 2 machines and each machine has its own local
          // database.

          You could do this using a client app, which reads from the DB and simply inserts. The CacheLoader will do a state transfer for the 2nd node and (optionally) lazily populate the cache.

          Bela

          • 2. Re: CacheLoader
            klchan Newbie

            Thanks Bela for yr reponse.

            Do u mean to say that u will have [1] the use cases or [2] the implementation ready by mid April?

            If [2], then I would be glad to test and use it, else I may have to decide to find another solution.

            thanks again.

            • 3. Re: CacheLoader
              Bela Ban Master

              I should have the hooks in place by mid April. I might also provide a simple file-based implementation to see whether everything works.

              We plane to provide a file-based impl, a DB impl, and maybe an impl based on Sleepycat's Java DB.

              Bela