Package org.apache.directmemory.memory

Examples of org.apache.directmemory.memory.AllocationPolicy


{

    @Test
    public void testOffHeapExceedMemoryReturnNullWhenTrue()
    {
        AllocationPolicy allocationPolicy = new RoundRobinAllocationPolicy();
        MemoryManagerService<byte[]> memoryManager = new MemoryManagerServiceImpl<byte[]>( allocationPolicy, true );
        CacheService<Integer, byte[]> cache =
            new DirectMemory<Integer, byte[]>().setMemoryManager( memoryManager ).setNumberOfBuffers( 1 ).setSize(
                Ram.Mb( 1 ) ).newCacheService();
View Full Code Here


    @Test
    public void testEntryIsNoMoreAvailableAfterExpiry()
        throws InterruptedException
    {
        AllocationPolicy allocationPolicy = new RoundRobinAllocationPolicy();
        MemoryManagerService<MyBean> memoryManager = new MemoryManagerServiceImpl<MyBean>( allocationPolicy, true );
        CacheService<Integer, MyBean> cache =
            new DirectMemory<Integer, MyBean>().setMemoryManager( memoryManager ).setNumberOfBuffers( 1 ).setSize(
                Ram.Mb( 1 ) ).newCacheService();
        /*
 
View Full Code Here

    @Test
    public void testOffHeapExceedMemoryReturnNullWhenTrue()
        throws IOException
    {
        AllocationPolicy allocationPolicy = new RoundRobinAllocationPolicy();
        MemoryManagerService<byte[]> memoryManager = new MemoryManagerServiceImpl<byte[]>( allocationPolicy, true );
        CacheService<Integer, byte[]> cache =
            new DirectMemory<Integer, byte[]>().setMemoryManager( memoryManager ).setNumberOfBuffers( 1 ).setSize( Ram.Mb( 1 ) ).newCacheService();

        for ( int i = 0; i < 1000; i++ )
View Full Code Here

    @Test
    public void testEntryIsNoMoreAvailableAfterExpiry()
        throws InterruptedException, IOException
    {
        AllocationPolicy allocationPolicy = new RoundRobinAllocationPolicy();
        MemoryManagerService<MyBean> memoryManager = new MemoryManagerServiceImpl<MyBean>( allocationPolicy, true );
        CacheService<Integer, MyBean> cache =
            new DirectMemory<Integer, MyBean>().setMemoryManager( memoryManager ).setNumberOfBuffers( 1 ).setSize( Ram.Mb( 1 ) ).newCacheService();
        /*
         * let the scan run every 10s
View Full Code Here

TOP

Related Classes of org.apache.directmemory.memory.AllocationPolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.