|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.nutch.ndfs.FSDirectory
FSDirectory stores the filesystem directory state. It handles writing/loading values to disk, and logging changes as we go. It keeps the filename->blockset mapping always-current and logged to disk.
Field Summary |
Constructor Summary | |
FSDirectory(File dir)
Create a FileSystem directory, and load its info from the indicated place. |
Method Summary | |
boolean |
addFile(UTF8 src,
Block[] blocks)
Add the given filename to the fs. |
void |
close()
Shutdown the filestore |
Block[] |
delete(UTF8 src)
Remove the file from management, return blocks |
Block[] |
getFile(UTF8 src)
Get the blocks associated with the file |
NDFSFileInfo[] |
getListing(UTF8 src)
Get a listing of files given path 'src' This function is admittedly very inefficient right now. |
boolean |
isDir(UTF8 src)
Check whether it's a directory |
boolean |
isValidBlock(Block b)
Returns whether the given block is one pointed-to by a file. |
boolean |
isValidToCreate(UTF8 src)
Check whether the filepath could be created |
boolean |
mkdirs(UTF8 src)
Create the given directory and all its parent dirs. |
int |
obtainLock(UTF8 src,
UTF8 holder,
boolean exclusive)
|
int |
releaseLock(UTF8 src,
UTF8 holder)
|
boolean |
renameTo(UTF8 src,
UTF8 dst)
Change the filename |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FSDirectory(File dir) throws IOException
Method Detail |
public void close() throws IOException
IOException
public boolean addFile(UTF8 src, Block[] blocks)
public boolean renameTo(UTF8 src, UTF8 dst)
public Block[] delete(UTF8 src)
public int obtainLock(UTF8 src, UTF8 holder, boolean exclusive)
public int releaseLock(UTF8 src, UTF8 holder)
public NDFSFileInfo[] getListing(UTF8 src)
public Block[] getFile(UTF8 src)
public boolean isValidToCreate(UTF8 src)
public boolean isDir(UTF8 src)
public boolean mkdirs(UTF8 src)
public boolean isValidBlock(Block b)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |