|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.nutch.ndfs.FSNamesystem
The FSNamesystem tracks several important tables. 1) valid fsname --> blocklist (kept on disk, logged) 2) Set of all valid blocks (inverted #1) 3) block --> machinelist (kept in memory, rebuilt dynamically from reports) 4) machine --> blocklist (inverted #2) 5) LRU cache of updated-heartbeat machines
Field Summary | |
static Logger |
LOG
|
Constructor Summary | |
FSNamesystem(File dir)
dir is where the filesystem directory state is stored |
Method Summary | |
boolean |
abandonBlock(Block b,
UTF8 src)
The client would like to let go of the given block |
void |
blockReceived(Block block,
UTF8 name)
The given node is reporting that it received a certain block. |
Block[] |
checkObsoleteBlocks(UTF8 name)
If the node has not been checked in some time, go through its blocks and find which ones are neither valid nor pending. |
void |
close()
|
int |
completeFile(UTF8 src,
UTF8 holder)
Finalize the created file and make it world-accessible. |
DatanodeInfo[] |
datanodeReport()
|
boolean |
delete(UTF8 src)
Remove the indicated filename from the namespace. |
boolean |
exists(UTF8 src)
Return whether the given filename exists |
Object[] |
getAdditionalBlock(UTF8 src)
The client would like to obtain an additional block for the indicated filename (which is being written-to). |
UTF8[] |
getDatanodeHints(UTF8 src,
long offset)
Figure out a few hosts that are likely to contain the block referred to by the given filename, offset pair. |
NDFSFileInfo[] |
getListing(UTF8 src)
Get a listing of all files at 'src'. |
void |
gotHeartbeat(UTF8 name,
long capacity,
long remaining)
The given node has reported in. |
boolean |
isDir(UTF8 src)
Whether the given name is a directory |
boolean |
mkdirs(UTF8 src)
Create all the necessary directories |
int |
obtainLock(UTF8 src,
UTF8 holder,
boolean exclusive)
Get a lock (perhaps exclusive) on the given file |
Object[] |
open(UTF8 src)
The client wants to open the given filename. |
Object[] |
pendingTransfers(DatanodeInfo srcNode,
int maxXfers)
Return with a list of Block/DataNodeInfo sets, indicating where various Blocks should be copied, ASAP. |
void |
processReport(Block[] newReport,
UTF8 name)
The given node is reporting all its blocks. |
Block[] |
recentlyInvalidBlocks(UTF8 name)
Return with a list of Blocks that should be invalidated at the given node. |
int |
releaseLock(UTF8 src,
UTF8 holder)
Release the lock on the given file |
boolean |
renameTo(UTF8 src,
UTF8 dst)
Change the indicated filename. |
void |
renewLease(UTF8 holder)
Renew the lease(s) held by the given client |
Object[] |
startFile(UTF8 src,
UTF8 holder,
boolean overwrite)
The client would like to create a new block for the indicated filename. |
long |
totalCapacity()
Total raw bytes |
long |
totalRemaining()
Total non-used raw bytes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Logger LOG
Constructor Detail |
public FSNamesystem(File dir) throws IOException
Method Detail |
public void close()
public Object[] open(UTF8 src)
public Object[] startFile(UTF8 src, UTF8 holder, boolean overwrite)
public Object[] getAdditionalBlock(UTF8 src)
public boolean abandonBlock(Block b, UTF8 src)
public int completeFile(UTF8 src, UTF8 holder)
public boolean renameTo(UTF8 src, UTF8 dst)
public boolean delete(UTF8 src)
public boolean exists(UTF8 src)
public boolean isDir(UTF8 src)
public boolean mkdirs(UTF8 src)
public UTF8[] getDatanodeHints(UTF8 src, long offset)
public int obtainLock(UTF8 src, UTF8 holder, boolean exclusive)
public int releaseLock(UTF8 src, UTF8 holder)
public void renewLease(UTF8 holder)
public NDFSFileInfo[] getListing(UTF8 src)
public void gotHeartbeat(UTF8 name, long capacity, long remaining)
public void processReport(Block[] newReport, UTF8 name)
public void blockReceived(Block block, UTF8 name)
public long totalCapacity()
public long totalRemaining()
public DatanodeInfo[] datanodeReport()
public Block[] recentlyInvalidBlocks(UTF8 name)
public Block[] checkObsoleteBlocks(UTF8 name)
public Object[] pendingTransfers(DatanodeInfo srcNode, int maxXfers)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |