incubator-directmemory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoit Perroud (Commented) (JIRA)" <>
Subject [jira] [Commented] (DIRECTMEMORY-70) Move Pointer.class and Pointer."statistics" into an intermediate class CacheEntry
Date Mon, 27 Feb 2012 09:55:48 GMT


Benoit Perroud commented on DIRECTMEMORY-70:

Just to ensure I'm not completely off road, I extracted the following simplier interface to
replace the {{OffHeapMemoryBuffer}}

public interface ByteBufferAllocator
     * Allocate the given size off heap, or return null if the allocation failed.
     * @param size
     * @return
    ByteBuffer allocate( final int size );

     * Return the given ByteBuffer making it available for a future usage 
     * @param buffer
    void free( final ByteBuffer buffer );


This is lean and easy to understand. Two implementations are (almost) ready to be used : a
merging one, i.e. where returned pointers are merged together, and a slab'style allocator,
where buffers are of the same predefined sizes (i.e. 128b, 512b, 2k, 8k, 32k,... application

{{MemoryManagerService}} is a more high level view with existing store, retrieve, free and
"collectExpire" functions, and wrap the allocated {{ByteBuffer}} in a {{Pointer}} and return

{{MemoryManagerService}} is augmented with Input and OutputStream functionalities to be able
to stream in files, socket data, etc.


> Move Pointer.class and Pointer."statistics" into an intermediate class CacheEntry
> ---------------------------------------------------------------------------------
>                 Key: DIRECTMEMORY-70
>                 URL:
>             Project: Apache DirectMemory
>          Issue Type: Improvement
>            Reporter: Benoit Perroud
>         Attachments: DIRECTMEMORY-70-MemoryManagerService-to-hide-implementation.patch
> In order to achieve better separation of responsabilities, attributes like Pointer.class,
Pointer.hits, Pointer.lastHit, etc. should be moved into an intermediate class, for instance

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message