ozone core API

org.ozoneDB.core.storage.gammaStore
Class FreeSpaceManager

java.lang.Object
  extended byorg.ozoneDB.core.storage.gammaStore.FreeSpaceManager
All Implemented Interfaces:
PropertyConfigurable

public final class FreeSpaceManager
extends java.lang.Object
implements PropertyConfigurable


Field Summary
private  java.util.TreeSet freeSpaces
           
static PropertyInfo MAXFREESPACESIZEDIFFERENCE
           
private  int maxSize
           
static PropertyInfo MAXSIZE
           
private  int maxSizeDifference
           
private  java.lang.String prefix
           
 
Constructor Summary
FreeSpaceManager()
           
FreeSpaceManager(java.util.Properties properties, java.lang.String prefix)
          As prescribed by the PropertyConfigurable interface.
 
Method Summary
 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().
 int getMaxFreeSpaceSizeDifference()
           
 int getMaxSize()
           
 java.lang.String getPrefix()
           
 java.util.Collection getPropertyInfos()
          Returns a Collection with all the properties this instance supports.
 void registerFreespace(FreeSpace freeSpace)
          Registers a block of free space.
 void registerFreespace(int clusterId, int position, int size)
           
 void setMaxFreeSpaceSizeDifference(int maxSizeDifference)
           
 void setMaxSize(int maxSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

FreeSpaceManager

public FreeSpaceManager()

FreeSpaceManager

public FreeSpaceManager(java.util.Properties properties,
                        java.lang.String prefix)
As prescribed by the PropertyConfigurable interface.

Method Detail

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

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.