org.ozoneDB.core.storage.gammaStore
Class FreeSpaceManager
java.lang.Object
org.ozoneDB.core.storage.gammaStore.FreeSpaceManager
- All Implemented Interfaces:
- PropertyConfigurable
- public final class FreeSpaceManager
- extends java.lang.Object
- implements PropertyConfigurable
Constructor Summary |
FreeSpaceManager()
|
FreeSpaceManager(java.util.Properties properties,
java.lang.String prefix)
As prescribed by the PropertyConfigurable interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAXFREESPACESIZEDIFFERENCE
public static final PropertyInfo MAXFREESPACESIZEDIFFERENCE
MAXSIZE
public static final PropertyInfo MAXSIZE
freeSpaces
private java.util.TreeSet freeSpaces
maxSizeDifference
private int maxSizeDifference
maxSize
private int maxSize
prefix
private java.lang.String prefix
FreeSpaceManager
public FreeSpaceManager()
FreeSpaceManager
public FreeSpaceManager(java.util.Properties properties,
java.lang.String prefix)
- As prescribed by the
PropertyConfigurable
interface.
findFreeSpace
public FreeSpace findFreeSpace(int size)
- Returns a block of free space in a cluster when there is free space that
is equal or grater than the specified size and smaller or equal to the
specified size plus
getMaxSizeDifference()
. The returned
FreeSpace
is no longer regarded as 'free'. If no apropriate
free space is found, then a null
value is returned.
- Returns:
- a free block of space, or
null
if there is none
registerFreespace
public void registerFreespace(FreeSpace freeSpace)
- Registers a block of free space.
registerFreespace
public void registerFreespace(int clusterId,
int position,
int size)
getMaxFreeSpaceSizeDifference
public int getMaxFreeSpaceSizeDifference()
setMaxFreeSpaceSizeDifference
public void setMaxFreeSpaceSizeDifference(int maxSizeDifference)
getMaxSize
public int getMaxSize()
setMaxSize
public void setMaxSize(int maxSize)
getPropertyInfos
public java.util.Collection getPropertyInfos()
- Description copied from interface:
PropertyConfigurable
Returns a Collection
with all the properties this instance
supports.
- Specified by:
getPropertyInfos
in interface PropertyConfigurable
- Returns:
- Collection with
PropertyInfo
elements
getPrefix
public java.lang.String getPrefix()
- Specified by:
getPrefix
in interface PropertyConfigurable
Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.