org.javaseis.io
Class ExtentManager.ExtentListCompare

java.lang.Object
  extended by org.javaseis.io.ExtentManager.ExtentListCompare
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator
Enclosing class:
ExtentManager

public class ExtentManager.ExtentListCompare
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

Manage VirtualIO extents for spreading data across multiple file systems

This class provides methods managing file "extents" that make up a virtual file. Variable length extents are supported, as are sparse files. In order to support renaming operations, the directories in which extents are stored are managed separately from the extent names. The full path to an extent is constructed from a directory name from a list of available directories, and the extent name.

An extent is defined by the ExtentListEntry class, which stores the extent name, the index of the directory in which the extent is located, the starting offset of the extent, and the extent length. Extents are allocated "on the fly" and are added to a list of extent entries managed by the ExtentManager class. Extents are assigned a directory index, which points to one of the directories from a list of allowed locations supplied to the constructor. A number of "policies" are provided that define the rules for extent allocation:

  • POLICY_LARGEST = allocate extent on directory with the most available space
  • POLICY_CIRCULAR = Use a random number to pick the directory for the first extent, with "round-robin" allocation for subsequent extents
  • POLICY_RANDOM = Use random number generator to pick a directory
  • POLICY_MINMAX = Use minimum and maximum free space parameters to reject directories with too little space, and to prefer directories with more space, followed by a random pick
  • Author:
    Chuck Mosher for JavaSeis.org 5/31/2006
    See Also:
    Serialized Form

    Constructor Summary
    protected ExtentManager.ExtentListCompare()
               
     
    Method Summary
     int compare(java.lang.Object ao, java.lang.Object bo)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface java.util.Comparator
    equals
     

    Constructor Detail

    ExtentManager.ExtentListCompare

    protected ExtentManager.ExtentListCompare()
    Method Detail

    compare

    public int compare(java.lang.Object ao,
                       java.lang.Object bo)
    Specified by:
    compare in interface java.util.Comparator