|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaseis.io.ExtentManager
public class ExtentManager
Nested Class Summary | |
---|---|
class |
ExtentManager.ExtentListCompare
Manage VirtualIO extents for spreading data across multiple file systems |
class |
ExtentManager.ExtentListContains
|
Field Summary | |
---|---|
protected int |
currentDirIndex
|
protected ExtentListEntry |
currentExtent
|
protected java.lang.String |
extentBaseName
|
protected long |
extentCreateSize
|
protected java.lang.String[] |
extentDirs
|
protected java.util.List<ExtentListEntry> |
extentList
|
protected ExtentPolicy |
extentPolicy
|
protected SeisProperties |
extentProperties
|
protected long |
ioTime
|
protected boolean |
isChanged
|
protected long |
lockTime
|
static java.util.logging.Logger |
LOG
|
protected long |
maxFreeSpace
|
protected long |
minFreeSpace
|
protected boolean |
readOnly
|
protected long |
t0
|
protected boolean |
trackTime
|
protected static java.lang.String |
vfioHeader
|
protected boolean |
vfioLock
|
protected int |
vfioMaxFiles
|
protected long |
vfioMaxPosition
|
protected int |
vfioNdirs
|
protected int |
vfioNfiles
|
protected boolean |
vfioOpen
|
protected static java.lang.String |
vfioVersion
|
Constructor Summary | |
---|---|
ExtentManager(java.lang.String virtualFileProperties,
java.lang.String mode,
java.lang.String[] altDirectories)
Create an extent manager for an existing virtual file |
|
ExtentManager(java.lang.String virtualFileProperties,
java.lang.String extentBaseName,
java.lang.String[] extentDirectories,
long fileLength,
int numExtents)
Create an extent manager for a new virtual file |
|
ExtentManager(java.lang.String virtualFileProperties,
java.lang.String extentBaseName,
java.lang.String[] extentDirectories,
long fileLength,
int numExtents,
ExtentPolicy policy)
Create an extent manager for a new virtual file |
|
ExtentManager(java.lang.String virtualFileProperties,
java.lang.String extentBaseName,
java.lang.String[] extentDirectories,
long fileLength,
int numExtents,
ExtentPolicy policy,
IParallelContext pc)
Create an extent manager for a new virtual file in a parallel context |
Method Summary | |
---|---|
int |
addExtent(long startPosition,
long extentSizeBytes)
Add an extent to a virtual file. |
protected void |
allocateExtents()
Create all extents for a new virtual file based on extentPolicy |
void |
close()
Close this extent manager and release resources |
void |
create(java.lang.String virtualFileProperties,
java.lang.String[] extentDirectories)
Check extent directories for validity and create Virtual File Properties |
static boolean |
delete(java.lang.String path)
Delete the extents and properties files used by this virtual file |
boolean |
deleteExtents()
Delete the extents for this virtual file |
boolean |
extentExists(long position)
Determine if the virtual file has an existing extent that contains a specified file position in bytes |
java.lang.String |
findExtent(long position)
Search for the extent that contains a given file position |
int |
getExtentIndex(long position)
Return the index in the extent list of the extent that contains a specified file position. |
java.lang.String |
getExtentPath(int index)
Return the path of the extent specified by index in the extent list |
long |
getExtentSize()
|
float |
getIoTime()
Return the time in seconds spent in lock routines |
float |
getLockTime()
Return the time in seconds spent in lock routines |
long |
getStartOffset()
|
static boolean |
isVirtual(java.lang.String path)
Return true if a path points to a valid virtual file |
static void |
main(java.lang.String[] args)
Test harness for basic functionality. |
void |
reload()
Reload properties from disk |
boolean |
setMinMaxSpace(long minSpaceBytes,
long maxSpaceBytes)
Set the min and max space parameters for POLICY_MINMAX Directories with space less than minSpaceBytes are excluded as locations, directories with space greater than maxSpaceBytes are preferred over the rest. |
protected void |
setPolicy(ExtentPolicy policy)
Set the policy to use for allocating extents to directories, from: ExentPolicy |
void |
trackTime(boolean trackTime)
Set flag for I/O and lock time tracking |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int currentDirIndex
protected ExtentListEntry currentExtent
protected java.lang.String extentBaseName
protected long extentCreateSize
protected java.lang.String[] extentDirs
protected java.util.List<ExtentListEntry> extentList
protected ExtentPolicy extentPolicy
protected SeisProperties extentProperties
protected long ioTime
protected boolean isChanged
protected long lockTime
public static final java.util.logging.Logger LOG
protected long maxFreeSpace
protected long minFreeSpace
protected boolean readOnly
protected long t0
protected boolean trackTime
protected static java.lang.String vfioHeader
protected boolean vfioLock
protected int vfioMaxFiles
protected long vfioMaxPosition
protected int vfioNdirs
protected int vfioNfiles
protected boolean vfioOpen
protected static java.lang.String vfioVersion
Constructor Detail |
---|
public ExtentManager(java.lang.String virtualFileProperties, java.lang.String mode, java.lang.String[] altDirectories) throws SeisException
virtualFileProperties
- file containing virtual file propertiesmode
- Open mode for file, "r" for read only, "rw" for read/writealtDirectories
- An optional list of alternate directories to search
SeisException
- on file not found, invalid directories, or permissionspublic ExtentManager(java.lang.String virtualFileProperties, java.lang.String extentBaseName, java.lang.String[] extentDirectories, long fileLength, int numExtents) throws SeisException
virtualFileProperties
- path name for the virtual file properties to createextentBaseName
- base name for extentsextentDirectories
- locations where extents can be createdfileLength
- file length in bytesnumExtents
- number of extents to break file into
SeisException
- on file system errorspublic ExtentManager(java.lang.String virtualFileProperties, java.lang.String extentBaseName, java.lang.String[] extentDirectories, long fileLength, int numExtents, ExtentPolicy policy) throws SeisException
virtualFileProperties
- path name for the virtual file properties to createextentBaseName
- base name for extentsextentDirectories
- locations where extents can be createdfileLength
- file length in bytesnumExtents
- number of extents to break file into
SeisException
- on file system errorspublic ExtentManager(java.lang.String virtualFileProperties, java.lang.String extentBaseName, java.lang.String[] extentDirectories, long fileLength, int numExtents, ExtentPolicy policy, IParallelContext pc) throws SeisException
parallelContext
- -
parallel context to use for synchronized creationvirtualFileProperties
- path name for the virtual file properties to createextentBaseName
- base name for extentsextentDirectories
- locations where extents can be createdfileLength
- file length in bytesnumExtents
- number of extents to break file into
SeisException
- on file system errorsMethod Detail |
---|
public int addExtent(long startPosition, long extentSizeBytes) throws SeisException
startPosition
- starting position in bytes for the extentextentSizeBytes
- size of the extent to be added in bytes
SeisException
- on extent creation errorsprotected void allocateExtents() throws SeisException
SeisException
public void close() throws SeisException
SeisException
- on property file errorspublic void create(java.lang.String virtualFileProperties, java.lang.String[] extentDirectories) throws SeisException
virtualFileProperties
- extentDirectories
-
SeisException
- on create errorspublic static boolean delete(java.lang.String path)
path
- full path to the properties file for the virtual file
public boolean deleteExtents()
public boolean extentExists(long position)
position
- Virtual File file position in bytes
public java.lang.String findExtent(long position)
position
- file position for the search
public int getExtentIndex(long position)
position
- location in the virtual file in bytes
public java.lang.String getExtentPath(int index)
index
- index of the desired extent
public long getExtentSize()
public float getIoTime()
public float getLockTime()
public long getStartOffset()
public static boolean isVirtual(java.lang.String path)
path
- full path name to virtual file properties
public static void main(java.lang.String[] args) throws SeisException
args
-
SeisException
public void reload() throws SeisException
SeisException
- on I/O errorspublic boolean setMinMaxSpace(long minSpaceBytes, long maxSpaceBytes)
minSpaceBytes
- minimum space in bytesmaxSpaceBytes
- maximum space in bytes
protected void setPolicy(ExtentPolicy policy)
policy
- one of the valid policy selectionspublic void trackTime(boolean trackTime)
trackTime
- set to true to turn on time tracking
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |