You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jonathan Moore (JIRA)" <ji...@apache.org> on 2010/08/17 23:24:16 UTC

[jira] Created: (HTTPCLIENT-979) cache entry resource management should be extracted from CachingHttpClient

cache entry resource management should be extracted from CachingHttpClient
--------------------------------------------------------------------------

                 Key: HTTPCLIENT-979
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-979
             Project: HttpComponents HttpClient
          Issue Type: Improvement
          Components: Cache
    Affects Versions: 4.1 Alpha2
            Reporter: Jonathan Moore


As we have built in support for stream-based management of cached response bodies, the CachingHttpClient class has its fingers in too many pies and is involved in resource management but not storage of the actual HttpCacheEntries.

I have a patch forthcoming. :)


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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-979) cache entry resource management should be extracted from CachingHttpClient

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900216#action_12900216 ] 

Oleg Kalnichevski commented on HTTPCLIENT-979:
----------------------------------------------

We do not have to rush it, but would be nice to have beta1 released by the end of the year and 4.1 GA sometime in Q1 2011.

I am going to cross-check ManagedHttpCacheStorage and related classes and probably add an option to save cache entries to disk, so that ManagedHttpCacheStorage can be fully persistent. 

Anyway, I really like the way things have been shaping up.

Oleg

> cache entry resource management should be extracted from CachingHttpClient
> --------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-979
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-979
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Jonathan Moore
>             Fix For: 4.1 Alpha3
>
>         Attachments: separate-cache-and-storage.patch
>
>
> As we have built in support for stream-based management of cached response bodies, the CachingHttpClient class has its fingers in too many pies and is involved in resource management but not storage of the actual HttpCacheEntries.
> I have a patch forthcoming. :)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Updated: (HTTPCLIENT-979) cache entry resource management should be extracted from CachingHttpClient

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

Jonathan Moore updated HTTPCLIENT-979:
--------------------------------------

    Attachment: separate-cache-and-storage.patch

The attached patch makes a number of significant cleanup steps.
* What was previously the HttpCache interface and implementations is now the HttpCacheStorage interface.
* A new class (BasicHttpCache) and higher-level interface (HttpCache) were introduced to encapsulate both resource management and cache entry storage.
* As a result, a lot of dependencies could be removed from CachingHttpClient, making it much easier to understand.
* In turn, many of the mock-driven unit tests previously in TestCachingHttpClient were able to be turned into non-mock unit tests when they moved.
* Finally, added the MAX_CACHE_ENTRIES notion into CacheConfig, which can be passed as a constructor to all existing HttpCache and HttpCacheStorage implementations in addition to the CachingHttpClient itself.

One follow up is that there is a Javadoc cleanup/addition pass that will be needed, which I would be happy to do as a subsequent patch (because this was a largish change I wanted to try to get the code changes into trunk first).

This patch is contributed to the ASF with the permission of my employer.

> cache entry resource management should be extracted from CachingHttpClient
> --------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-979
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-979
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Jonathan Moore
>         Attachments: separate-cache-and-storage.patch
>
>
> As we have built in support for stream-based management of cached response bodies, the CachingHttpClient class has its fingers in too many pies and is involved in resource management but not storage of the actual HttpCacheEntries.
> I have a patch forthcoming. :)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-979) cache entry resource management should be extracted from CachingHttpClient

Posted by "Jonathan Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900025#action_12900025 ] 

Jonathan Moore commented on HTTPCLIENT-979:
-------------------------------------------

I think the easiest way to answer this will be to get the following cache implementations sanity-checked:

1. your "store the bodies on the filesystem" cache
2. the memcached cache
3. the ehcache cache

The one other suspicion I have is that the HttpCache#cacheEntry method might want to return an HttpResponse instead of an HttpCacheEntry. This would move revalidation into the BasicHttpCache, leaving the CachingHttpClient very simple indeed. I think let's get #1-#3 shorn up and then see where we are.

What is the target release date for 4.1-beta1?


> cache entry resource management should be extracted from CachingHttpClient
> --------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-979
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-979
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Jonathan Moore
>             Fix For: 4.1 Alpha3
>
>         Attachments: separate-cache-and-storage.patch
>
>
> As we have built in support for stream-based management of cached response bodies, the CachingHttpClient class has its fingers in too many pies and is involved in resource management but not storage of the actual HttpCacheEntries.
> I have a patch forthcoming. :)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCLIENT-979) cache entry resource management should be extracted from CachingHttpClient

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

Oleg Kalnichevski resolved HTTPCLIENT-979.
------------------------------------------

    Fix Version/s: 4.1 Alpha3
       Resolution: Fixed

Patch checked in. Many thanks for contributing it, Jon.

How certain are you about stability of HttpCache interface, though? Once 4.1 beta1 is released we will no longer be able to change it. Would it be worthwhile to consider making an abstract class out of it and making those methods that are unlikely to very in different implementations non-abstract?

Oleg

> cache entry resource management should be extracted from CachingHttpClient
> --------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-979
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-979
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Jonathan Moore
>             Fix For: 4.1 Alpha3
>
>         Attachments: separate-cache-and-storage.patch
>
>
> As we have built in support for stream-based management of cached response bodies, the CachingHttpClient class has its fingers in too many pies and is involved in resource management but not storage of the actual HttpCacheEntries.
> I have a patch forthcoming. :)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org