net.nutch.util
Class NutchNFSFileSystem

java.lang.Object
  extended bynet.nutch.util.NutchGenericFileSystem
      extended bynet.nutch.util.NutchNFSFileSystem
All Implemented Interfaces:
NutchFileSystem

public class NutchNFSFileSystem
extends NutchGenericFileSystem

NutchNFSFileSystem implements NutchFileSystem over the Network File System. We assume all participants are mounting the same drive.

Author:
Mike Cafarella

Constructor Summary
NutchNFSFileSystem(File dbRoot, boolean destructiveCopy)
          Create the ShareSet automatically, and then go on to the regular constructor.
NutchNFSFileSystem(File dbRoot, ShareSet initShareSet, boolean destructiveCopy)
          Create a Nutch Filesystem at the indicated mounted directory.
 
Method Summary
protected  void copyFile(File srcFile, String locMach, String locStr, String filename, boolean overwrite)
          Copy a file to the right place in the local dir, which assumes NFS-connectivity.
protected  void deleteFile(String locMach, String locStr, String filename)
          Remove a file from its current location.
 void lockFile(String locMach, String locStr, String filename, boolean exclusive)
          Obtain a lock with the given info.
 void release(String locMach, String locStr, String filename)
          Release the lock for the given NutchFile
protected  void renameFile(File srcFile, String locMach, String locStr, String filename, boolean overwrite)
          Rename the existing file or dir to a new location
 
Methods inherited from class net.nutch.util.NutchGenericFileSystem
close, completeDir, delete, get, get, getWorkingFile, lock, put, release, renameTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NutchNFSFileSystem

public NutchNFSFileSystem(File dbRoot,
                          boolean destructiveCopy)
                   throws IOException
Create the ShareSet automatically, and then go on to the regular constructor.


NutchNFSFileSystem

public NutchNFSFileSystem(File dbRoot,
                          ShareSet initShareSet,
                          boolean destructiveCopy)
                   throws IOException
Create a Nutch Filesystem at the indicated mounted directory. We're given a ShareSet.

Method Detail

lockFile

public void lockFile(String locMach,
                     String locStr,
                     String filename,
                     boolean exclusive)
              throws IOException
Obtain a lock with the given info.

Specified by:
lockFile in class NutchGenericFileSystem
Throws:
IOException

release

public void release(String locMach,
                    String locStr,
                    String filename)
             throws IOException
Release the lock for the given NutchFile

Specified by:
release in class NutchGenericFileSystem
Throws:
IOException

copyFile

protected void copyFile(File srcFile,
                        String locMach,
                        String locStr,
                        String filename,
                        boolean overwrite)
                 throws IOException
Copy a file to the right place in the local dir, which assumes NFS-connectivity.

Specified by:
copyFile in class NutchGenericFileSystem
Throws:
IOException

deleteFile

protected void deleteFile(String locMach,
                          String locStr,
                          String filename)
                   throws IOException
Remove a file from its current location. Assumes an NFS-universe.

Specified by:
deleteFile in class NutchGenericFileSystem
Throws:
IOException

renameFile

protected void renameFile(File srcFile,
                          String locMach,
                          String locStr,
                          String filename,
                          boolean overwrite)
                   throws IOException
Rename the existing file or dir to a new location

Specified by:
renameFile in class NutchGenericFileSystem
Throws:
IOException


Copyright © 2004 The Nutch Organization.