You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directmemory.apache.org by Jeff MAURY <je...@jeffmaury.com> on 2012/05/25 15:20:24 UTC

Design questions

Hello,

I have a couple of questions regarding the status of DirectMemory:

1) I am working on https://issues.apache.org/jira/browse/DIRECTMEMORY-82, I
followed the pattern that was applied to ByteBufferAllocator that is to
request objects (CacheService, MemoryService) to implement
java.io.Closeable.
However, the close method of this interface throws an IOException witch is
unlikely to happen in our memory world. So do you think we should keep
implementing this interface or just add a close method in the contract of
those objects ?

2) The various layer of the architecture (CacheService, MemoryService,
ByteBufferAllocator) are described through an interface. But it seems a lot
of implementation dependant methods are there: collectXXXX,....
Is it planned to revisit these definitions in the near future ? In the same
direction, the default CacheService implementation has a Timer whose goal
is to call an action on the MemoryService layer !!!

Thanks
Jeff

-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Re: Design questions

Posted by Benoit Perroud <be...@noisette.ch>.
Hi Jeff,

See my answers below.

2012/5/25 Jeff MAURY <je...@jeffmaury.com>:
> Hello,
>
> I have a couple of questions regarding the status of DirectMemory:
>
> 1) I am working on https://issues.apache.org/jira/browse/DIRECTMEMORY-82, I
> followed the pattern that was applied to ByteBufferAllocator that is to
> request objects (CacheService, MemoryService) to implement
> java.io.Closeable.
> However, the close method of this interface throws an IOException witch is
> unlikely to happen in our memory world. So do you think we should keep
> implementing this interface or just add a close method in the contract of
> those objects ?

Staying aligned with java.io.Closable is desired. And in our memory
world, as soon as we start having multiple layers of cache (heap,
off-heap, file for instance) then it's more likely expected to have
IOException (with the files :))

> 2) The various layer of the architecture (CacheService, MemoryService,
> ByteBufferAllocator) are described through an interface. But it seems a lot
> of implementation dependant methods are there: collectXXXX,....
> Is it planned to revisit these definitions in the near future ? In the same
> direction, the default CacheService implementation has a Timer whose goal
> is to call an action on the MemoryService layer !!!

These definitions *need* to be revisited. I would like to see a
function like "setEvictionPolicy()", but we haven't had time to go
through.

Feel free to propose your own thoughts. Any ideas are welcome.

> Thanks
> Jeff

Thanks to you,

Benoit.