Return-Path: X-Original-To: apmail-incubator-directmemory-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-directmemory-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FD929D6E for ; Sat, 25 Feb 2012 14:21:37 +0000 (UTC) Received: (qmail 48327 invoked by uid 500); 25 Feb 2012 14:21:37 -0000 Delivered-To: apmail-incubator-directmemory-dev-archive@incubator.apache.org Received: (qmail 48278 invoked by uid 500); 25 Feb 2012 14:21:37 -0000 Mailing-List: contact directmemory-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directmemory-dev@incubator.apache.org Delivered-To: mailing list directmemory-dev@incubator.apache.org Received: (qmail 48269 invoked by uid 99); 25 Feb 2012 14:21:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Feb 2012 14:21:37 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of benoit@noisette.ch designates 209.85.214.175 as permitted sender) Received: from [209.85.214.175] (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Feb 2012 14:21:32 +0000 Received: by obhx4 with SMTP id x4so4085255obh.6 for ; Sat, 25 Feb 2012 06:21:12 -0800 (PST) Received-SPF: pass (google.com: domain of benoit@noisette.ch designates 10.182.12.74 as permitted sender) client-ip=10.182.12.74; Authentication-Results: mr.google.com; spf=pass (google.com: domain of benoit@noisette.ch designates 10.182.12.74 as permitted sender) smtp.mail=benoit@noisette.ch Received: from mr.google.com ([10.182.12.74]) by 10.182.12.74 with SMTP id w10mr2351122obb.51.1330179672285 (num_hops = 1); Sat, 25 Feb 2012 06:21:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.12.74 with SMTP id w10mr2076512obb.51.1330179672115; Sat, 25 Feb 2012 06:21:12 -0800 (PST) Received: by 10.182.188.102 with HTTP; Sat, 25 Feb 2012 06:21:12 -0800 (PST) In-Reply-To: References: Date: Sat, 25 Feb 2012 15:21:12 +0100 Message-ID: Subject: Re: svn commit: r1293567 - in /incubator/directmemory/trunk: directmemory-cache/src/main/java/org/apache/directmemory/memory/ integrations/ehcache/ integrations/ehcache/src/ integrations/ehcache/src/main/ integrations/ehcache/src/main/java/ integrati From: Benoit Perroud To: directmemory-dev@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlnnQ4cZwUrG58d4RvRhqJU9Jv2MygMUchMgWFWbU4jB0goPCuJJZnsBG8OobmMDZoex0rg Hi Simone, Thanks also for this remark. I didn't think far enough, sorry. But, EHCache is done in a way that net.sf.ehcache.Cache is looking for the class net.sf.ehcache.store.offheap.OffHeapStore (http://ehcache.org/xref/net/sf/ehcache/Cache.html#1181). To be able to use the buildin off-heap features of EHCache we need to have a class of that name. (Note here : the test cache is configured to have 30 objects in on-heap memory, and then to overflow to off-heap). I will open a ticket at EHCache, but not sure they will add the feature to change this class name, as we will enter in competition with their BigMemory... Thanks anyway bringing this out, keep us in touch with legal answer. I will post reply here once I have posted on EHCache. Benoit. 2012/2/25 Simone Tripodi : > Salut Benoit, > > thanks for taking care of applying patches, anyway I am personally -1 > on including net.sf.* packages in the ASF codebase - and not sure it > is allowed or not. > > IMHO it should me renamed to org.apache.directmemory.* - I'll contact > anyway our legals office to understand better the policy, > > Is someone here already aware of the related details? > TIA, > > -Simo > > http://people.apache.org/~simonetripodi/ > http://simonetripodi.livejournal.com/ > http://twitter.com/simonetripodi > http://www.99soft.org/ > > > > On Sat, Feb 25, 2012 at 11:16 AM, =C2=A0 wrote: >> Author: bperroud >> Date: Sat Feb 25 10:16:25 2012 >> New Revision: 1293567 >> >> URL: http://svn.apache.org/viewvc?rev=3D1293567&view=3Drev >> Log: >> DIRECTMEMORY-60 : EHCache Integration, thanks to Michael Andre Pearce fo= r his contribution >> >> Added: >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/pom.xml >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/net/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/net/sf/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/net/sf/ehcache/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/net/sf/ehcache/store/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/net/sf/ehcache/store/offheap/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/net/sf/ehcache/store/offheap/OffHeapStore.java >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/directmemory/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/directmemory/ehcache/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/directmemory/ehcache/DirectMemoryCache.java >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/directmemory/ehcache/DirectMemoryStore.java >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/directmemory/ehcache/NotifyingDirectMemoryStore.java >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/directmemory/memory/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/main/= java/org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolic= yEhcacheImpl.java >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= java/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= java/org/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= java/org/apache/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= java/org/apache/directmemory/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= java/org/apache/directmemory/ehcache/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= java/org/apache/directmemory/ehcache/EHCacheTest.java >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= resources/ >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= resources/ehcache.xml >> =C2=A0 =C2=A0incubator/directmemory/trunk/integrations/ehcache/src/test/= resources/logback-test.xml >> Modified: >> =C2=A0 =C2=A0incubator/directmemory/trunk/directmemory-cache/src/main/ja= va/org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyI= mpl.java >> >> Modified: incubator/directmemory/trunk/directmemory-cache/src/main/java/= org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl= .java >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmem= ory-cache/src/main/java/org/apache/directmemory/memory/MemoryManagerService= WithAllocationPolicyImpl.java?rev=3D1293567&r1=3D1293566&r2=3D1293567&view= =3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/directmemory-cache/src/main/java/org/ap= ache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl.java = (original) >> +++ incubator/directmemory/trunk/directmemory-cache/src/main/java/org/ap= ache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl.java = Sat Feb 25 10:16:25 2012 >> @@ -1,5 +1,7 @@ >> =C2=A0package org.apache.directmemory.memory; >> >> +import java.nio.BufferOverflowException; >> + >> =C2=A0/* >> =C2=A0* Licensed to the Apache Software Foundation (ASF) under one >> =C2=A0* or more contributor license agreements. =C2=A0See the NOTICE fil= e >> @@ -28,6 +30,8 @@ public class MemoryManagerServiceWithAll >> =C2=A0 =C2=A0 extends MemoryManagerServiceImpl >> =C2=A0{ >> >> + =C2=A0 =C2=A0protected boolean returnNullWhenFull =3D true; >> + >> =C2=A0 =C2=A0 protected AllocationPolicy allocationPolicy; >> >> =C2=A0 =C2=A0 @Override >> @@ -59,7 +63,14 @@ public class MemoryManagerServiceWithAll >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buffer =3D allocationPolicy.ge= tActiveBuffer( buffer, allocationNumber ); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( buffer =3D=3D null ) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 { >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (returnNullW= henFull) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0r= eturn null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0t= hrow new BufferOverflowException(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 p =3D buffer.store( payload, e= xpiresIn ); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 allocationNumber++; >> @@ -86,7 +97,14 @@ public class MemoryManagerServiceWithAll >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buffer =3D allocationPolicy.ge= tActiveBuffer( buffer, allocationNumber ); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( buffer =3D=3D null ) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 { >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (returnNullW= henFull) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0r= eturn null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0t= hrow new BufferOverflowException(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 p =3D buffer.allocate( type, s= ize, expiresIn, expires ); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 allocationNumber++; >> >> Added: incubator/directmemory/trunk/integrations/ehcache/pom.xml >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/pom.xml?rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/pom.xml (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/pom.xml Sat Feb 25= 10:16:25 2012 >> @@ -0,0 +1,93 @@ >> + >> + >> +> + =C2=A0 =C2=A0 =C2=A0 xsi:schemaLocation=3D"http://maven.apache.org/POM= /4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> >> + >> + =C2=A0 =C2=A0 =C2=A0 4.0.0 >> + >> + =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org.apache.d= irectmemory >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 directmem= ory-parent >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0.6.0-SNAPSH= OT >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ../../<= /relativePath> >> + =C2=A0 =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 directmemory-ehcache >> + =C2=A0 =C2=A0 =C2=A0 Apache DirectMemory :: Integrations :: EHCa= che >> + =C2=A0 =C2=A0 =C2=A0 EHCache CacheStore Implementation to= integrate DirectMemory Cache as OffHeapStore. >> + =C2=A0 =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org.apache.maven.plugins >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 maven-clean-plugin >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logs >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 false >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org.apache.maven.plugins >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 maven-surefire-plugin >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2.9 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -Xm= x512m -Xms512m -XX:MaxDirectMemorySize=3D512m >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ${project.groupId} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 directmemory-cache >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ${project.version} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 net.sf.ehcache >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ehcache-core >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 2.5.0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 junit >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 junit >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 test >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 http://repo.fusesource.com/maven2 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 fusesource >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 sonatype-nexus-public >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 SonaType public snapshots and releases repository >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 https://oss.sonatype.org/content/groups/public >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 false >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 true >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0 =C2=A0 >> + >> + >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/main/java/n= et/sf/ehcache/store/offheap/OffHeapStore.java >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/main/java/net/sf/ehcache/store/offheap/OffHeapStore.java?re= v=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/main/java/net/= sf/ehcache/store/offheap/OffHeapStore.java (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/main/java/net/= sf/ehcache/store/offheap/OffHeapStore.java Sat Feb 25 10:16:25 2012 >> @@ -0,0 +1,120 @@ >> +package net.sf.ehcache.store.offheap; >> + >> +/* >> + * Licensed to the Apache Software Foundation (ASF) under one >> + * or more contributor license agreements. =C2=A0See the NOTICE file >> + * distributed with this work for additional information >> + * regarding copyright ownership. =C2=A0The ASF licenses this file >> + * to you under the Apache License, Version 2.0 (the >> + * "License"); you may not use this file except in compliance >> + * with the License. =C2=A0You may obtain a copy of the License at >> + * >> + * =C2=A0http://www.apache.org/licenses/LICENSE-2.0 >> + * >> + * Unless required by applicable law or agreed to in writing, >> + * software distributed under the License is distributed on an >> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> + * KIND, either express or implied. =C2=A0See the License for the >> + * specific language governing permissions and limitations >> + * under the License. >> + */ >> + >> +import java.util.WeakHashMap; >> + >> +import net.sf.ehcache.CacheManager; >> +import net.sf.ehcache.Ehcache; >> +import net.sf.ehcache.config.CacheConfiguration; >> +import net.sf.ehcache.pool.Pool; >> +import net.sf.ehcache.pool.PoolableStore; >> +import net.sf.ehcache.pool.impl.UnboundedPool; >> +import net.sf.ehcache.store.FrontEndCacheTier; >> +import net.sf.ehcache.store.MemoryStore; >> +import net.sf.ehcache.store.Store; >> +import net.sf.ehcache.store.disk.DiskStore; >> + >> +import org.apache.directmemory.ehcache.DirectMemoryStore; >> + >> +/** >> + * This class is simply a connector class into the EHCache for OffHeap. >> + * @author michaelandrepearce >> + * >> + */ >> +public class OffHeapStore >> +{ >> + >> + =C2=A0 =C2=A0private static final WeakHashMap> OFFHEAP_POOLS =3D new WeakHashMap>(); >> + >> + =C2=A0 =C2=A0public static Store create( Ehcache cache, String diskSto= rePath, Pool onHeapPool, >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Pool onDiskPool ) >> + =C2=A0 =C2=A0{ >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0CacheConfiguration config =3D cache.getCach= eConfiguration(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0MemoryStore memoryStore =3D createMemorySto= re( cache, onHeapPool ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0DirectMemoryStore offHeapStore =3D createOf= fHeapStore( cache, true ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0DiskStore diskStore =3D null; //need to imp= lement disk backing to store. >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Store store =3D null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( diskStore =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0store =3D new FrontEndCacheTi= er( memoryStore, offHeapStore, >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 config.getCopyStrategy(), >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 config.isCopyOnWrite(), >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 config.isCopyOnRead() ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public Object g= etMBean() >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0r= eturn this.authority.getMBean(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return store; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0/** >> + =C2=A0 =C2=A0 * Creates a persitent-to-disk store for the given cache,= using the given >> + =C2=A0 =C2=A0 * disk path. Heap and disk usage are not tracked by the = returned store. >> + =C2=A0 =C2=A0 * >> + =C2=A0 =C2=A0 * @param cache >> + =C2=A0 =C2=A0 * =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cache that fr= onts this store >> + =C2=A0 =C2=A0 * @param diskStorePath >> + =C2=A0 =C2=A0 * =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0disk path to = store data in >> + =C2=A0 =C2=A0 * @return a fully initialized store >> + =C2=A0 =C2=A0 */ >> + =C2=A0 =C2=A0public static Store create( Ehcache cache, String diskSto= rePath ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return create( cache, diskStorePath, new Un= boundedPool(), new UnboundedPool() ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0private static MemoryStore createMemoryStore( Ehcache cac= he, Pool onHeapPool ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return MemoryStore.create( cache, onHeapPoo= l ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0private static DirectMemoryStore createOffHeapStore( Ehca= che cache, boolean lowestTier ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Pool offHeapPool =3D null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( cache.getCacheConfiguration().getMaxBy= tesLocalOffHeap() =3D=3D 0L ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0offHeapPool =3D getOffHeapPoo= l( cache.getCacheManager() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return new DirectMemoryStore( cache, offHea= pPool ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0private static Pool getOffHeapPool( CacheM= anager manager ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Pool pool; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0synchronized ( OFFHEAP_POOLS ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pool =3D OFFHEAP_POOLS.get( m= anager ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( pool =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pool =3D new Un= boundedPool(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OFFHEAP_POOLS.p= ut( manager, pool ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return pool; >> + =C2=A0 =C2=A0} >> + >> +} >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/main/java/o= rg/apache/directmemory/ehcache/DirectMemoryCache.java >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache= .java?rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/ehcache/DirectMemoryCache.java (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/ehcache/DirectMemoryCache.java Sat Feb 25 10:16:25 2012 >> @@ -0,0 +1,188 @@ >> +package org.apache.directmemory.ehcache; >> + >> +/* >> + * Licensed to the Apache Software Foundation (ASF) under one >> + * or more contributor license agreements. =C2=A0See the NOTICE file >> + * distributed with this work for additional information >> + * regarding copyright ownership. =C2=A0The ASF licenses this file >> + * to you under the Apache License, Version 2.0 (the >> + * "License"); you may not use this file except in compliance >> + * with the License. =C2=A0You may obtain a copy of the License at >> + * >> + * =C2=A0http://www.apache.org/licenses/LICENSE-2.0 >> + * >> + * Unless required by applicable law or agreed to in writing, >> + * software distributed under the License is distributed on an >> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> + * KIND, either express or implied. =C2=A0See the License for the >> + * specific language governing permissions and limitations >> + * under the License. >> + */ >> + >> +import java.util.Set; >> + >> +import org.apache.directmemory.cache.CacheService; >> +import org.apache.directmemory.cache.CacheServiceImpl; >> +import org.apache.directmemory.memory.MemoryManagerService; >> +import org.apache.directmemory.memory.MemoryManagerServiceWithAllocatio= nPolicyEhcacheImpl; >> +import org.apache.directmemory.memory.OffHeapMemoryBuffer; >> +import org.apache.directmemory.memory.Pointer; >> +import org.apache.directmemory.memory.RoundRobinAllocationPolicy; >> +import org.apache.directmemory.serialization.Serializer; >> + >> +/** >> + * >> + * @author michaelandrepearce >> + * >> + * @param >> + * @param >> + */ >> +public class DirectMemoryCache >> +{ >> + >> + =C2=A0 =C2=A0private MemoryManagerService memoryManager =3D new Mem= oryManagerServiceWithAllocationPolicyEhcacheImpl( >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0new RoundRobinAllocationPolicy() ); >> + >> + =C2=A0 =C2=A0private CacheServiceImpl cacheService =3D new Cache= ServiceImpl( memoryManager ); >> + >> + =C2=A0 =C2=A0public DirectMemoryCache( int numberOfBuffers, int size, = int initialCapacity, int concurrencyLevel ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.init( numberOfBuffers, size, i= nitialCapacity, concurrencyLevel ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public DirectMemoryCache( int numberOfBuffers, int size ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0this( numberOfBuffers, size, CacheService.D= EFAULT_INITIAL_CAPACITY, CacheService.DEFAULT_CONCURRENCY_LEVEL ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void scheduleDisposalEvery( long l ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.scheduleDisposalEvery( l ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Pointer putByteArray( K key, byte[] payload, in= t expiresIn ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.putByteArray( key, payl= oad, expiresIn ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Pointer putByteArray( K key, byte[] payload ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.putByteArray( key, payl= oad ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Pointer put( K key, V value ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.put( key, value ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Pointer put( K key, V value, int expiresIn ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.put( key, value, expire= sIn ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public byte[] retrieveByteArray( K key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.retrieveByteArray( key = ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public V retrieve( K key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.retrieve( key ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Pointer getPointer( K key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.getPointer( key ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void free( K key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.free( key ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void free( Pointer pointer ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.free( pointer ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void collectExpired() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.collectExpired(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void collectLFU() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.collectLFU(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void collectAll() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.collectAll(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void clear() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.clear(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public long size() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.entries(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public long sizeInBytes() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0long i =3D 0; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0for ( OffHeapMemoryBuffer buffer : getMe= moryManager().getBuffers() ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0i +=3D buffer.used(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return i; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public long capacityInBytes() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0long i =3D 0; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0for ( OffHeapMemoryBuffer buffer : getMe= moryManager().getBuffers() ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0i +=3D buffer.capacity(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return i; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void dump( OffHeapMemoryBuffer mem ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.dump( mem ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void dump() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0cacheService.dump(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Serializer getSerializer() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.getSerializer(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public MemoryManagerService getMemoryManager() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.getMemoryManager(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Pointer allocate( K key, Class type, int siz= e ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.allocate( key, type, si= ze ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public Set getKeys() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.getMap().keySet(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public boolean containsKey( K key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return cacheService.getMap().containsKey( k= ey ); >> + =C2=A0 =C2=A0} >> + >> +} >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/main/java/o= rg/apache/directmemory/ehcache/DirectMemoryStore.java >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryStore= .java?rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/ehcache/DirectMemoryStore.java (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/ehcache/DirectMemoryStore.java Sat Feb 25 10:16:25 2012 >> @@ -0,0 +1,607 @@ >> +package org.apache.directmemory.ehcache; >> + >> +/* >> + * Licensed to the Apache Software Foundation (ASF) under one >> + * or more contributor license agreements. =C2=A0See the NOTICE file >> + * distributed with this work for additional information >> + * regarding copyright ownership. =C2=A0The ASF licenses this file >> + * to you under the Apache License, Version 2.0 (the >> + * "License"); you may not use this file except in compliance >> + * with the License. =C2=A0You may obtain a copy of the License at >> + * >> + * =C2=A0http://www.apache.org/licenses/LICENSE-2.0 >> + * >> + * Unless required by applicable law or agreed to in writing, >> + * software distributed under the License is distributed on an >> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> + * KIND, either express or implied. =C2=A0See the License for the >> + * specific language governing permissions and limitations >> + * under the License. >> + */ >> + >> +import static java.lang.String.format; >> + >> +import java.nio.BufferOverflowException; >> +import java.util.ArrayList; >> +import java.util.List; >> +import java.util.concurrent.locks.Lock; >> +import java.util.concurrent.locks.ReentrantLock; >> + >> +import net.sf.ehcache.Cache; >> +import net.sf.ehcache.CacheEntry; >> +import net.sf.ehcache.CacheException; >> +import net.sf.ehcache.Ehcache; >> +import net.sf.ehcache.Element; >> +import net.sf.ehcache.Status; >> +import net.sf.ehcache.pool.Pool; >> +import net.sf.ehcache.pool.PoolableStore; >> +import net.sf.ehcache.store.AbstractStore; >> +import net.sf.ehcache.store.ElementValueComparator; >> +import net.sf.ehcache.store.Policy; >> +import net.sf.ehcache.store.TierableStore; >> +import net.sf.ehcache.store.disk.StoreUpdateException; >> +import net.sf.ehcache.writer.CacheWriterManager; >> + >> +import org.apache.directmemory.cache.CacheServiceImpl; >> +import org.apache.directmemory.measures.Ram; >> +import org.apache.directmemory.memory.OffHeapMemoryBuffer; >> +import org.apache.directmemory.memory.Pointer; >> +import org.slf4j.Logger; >> +import org.slf4j.LoggerFactory; >> + >> +public class DirectMemoryStore >> + =C2=A0 =C2=A0extends AbstractStore >> + =C2=A0 =C2=A0implements TierableStore, PoolableStore >> +{ >> + >> + =C2=A0 =C2=A0private static Logger logger =3D LoggerFactory.getLogger(= CacheServiceImpl.class ); >> + >> + =C2=A0 =C2=A0public static final int DEFAULT_NUMBER_BYTE_BUFFERS =3D 6= 4; >> + >> + =C2=A0 =C2=A0public static final int DEFAULT_BUFFER_SIZE =3D Ram.Mb( 4= 0 ); >> + >> + =C2=A0 =C2=A0private List bufferLocks; >> + >> + =C2=A0 =C2=A0DirectMemoryCache directMemoryCache; >> + >> + =C2=A0 =C2=A0public DirectMemoryStore( Ehcache cache, Pool offHeapPool ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0this( cache, offHeapPool, false ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public DirectMemoryStore( Ehcache cache, Pool offHeapPool, boolean doNotifications ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0long offHeapSizeBytes; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( cache =3D=3D null || cache.getCacheCon= figuration() =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0offHeapSizeBytes =3D Ram.Mb( = 64 ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0offHeapSizeBytes =3D cache.ge= tCacheConfiguration().getMaxMemoryOffHeapInBytes(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0init( offHeapSizeBytes ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public DirectMemoryStore( long offHeapSizeBytes ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0init( offHeapSizeBytes ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0private void init( long offHeapSizeBytes ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( " =C2=A0 ___ =C2=A0 __ =C2=A0_= _ _ =C2=A0 _ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ____ = =C2=A0_ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( " =C2=A0/ _ \\ / _|/ _| | | | = ___ =C2=A0__ _ _ __/ ___|| |_ ___ =C2=A0_ __ ___ " ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( " | | | | |_| |_| |_| |/ _ \\/= _` | '_ \\___ \\| __/ _ \\| '__/ _ \\" ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( " | |_| | =C2=A0_| =C2=A0_| = =C2=A0_ =C2=A0| =C2=A0__/ (_| | |_) |__) | || (_) | | | =C2=A0__/" ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( " =C2=A0\\___/|_| |_| |_| |_|\= \___|\\__,_| .__/____/ \\__\\___/|_| =C2=A0\\___|" ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( " =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0|_| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " ); >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( "default buffer size =3D " + D= EFAULT_BUFFER_SIZE ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( "off heap size =3D " + offHeap= SizeBytes ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0int numberOfBuffers =3D (int) ( offHeapSize= Bytes / DEFAULT_BUFFER_SIZE ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0numberOfBuffers =3D DEFAULT_NUMBER_BYTE_BUF= FERS; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( "no of buffers =3D " + numberO= fBuffers ); >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0this.bufferLocks =3D new ArrayList( numberOfBuffers ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0for ( int i =3D 0; i < numberOfBuffers; i++= ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0this.bufferLocks.add( new Ree= ntrantLock() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCache =3D new DirectMemoryCache= ( numberOfBuffers, >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(int) ( offHeapSizeBytes / numberOfBuffers ) ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void unpinAll() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean isPinned( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void setPinned( Object key, boolean pinned ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean put( Element element ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws CacheException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Pointer pointer =3D null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0try >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pointer =3D directMemoryCache= .put( element.getObjectKey(), element ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0catch ( BufferOverflowException boe ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dump(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0throw new CacheException( "Di= rectMemory OffHeap Memory Exceeded", boe ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return null =3D=3D pointer ? false : true; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean putWithWriter( Element element, CacheWrite= rManager writerManager ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws CacheException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0boolean newPut =3D put( element ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( writerManager !=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0try >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0writerManager.p= ut( element ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0catch ( RuntimeException e ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0throw new Store= UpdateException( e, !newPut ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return newPut; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Element get( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return directMemoryCache.retrieve( key ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Element getQuiet( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return get( key ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public List getKeys() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return new ArrayList( directMemoryC= ache.getKeys() ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Element remove( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Element element =3D get( key ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCache.free( key ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return element; >> + >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Element removeWithWriter( Object key, CacheWriterM= anager writerManager ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws CacheException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Element removed =3D remove( key ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( writerManager !=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0writerManager.remove( new Cac= heEntry( key, removed ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return removed; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void removeAll() >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws CacheException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCache.clear(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Element putIfAbsent( Element element ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws NullPointerException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Element returnElement =3D get( element.getO= bjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( null =3D=3D returnElement ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0put( element ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0returnElement =3D element; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return returnElement; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Element removeElement( Element element, ElementVal= ueComparator comparator ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws NullPointerException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( element =3D=3D null || element.getObje= ctKey() =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Pointer pointer =3D directMemoryCa= che.getPointer( element.getObjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( pointer =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Lock lock =3D bufferLocks.get( pointer.buff= erNumber ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0lock.lock(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0try >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Element toRemove =3D directMe= moryCache.retrieve( element.getObjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( comparator.equals( eleme= nt, toRemove ) ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCac= he.free( element.getObjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return toRemove= ; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0finally >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lock.unlock(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean replace( Element old, Element element, Ele= mentValueComparator comparator ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws NullPointerException, IllegalArgumen= tException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( element =3D=3D null || element.getObje= ctKey() =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Pointer pointer =3D directMemoryCa= che.getPointer( element.getObjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( pointer =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Lock lock =3D bufferLocks.get( pointer.buff= erNumber ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0lock.lock(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0try >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Element toUpdate =3D directMe= moryCache.retrieve( element.getObjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( comparator.equals( old, = toUpdate ) ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCac= he.put( element.getObjectKey(), element ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return true; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0catch ( BufferOverflowException boe ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dump(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0throw new CacheException( "Di= rectMemory OffHeap Memory Exceeded", boe ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0finally >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lock.unlock(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Element replace( Element element ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws NullPointerException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( element =3D=3D null || element.getObje= ctKey() =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Pointer pointer =3D directMemoryCa= che.getPointer( element.getObjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( pointer =3D=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Lock lock =3D bufferLocks.get( pointer.buff= erNumber ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0lock.lock(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0try >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Element toUpdate =3D directMe= moryCache.retrieve( element.getObjectKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( null !=3D toUpdate ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCac= he.put( element.getObjectKey(), element ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return toUpdate= ; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0catch ( BufferOverflowException boe ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dump(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0throw new CacheException( "Di= rectMemory OffHeap Memory Exceeded", boe ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0finally >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lock.unlock(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public synchronized void dispose() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0flush(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public int getSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return getOffHeapSize(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public int getInMemorySize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public int getOffHeapSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0long size =3D directMemoryCache.size(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( size > Integer.MAX_VALUE ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return Integer.MAX_VALUE; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (int) size; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public int getOnDiskSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public int getTerracottaClusteredSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public long getInMemorySizeInBytes() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public long getOffHeapSizeInBytes() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return directMemoryCache.sizeInBytes(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public long getOnDiskSizeInBytes() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Status getStatus() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean containsKey( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return containsKeyOffHeap( key ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean containsKeyOnDisk( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean containsKeyOffHeap( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return directMemoryCache.containsKey( key )= ; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean containsKeyInMemory( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void expireElements() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void flush() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCache.clear(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean bufferFull() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//never backs up/ no buffer used. >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Policy getInMemoryEvictionPolicy() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void setInMemoryEvictionPolicy( Policy policy ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Object getInternalContext() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public Object getMBean() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return null; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean evictFromOnHeap( int count, long size ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean evictFromOnDisk( int count, long size ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public float getApproximateDiskHitRate() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public float getApproximateDiskMissRate() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public long getApproximateDiskCountSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public long getApproximateDiskByteSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public float getApproximateHeapHitRate() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public float getApproximateHeapMissRate() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public long getApproximateHeapCountSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public long getApproximateHeapByteSize() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void fill( Element e ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0put( e ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public boolean removeIfTierNotPinned( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return false; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Override >> + =C2=A0 =C2=A0public void removeNoReturn( Object key ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0//no operation >> + >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void dump() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0directMemoryCache.dump(); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void dumpTotal() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0long capacity =3D 0; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0long used =3D 0; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0for ( OffHeapMemoryBuffer buffer := directMemoryCache.getMemoryManager().getBuffers() ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0capacity +=3D buffer.capacity= (); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0used +=3D buffer.used(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( "***Totals********************= *******************" ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( format( "off-heap - # buffers:= \t%1d", directMemoryCache.getMemoryManager().getBuffers().size() ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( format( "off-heap - allocated:= \t%1s", Ram.inMb( capacity ) ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( format( "off-heap - used: =C2= =A0 =C2=A0 =C2=A0\t%1s", Ram.inMb( used ) ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( format( "heap =C2=A0 =C2=A0 - = max: \t%1s", Ram.inMb( Runtime.getRuntime().maxMemory() ) ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( format( "heap =C2=A0 =C2=A0 - = allocated: \t%1s", Ram.inMb( Runtime.getRuntime().totalMemory() ) ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( format( "heap =C2=A0 =C2=A0 - = free : \t%1s", Ram.inMb( Runtime.getRuntime().freeMemory() ) ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0logger.info( "*****************************= *******************" ); >> + =C2=A0 =C2=A0} >> +} >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/main/java/o= rg/apache/directmemory/ehcache/NotifyingDirectMemoryStore.java >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/main/java/org/apache/directmemory/ehcache/NotifyingDirectMe= moryStore.java?rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/ehcache/NotifyingDirectMemoryStore.java (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/ehcache/NotifyingDirectMemoryStore.java Sat Feb 25 10:1= 6:25 2012 >> @@ -0,0 +1,71 @@ >> +package org.apache.directmemory.ehcache; >> + >> +/* >> + * Licensed to the Apache Software Foundation (ASF) under one >> + * or more contributor license agreements. =C2=A0See the NOTICE file >> + * distributed with this work for additional information >> + * regarding copyright ownership. =C2=A0The ASF licenses this file >> + * to you under the Apache License, Version 2.0 (the >> + * "License"); you may not use this file except in compliance >> + * with the License. =C2=A0You may obtain a copy of the License at >> + * >> + * =C2=A0http://www.apache.org/licenses/LICENSE-2.0 >> + * >> + * Unless required by applicable law or agreed to in writing, >> + * software distributed under the License is distributed on an >> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> + * KIND, either express or implied. =C2=A0See the License for the >> + * specific language governing permissions and limitations >> + * under the License. >> + */ >> + >> +import net.sf.ehcache.Ehcache; >> +import net.sf.ehcache.Element; >> +import net.sf.ehcache.pool.Pool; >> +import net.sf.ehcache.pool.PoolableStore; >> + >> +public class NotifyingDirectMemoryStore >> + =C2=A0 =C2=A0extends DirectMemoryStore >> +{ >> + >> + =C2=A0 =C2=A0private final Ehcache cache; >> + >> + =C2=A0 =C2=A0private NotifyingDirectMemoryStore( Ehcache cache, Pool pool ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0super( cache, pool, true ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0this.cache =3D cache; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public static NotifyingDirectMemoryStore create( Ehcache = cache, Pool pool ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0NotifyingDirectMemoryStore store =3D new No= tifyingDirectMemoryStore( cache, pool ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return store; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0protected boolean evict( Element element ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Element remove =3D remove( element.getObjec= tKey() ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( remove !=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0this.cache.getCacheEventNotif= icationService().notifyElementEvicted( element, false ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return remove !=3D null; >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0protected void notifyDirectEviction( Element element ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0this.cache.getCacheEventNotificationService= ().notifyElementEvicted( element, false ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0public void expireElements() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0for ( Object key : this.getKeys() ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0//expire element check if it = is expired, if it is expired remove from cache and return element >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0//.iskeyvalid() >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Element element =3D remove( k= ey ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( element !=3D null ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0this.cache.getC= acheEventNotificationService().notifyElementExpiry( element, false ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0} >> +} >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/main/java/o= rg/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyEhcac= heImpl.java >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/main/java/org/apache/directmemory/memory/MemoryManagerServi= ceWithAllocationPolicyEhcacheImpl.java?rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyEhcacheI= mpl.java (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/= apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyEhcacheI= mpl.java Sat Feb 25 10:16:25 2012 >> @@ -0,0 +1,39 @@ >> +package org.apache.directmemory.memory; >> + >> +/* >> + * Licensed to the Apache Software Foundation (ASF) under one >> + * or more contributor license agreements. =C2=A0See the NOTICE file >> + * distributed with this work for additional information >> + * regarding copyright ownership. =C2=A0The ASF licenses this file >> + * to you under the Apache License, Version 2.0 (the >> + * "License"); you may not use this file except in compliance >> + * with the License. =C2=A0You may obtain a copy of the License at >> + * >> + * =C2=A0http://www.apache.org/licenses/LICENSE-2.0 >> + * >> + * Unless required by applicable law or agreed to in writing, >> + * software distributed under the License is distributed on an >> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> + * KIND, either express or implied. =C2=A0See the License for the >> + * specific language governing permissions and limitations >> + * under the License. >> + */ >> + >> +/** >> + * Extends {@link MemoryManagerServiceWithAllocationPolicyImpl} >> + * to force {@link AllocationPolicy} in constructor and set >> + * the behavior to thrown an exception when the buffers are full. >> + * >> + */ >> +public class MemoryManagerServiceWithAllocationPolicyEhcacheImpl >> + =C2=A0 =C2=A0extends MemoryManagerServiceWithAllocationPolicyImpl >> +{ >> + >> + =C2=A0 =C2=A0public MemoryManagerServiceWithAllocationPolicyEhcacheImp= l( AllocationPolicy allocationPolicy ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0super(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0this.setAllocationPolicy( allocationPolicy = ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0this.returnNullWhenFull =3D false; >> + =C2=A0 =C2=A0} >> + >> +} >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/test/java/o= rg/apache/directmemory/ehcache/EHCacheTest.java >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/test/java/org/apache/directmemory/ehcache/EHCacheTest.java?= rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/test/java/org/= apache/directmemory/ehcache/EHCacheTest.java (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/test/java/org/= apache/directmemory/ehcache/EHCacheTest.java Sat Feb 25 10:16:25 2012 >> @@ -0,0 +1,103 @@ >> +package org.apache.directmemory.ehcache; >> + >> +/* >> + * Licensed to the Apache Software Foundation (ASF) under one >> + * or more contributor license agreements. =C2=A0See the NOTICE file >> + * distributed with this work for additional information >> + * regarding copyright ownership. =C2=A0The ASF licenses this file >> + * to you under the Apache License, Version 2.0 (the >> + * "License"); you may not use this file except in compliance >> + * with the License. =C2=A0You may obtain a copy of the License at >> + * >> + * =C2=A0http://www.apache.org/licenses/LICENSE-2.0 >> + * >> + * Unless required by applicable law or agreed to in writing, >> + * software distributed under the License is distributed on an >> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> + * KIND, either express or implied. =C2=A0See the License for the >> + * specific language governing permissions and limitations >> + * under the License. >> + */ >> + >> +import java.io.IOException; >> + >> +import net.sf.ehcache.CacheException; >> +import net.sf.ehcache.CacheManager; >> +import net.sf.ehcache.Ehcache; >> +import net.sf.ehcache.Element; >> + >> +import org.junit.Assert; >> +import org.junit.Test; >> + >> +public class EHCacheTest >> +{ >> + >> + =C2=A0 =C2=A0@Test >> + =C2=A0 =C2=A0public void testPutRetreive() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0CacheManager cacheManager =3D CacheManager.= getInstance(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Ehcache ehcache =3D cacheManager.getEhcache= ( "testCache" ); >> + >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0ehcache.put( new Element( "testKey", "testV= alue" ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0stats( ehcache ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Assert.assertEquals( "testValue", ehcache.g= et( "testKey" ).getObjectValue() ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Test >> + =C2=A0 =C2=A0public void testSizing() >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0CacheManager cacheManager =3D CacheManager.= getInstance(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Ehcache ehcache =3D cacheManager.getEhcache= ( "testCache" ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0for ( int i =3D 0; i < 30000; i++ ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( ( i % 1000 ) =3D=3D 0 ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.prin= tln( "heatbeat " + i ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stats( ehcache = ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ehcache.put( new Element( i, = new byte[1024] ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0stats( ehcache ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Assert.assertTrue( true ); >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0@Test >> + =C2=A0 =C2=A0public void testOffHeapExceedMemory() >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0throws IOException >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0CacheManager cacheManager =3D CacheManager.= getInstance(); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Ehcache ehcache =3D cacheManager.getEhcache= ( "testCache" ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0Element element =3D null; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0try >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for ( int i =3D 0; i < 300000= 0; i++ ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ( ( i % 1000= ) =3D=3D 0 ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0S= ystem.out.println( "heatbeat " + i ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0s= tats( ehcache ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0element =3D new= Element( i, new byte[1024] ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ehcache.put( el= ement ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Assert.fail( "CacheException = expected for DirectMemory OffHeap Memory Exceeded" ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0catch ( CacheException e ) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stats( ehcache ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Assert.assertTrue( "CacheExce= ption expected for DirectMemory OffHeap Memory Exceeded", true ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0} >> + >> + =C2=A0 =C2=A0private void stats( Ehcache ehcache ) >> + =C2=A0 =C2=A0{ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.println( "OnHeapSize=3D" + ehcac= he.calculateInMemorySize() + ", OnHeapElements=3D" >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+ ehcache.getMemoryStoreSize(= ) ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.println( "OffHeapSize=3D" + ehca= che.calculateOffHeapSize() + ", OffHeapElements=3D" >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+ ehcache.getOffHeapStoreSize= () ); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0System.out.println( "DiskStoreSize=3D" + eh= cache.calculateOnDiskSize() + ", DiskStoreElements=3D" >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+ ehcache.getDiskStoreSize() = ); >> + =C2=A0 =C2=A0} >> + >> +} >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/test/resour= ces/ehcache.xml >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/test/resources/ehcache.xml?rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/test/resources= /ehcache.xml (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/test/resources= /ehcache.xml Sat Feb 25 10:16:25 2012 >> @@ -0,0 +1,31 @@ >> + >> + >> + >> + =C2=A0 =C2=A0 >> + >> + =C2=A0 =C2=A0> + =C2=A0 =C2=A0 =C2=A0eternal=3D"false" >> + =C2=A0 =C2=A0 =C2=A0diskPersistent=3D"false" >> + =C2=A0 =C2=A0 =C2=A0overflowToOffHeap=3D"true" >> + =C2=A0 =C2=A0 =C2=A0maxElementsInMemory=3D"30" >> + =C2=A0 =C2=A0 =C2=A0maxBytesLocalOffHeap=3D"100M" >> + =C2=A0 =C2=A0/> >> + >> + >> \ No newline at end of file >> >> Added: incubator/directmemory/trunk/integrations/ehcache/src/test/resour= ces/logback-test.xml >> URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrati= ons/ehcache/src/test/resources/logback-test.xml?rev=3D1293567&view=3Dauto >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/directmemory/trunk/integrations/ehcache/src/test/resources= /logback-test.xml (added) >> +++ incubator/directmemory/trunk/integrations/ehcache/src/test/resources= /logback-test.xml Sat Feb 25 10:16:25 2012 >> @@ -0,0 +1,54 @@ >> + >> + >> + >> + >> + =C2=A0 >> + =C2=A0 =C2=A0 >> + =C2=A0 =C2=A0 =C2=A0%d{HH:mm:ss.SSS} [%thread] %-5level %meth= od - %msg%n >> + =C2=A0 =C2=A0 >> + =C2=A0 >> + >> + >> + =C2=A0 >> + =C2=A0 =C2=A0 >> + >> + =C2=A0 >> + >> + =C2=A0 >> + =C2=A0 =C2=A0 >> + >> + =C2=A0 >> + >> + =C2=A0 >> + =C2=A0 =C2=A0 >> + >> + =C2=A0 >> + >> + =C2=A0 >> + =C2=A0 =C2=A0 >> + >> + =C2=A0 >> + >> + =C2=A0 >> + =C2=A0 =C2=A0 >> + >> + =C2=A0 >> + >> + >> \ No newline at end of file >> >> --=20 sent from my Nokia 3210