[ 
https://issues.apache.org/jira/browse/WHIRR-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019445#comment-13019445
 ] 

Adrian Cole commented on WHIRR-280:
-----------------------------------

can't quite apply this patch as WHIRR-279 in progress.  

Some notes:
I think the checkNull singleton pattern is a bit distracting.  I prefer java 
enum singletons but not hard set on it.

Also, it might be cleaner to use the InputStreamMap or BlobMap in jclouds 
rather that this object.  It is a view that supports containsKey() clear() etc, 
and could probably eliminate most of this code.  Ideally, we could create a 
small function to make a concurrent map out of this, emulating putIfAbsent() 
with something like this

   if (!map.containsKey(key))
       return map.put(key, value);
   else
       return map.get(key);

  ex.  ConcurrentMap<String, Blob> cache = 
makeConcurrentMap(deleteContainerOnShutdown(context.getBlobMap(createTempContainer())));

cache.clear()// deletes all blobs
cache.putIfAbsent("key", blobFrom(uri));

you'd think that this would be very inefficient, as maps need to return the old 
value.  However, since there is no old value (new container), the performance 
should be fine.

my 2p

> Create a blob cache that could be used for storing local files
> --------------------------------------------------------------
>
>                 Key: WHIRR-280
>                 URL: https://issues.apache.org/jira/browse/WHIRR-280
>             Project: Whirr
>          Issue Type: Sub-task
>          Components: core
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.5.0
>
>         Attachments: WHIRR-280.patch, WHIRR-280.patch
>
>
> Create a new class (BlobCache) that can be used as a temporary blob store for 
> local files in the cloud. This class should be able to create jclouds 
> Statements that could download files on the cluster nodes as needed. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to