Author: olamy
Date: Sun Feb 26 14:50:32 2012
New Revision: 1293847
URL: http://svn.apache.org/viewvc?rev=1293847&view=rev
Log:
code formatting
Modified:
incubator/directmemory/trunk/integrations/ehcache/src/main/java/net/sf/ehcache/store/offheap/OffHeapStore.java
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryStore.java
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/NotifyingDirectMemoryStore.java
Modified:
incubator/directmemory/trunk/integrations/ehcache/src/main/java/net/sf/ehcache/store/offheap/OffHeapStore.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrations/ehcache/src/main/java/net/sf/ehcache/store/offheap/OffHeapStore.java?rev=1293847&r1=1293846&r2=1293847&view=diff
==============================================================================
---
incubator/directmemory/trunk/integrations/ehcache/src/main/java/net/sf/ehcache/store/offheap/OffHeapStore.java
(original)
+++
incubator/directmemory/trunk/integrations/ehcache/src/main/java/net/sf/ehcache/store/offheap/OffHeapStore.java
Sun Feb 26 14:50:32 2012
@@ -19,8 +19,6 @@ package net.sf.ehcache.store.offheap;
* under the License.
*/
-import java.util.WeakHashMap;
-
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.config.CacheConfiguration;
@@ -31,18 +29,20 @@ import net.sf.ehcache.store.FrontEndCach
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;
+import java.util.WeakHashMap;
+
/**
* This class is simply a connector class into the EHCache for OffHeap.
- * @author michaelandrepearce
*
+ * @author michaelandrepearce
*/
public class OffHeapStore
{
- private static final WeakHashMap<CacheManager, Pool<PoolableStore>>
OFFHEAP_POOLS = new WeakHashMap<CacheManager, Pool<PoolableStore>>();
+ private static final WeakHashMap<CacheManager, Pool<PoolableStore>>
OFFHEAP_POOLS =
+ new WeakHashMap<CacheManager, Pool<PoolableStore>>();
public static Store create( Ehcache cache, String diskStorePath,
Pool<PoolableStore> onHeapPool,
Pool<PoolableStore> onDiskPool )
@@ -75,11 +75,9 @@ public class OffHeapStore
/**
* Creates a persitent-to-disk store for the given cache, using the given
* disk path. Heap and disk usage are not tracked by the returned store.
- *
- * @param cache
- * cache that fronts this store
- * @param diskStorePath
- * disk path to store data in
+ *
+ * @param cache cache that fronts this store
+ * @param diskStorePath disk path to store data in
* @return a fully initialized store
*/
public static Store create( Ehcache cache, String diskStorePath )
Modified:
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java?rev=1293847&r1=1293846&r2=1293847&view=diff
==============================================================================
---
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java
(original)
+++
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java
Sun Feb 26 14:50:32 2012
@@ -19,8 +19,6 @@ package org.apache.directmemory.ehcache;
* 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;
@@ -30,18 +28,18 @@ import org.apache.directmemory.memory.Po
import org.apache.directmemory.memory.RoundRobinAllocationPolicy;
import org.apache.directmemory.serialization.Serializer;
+import java.util.Set;
+
/**
- *
- * @author michaelandrepearce
- *
* @param <K>
* @param <V>
+ * @author michaelandrepearce
*/
public class DirectMemoryCache<K, V>
{
- private MemoryManagerService<V> memoryManager = new
MemoryManagerServiceWithAllocationPolicyImpl<V>(
-
new RoundRobinAllocationPolicy<V>(), false );
+ private MemoryManagerService<V> memoryManager =
+ new MemoryManagerServiceWithAllocationPolicyImpl<V>( new
RoundRobinAllocationPolicy<V>(), false );
private CacheServiceImpl<K, V> cacheService = new CacheServiceImpl<K, V>(
memoryManager );
Modified:
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryStore.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryStore.java?rev=1293847&r1=1293846&r2=1293847&view=diff
==============================================================================
---
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryStore.java
(original)
+++
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryStore.java
Sun Feb 26 14:50:32 2012
@@ -19,15 +19,6 @@ package org.apache.directmemory.ehcache;
* 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;
@@ -41,7 +32,6 @@ 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;
@@ -49,6 +39,14 @@ import org.apache.directmemory.memory.Po
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+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 static java.lang.String.format;
+
public class DirectMemoryStore
extends AbstractStore
implements TierableStore, PoolableStore
@@ -109,8 +107,8 @@ public class DirectMemoryStore
this.bufferLocks.add( new ReentrantLock() );
}
- directMemoryCache = new DirectMemoryCache<Object, Element>(
numberOfBuffers,
- (int) (
offHeapSizeBytes / numberOfBuffers ) );
+ directMemoryCache =
+ new DirectMemoryCache<Object, Element>( numberOfBuffers, (int) (
offHeapSizeBytes / numberOfBuffers ) );
}
@Override
@@ -596,7 +594,8 @@ public class DirectMemoryStore
used += buffer.used();
}
logger.info( "***Totals***************************************" );
- logger.info( format( "off-heap - # buffers: \t%1d",
directMemoryCache.getMemoryManager().getBuffers().size() ) );
+ logger.info(
+ format( "off-heap - # buffers: \t%1d",
directMemoryCache.getMemoryManager().getBuffers().size() ) );
logger.info( format( "off-heap - allocated: \t%1s", Ram.inMb( capacity
) ) );
logger.info( format( "off-heap - used: \t%1s", Ram.inMb( used ) )
);
logger.info( format( "heap - max: \t%1s", Ram.inMb(
Runtime.getRuntime().maxMemory() ) ) );
Modified:
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/NotifyingDirectMemoryStore.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/NotifyingDirectMemoryStore.java?rev=1293847&r1=1293846&r2=1293847&view=diff
==============================================================================
---
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/NotifyingDirectMemoryStore.java
(original)
+++
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/NotifyingDirectMemoryStore.java
Sun Feb 26 14:50:32 2012
@@ -65,7 +65,9 @@ public class NotifyingDirectMemoryStore
//.iskeyvalid()
Element element = remove( key );
if ( element != null )
+ {
this.cache.getCacheEventNotificationService().notifyElementExpiry( element,
false );
+ }
}
}
}