Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: jcs-1.3
    • Fix Version/s: jcs-2.0-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      It would be nice to have a file based cache in jcs where each item is stored as a single file and the filename is based on the key. This way, several jvms can share the same cache and the cache can be rsynced between nodes while running the application.

      1. DiskFileCacheFactory.java
        0.8 kB
        Tore Halset
      2. DiskFileCacheAttributes.java
        0.2 kB
        Tore Halset
      3. DiskFileCache.java
        5 kB
        Tore Halset

        Activity

        Hide
        Aaron Smuts added a comment -

        Please send questions like this to the mailing list.

        Read the documentation. This disk cache is like any other. You configure JCS to use it in the cache.ccf file just like any other disk cache.

        If you want to create files outside of JCS, we'll have to expose a utility for creating the names. The algorithm is simply though. It simply replaces all strange characters and spaces with underscores.

        Please post to the user mailing list.

        Show
        Aaron Smuts added a comment - Please send questions like this to the mailing list. Read the documentation. This disk cache is like any other. You configure JCS to use it in the cache.ccf file just like any other disk cache. If you want to create files outside of JCS, we'll have to expose a utility for creating the names. The algorithm is simply though. It simply replaces all strange characters and spaces with underscores. Please post to the user mailing list.
        Hide
        Chopin Hu added a comment -

        Aaron,

        I am still not getting it right. Seems that I put an ascii file into the file disk as a separate file. But when it is an binary file. It does not work. Though I set the jvm to a bigger size (1560MBs) to handle a 12 MBs binary file, it still fails. Do you have an sample code to show how to make it work? If you need, I can send you a copy of the binary file I used for testing.

        Thanks.

        Show
        Chopin Hu added a comment - Aaron, I am still not getting it right. Seems that I put an ascii file into the file disk as a separate file. But when it is an binary file. It does not work. Though I set the jvm to a bigger size (1560MBs) to handle a 12 MBs binary file, it still fails. Do you have an sample code to show how to make it work? If you need, I can send you a copy of the binary file I used for testing. Thanks.
        Hide
        Chopin Hu added a comment -

        Aaron,

        I am still not getting it right. Seems that I put an ascii file into the file disk as a separate file. But when it is an binary file. It does not work. Though I set the jvm to a bigger size (1560MBs) to handle a 12 MBs binary file, it still fails. Do you have an sample code to show how to make it work? If you need, I can send you a copy of the binary file I used for testing.

        Thanks.

        Show
        Chopin Hu added a comment - Aaron, I am still not getting it right. Seems that I put an ascii file into the file disk as a separate file. But when it is an binary file. It does not work. Though I set the jvm to a bigger size (1560MBs) to handle a 12 MBs binary file, it still fails. Do you have an sample code to show how to make it work? If you need, I can send you a copy of the binary file I used for testing. Thanks.
        Hide
        Chopin Hu added a comment -

        Figured out how to use it. Thanks.

        Show
        Chopin Hu added a comment - Figured out how to use it. Thanks.
        Hide
        Chopin Hu added a comment -

        Aaron,

        Great. I just got a chance to check out the release-1.3.3.5-RC, which looks the Disk File Cache

        Now, my question is how to cache a file to the disk using a key as the file name. Is this a config issue? If not, can you please provide a sample code showing how to use it?

        Thank you so much.

        Show
        Chopin Hu added a comment - Aaron, Great. I just got a chance to check out the release-1.3.3.5-RC, which looks the Disk File Cache Now, my question is how to cache a file to the disk using a key as the file name. Is this a config issue? If not, can you please provide a sample code showing how to use it? Thank you so much.
        Hide
        Aaron Smuts added a comment -

        Use the latest temp build. It's production ready. I'm using it in prod. You don't need a formal release build. 1.3 is way out of date. We'll issue a new release in a couple of months, but there is no need to wait.

        Show
        Aaron Smuts added a comment - Use the latest temp build. It's production ready. I'm using it in prod. You don't need a formal release build. 1.3 is way out of date. We'll issue a new release in a couple of months, but there is no need to wait.
        Hide
        Chopin Hu added a comment -

        That is exactly what I am looking for. But is the release 1.4 available yet? I don't care to use JDK 1.5+. that's not an issue to me and to my project.

        Currently, I am evaluating JCS 1.3. If I can put this feature (one key, and use the key as a filename for cache) into function with the version 1.3, it is great. If not, then where to find the version JCS 1.4?

        By the way, the files I am going to cache are binary data. I hope it will work out.

        Thanks a lot.

        Show
        Chopin Hu added a comment - That is exactly what I am looking for. But is the release 1.4 available yet? I don't care to use JDK 1.5+. that's not an issue to me and to my project. Currently, I am evaluating JCS 1.3. If I can put this feature (one key, and use the key as a filename for cache) into function with the version 1.3, it is great. If not, then where to find the version JCS 1.4? By the way, the files I am going to cache are binary data. I hope it will work out. Thanks a lot.
        Hide
        Aaron Smuts added a comment -

        I added a 1.4 version of a FileDiskCache into JCS.

        Show
        Aaron Smuts added a comment - I added a 1.4 version of a FileDiskCache into JCS.
        Hide
        Aaron Smuts added a comment -

        This might be useful for regions without many items. I'll work on something based on the ideas here. But the patch is not usable as it. It depends on JDK 1.5 specific classes. JCS is compatible with JDK 1.4.

        A few minor things for future reference: All methods need full comments. All methods need unit tests. Everything should be formatted according to our style.

        Thanks for idea.

        Show
        Aaron Smuts added a comment - This might be useful for regions without many items. I'll work on something based on the ideas here. But the patch is not usable as it. It depends on JDK 1.5 specific classes. JCS is compatible with JDK 1.4. A few minor things for future reference: All methods need full comments. All methods need unit tests. Everything should be formatted according to our style. Thanks for idea.

          People

          • Assignee:
            Aaron Smuts
            Reporter:
            Tore Halset
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development