ehcache

net.sf.ehcache.store.disk
Class DiskSizeOfEngine

java.lang.Object
  extended by net.sf.ehcache.store.disk.DiskSizeOfEngine
All Implemented Interfaces:
SizeOfEngine

public class DiskSizeOfEngine
extends Object
implements SizeOfEngine

SizeOf engine which calculates exact usage of the disk store.

Author:
Ludovic Orban

Constructor Summary
DiskSizeOfEngine()
           
 
Method Summary
 SizeOfEngine copyWith(int maxDepth, boolean abortWhenMaxDepthExceeded)
          Make a copy of the SizeOf engine, preserving all of its internal state but overriding the specified parameters
 Size sizeOf(Object key, Object value, Object container)
          Size an element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskSizeOfEngine

public DiskSizeOfEngine()
Method Detail

sizeOf

public Size sizeOf(Object key,
                   Object value,
                   Object container)
Size an element

Specified by:
sizeOf in interface SizeOfEngine
Parameters:
key - the key of the element
value - the value of the element
container - the container of the element, ie: element object + eventual overhead
Returns:
the size of the element in bytes

copyWith

public SizeOfEngine copyWith(int maxDepth,
                             boolean abortWhenMaxDepthExceeded)
Make a copy of the SizeOf engine, preserving all of its internal state but overriding the specified parameters

Specified by:
copyWith in interface SizeOfEngine
Parameters:
maxDepth - maximum depth of the object graph to traverse
abortWhenMaxDepthExceeded - true if the object traversal should be aborted when the max depth is exceeded
Returns:
a copy of the SizeOf engine using the specified parameters

ehcache

Copyright 2001-2017, Terracotta, Inc.