You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Steven Dolg (JIRA)" <ji...@apache.org> on 2008/11/02 15:03:44 UTC

[jira] Created: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
---------------------------------------------------------------------------------------------------------------

                 Key: COCOON3-9
                 URL: https://issues.apache.org/jira/browse/COCOON3-9
             Project: Cocoon 3
          Issue Type: Improvement
          Components: cocoon-pipeline
    Affects Versions: 3.0.0-alpha-1
            Reporter: Steven Dolg
            Assignee: Cocoon Developers Team
             Fix For: 3.0.0-alpha-2


Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
COCCON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.

With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Steven Dolg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Dolg updated COCOON3-9:
------------------------------

    Description: 
Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.

With only some minor modifications the PipelineCache can be used for those requirements.

  was:
Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
COCCON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.

With only some minor modifications the PipelineCache can be used for those requirements.


> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Cocoon Developers Team
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache.patch
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644712#action_12644712 ] 

Simone Tripodi commented on COCOON3-9:
--------------------------------------

I merged the patch and played with it, IMHO this patch should be applied in trunk's code; just minor fixes should be done:

1) javadoc: I didn't understand how the Cache should use org.apache.cocoon.pipeline.caching.CacheKey's mehods;
2) IMHO an AbstractCache should be provided since we need also monitoring the cached resources and reload them when "expired", so this logic could be managed in the Abstract class, concrete implementations should only persist and retrieve resources;
3) How to inject Cache's instances to PipeLine Components? I suppose in cocoon-sitemap Caches will be declared in the sitemap, but a public setter, in components that need using the Cache, could be useful to inject it.

What do you think about it?

> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Cocoon Developers Team
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache-fixed.patch, cache.patch
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Steven Dolg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644905#action_12644905 ] 

Steven Dolg commented on COCOON3-9:
-----------------------------------

Hi Simone,

I don't think we should add automatic reloading of cached resource to the cache itself.
IMO this would add unnecessary complexity to the cache, because it would need to know how to recreate the resources.
This should be the component's job. (Just compare this with available caching libraries like Ehcache)

Injecting caches into the PipelineComponents using the sitemap module works as you said (using an IOC container).
When creating a pipeline using the Pipeline API this has to be done programatically.
Since the components are constructed directly in the code the public setter of the component itself (instead of the PipelineComponent interface) should be easily possible.

The Cache implementation itself does not need to bother with the CacheKey interface. This is merely a mechanism to create specific CacheKeys that can be used to check cached resource for validity and/or create compound cache keys (like the ones for pipelines where the validity depends on the configuration of all relevant PipelineComponents).

> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Cocoon Developers Team
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache-fixed.patch, cache.patch
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi updated COCOON3-9:
---------------------------------

    Attachment: InMemoryMRUCache.java

Hi Steven,

you and I both agree that we don't need a complex cache system implemented in the cocoon packages - if users need more complex systems, they have to implement them  - but I noticed that thanks to a small trick on java.util.LinkedHashMap we can provide a very simple implementation of MRU cache, modifying a little your org.apache.cocoon.pipeline.caching.SimpleCache. 

The attached class shows you how to use the trick, I hope this helps.

I suggest you to rename the org.apache.cocoon.pipeline.caching.SimpleCache class in org.apache.cocoon.pipeline.caching.InMemoryMRUCache, IMHO sounds more intuitive for users.

> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Cocoon Developers Team
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache-fixed.patch, cache.patch, InMemoryMRUCache.java
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Steven Dolg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Dolg updated COCOON3-9:
------------------------------

    Attachment: cache-fixed.patch

Apparently my first patch was broken.

Here a fixed one.

> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Cocoon Developers Team
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache-fixed.patch, cache.patch
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Steven Dolg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Dolg closed COCOON3-9.
-----------------------------

    Resolution: Fixed
      Assignee: Steven Dolg  (was: Cocoon Developers Team)

Patch applied - with minor modifications, to prevent exceptions when a caching pipeline is executed without cache.

> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Steven Dolg
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache-fixed.patch, cache.patch, InMemoryMRUCache.java
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644716#action_12644716 ] 

Simone Tripodi commented on COCOON3-9:
--------------------------------------

Sorry I didn't notice that an AbstractCache is already present, btw we should study a "Monitor" that lives in the AbstractCache that's able to reload out-of-date entries...

> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Cocoon Developers Team
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache-fixed.patch, cache.patch
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCOON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON3-9) Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.

Posted by "Steven Dolg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON3-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Dolg updated COCOON3-9:
------------------------------

    Attachment: cache.patch

The provided patch basically renames the org.apache.cocoon.pipeline.caching.PipelineCache to org.apache.cocoon.pipeline.caching.Cache and makes the interface more explicit about retrieving valid/invalid cache entries.

Additionally I extended the org.apache.cocoon.pipeline.caching.CacheValue interface to allow direct access to the stored content and provided a new implementation suitable for the requirements of COCOON3-6.

I also introduced abstract implementations for the Cache and CacheValue interface and added some more documentation to make the interfaces/classes more comprehensible.

> Generalize the PipelineCache, so that it can be used as a general purpose cache for PipelineComponents as well.
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON3-9
>                 URL: https://issues.apache.org/jira/browse/COCOON3-9
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: Steven Dolg
>            Assignee: Cocoon Developers Team
>             Fix For: 3.0.0-alpha-2
>
>         Attachments: cache.patch
>
>
> Currently the PipelineCache is very specific for caching the complete results of a pipeline execution.
> COCCON3-6 is the first issue requiring a caching mechanism at the PipelineComponent level.
> With only some minor modifications the PipelineCache can be used for those requirements.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.