|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.nutch.fs.NutchFileSystem
NutchFileSystem is an interface for a fairly simple distributed file system. A Nutch installation might consist of multiple machines, which should swap files transparently. This interface allows other Nutch systems to find and place files into the distributed Nutch-controlled file world. The standard job of NutchFileSystem is to take the location- independent NutchFile objects, and resolve them using local knowledge and local instances of ShareGroup.
Field Summary | |
static Logger |
LOG
|
Constructor Summary | |
NutchFileSystem()
|
Method Summary | |
abstract void |
close()
No more filesystem operations are needed. |
abstract void |
completeLocalInput(File localFile)
Called when we're all done writing to the target. |
abstract void |
completeLocalOutput(File nfsOutputFile,
File tmpLocalFile)
Called when we're all done writing to the target. |
abstract void |
copyFromLocalFile(File src,
File dst)
The src file is on the local disk. |
abstract void |
copyToLocalFile(File src,
File dst)
The src file is under NFS2, and the dst is on the local disk. |
abstract NFSOutputStream |
create(File f)
Opens an OutputStream at the indicated File, whether local or via NDFS. |
abstract NFSOutputStream |
create(File f,
boolean overwrite)
|
boolean |
createNewFile(File f)
Creates the given File as a brand-new zero-length file. |
abstract boolean |
delete(File f)
Deletes File |
abstract boolean |
exists(File f)
Check if exists |
static NutchFileSystem |
get()
Returns the default filesystem implementation. |
abstract long |
getLength(File f)
|
abstract String |
getName()
Returns a name for this filesystem, suitable to pass to getNamed(String) . |
static NutchFileSystem |
getNamed(String name)
Returns a named filesystem. |
abstract boolean |
isDirectory(File f)
|
boolean |
isFile(File f)
|
abstract File[] |
listFiles(File f)
|
File[] |
listFiles(File f,
FileFilter filter)
|
abstract void |
lock(File f,
boolean shared)
Obtain a lock on the given File |
abstract void |
mkdirs(File f)
Make the given file and all non-existent parents into directories. |
abstract void |
moveFromLocalFile(File src,
File dst)
The src file is on the local disk. |
abstract NFSInputStream |
open(File f)
Opens an InputStream for the indicated File, whether local or via NDFS. |
static NutchFileSystem |
parseArgs(String[] argv,
int i)
Parse the cmd-line args, starting at i. |
abstract void |
release(File f)
Release the lock |
abstract boolean |
rename(File src,
File dst)
Renames File src to File dst. |
abstract File |
startLocalInput(File nfsInputFile,
File tmpLocalFile)
Returns a local File that the user can read from. |
abstract File |
startLocalOutput(File nfsOutputFile,
File tmpLocalFile)
Returns a local File that the user can write output to. |
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 NutchFileSystem()
Method Detail |
public static NutchFileSystem parseArgs(String[] argv, int i) throws IOException
IOException
public static NutchFileSystem get() throws IOException
IOException
public abstract String getName()
getNamed(String)
.
public static NutchFileSystem getNamed(String name) throws IOException
IOException
public abstract NFSInputStream open(File f) throws IOException
IOException
public abstract NFSOutputStream create(File f) throws IOException
IOException
public abstract NFSOutputStream create(File f, boolean overwrite) throws IOException
IOException
public boolean createNewFile(File f) throws IOException
IOException
public abstract boolean rename(File src, File dst) throws IOException
IOException
public abstract boolean delete(File f) throws IOException
IOException
public abstract boolean exists(File f) throws IOException
IOException
public abstract boolean isDirectory(File f) throws IOException
IOException
public boolean isFile(File f) throws IOException
IOException
public abstract long getLength(File f) throws IOException
IOException
public abstract File[] listFiles(File f) throws IOException
IOException
public File[] listFiles(File f, FileFilter filter) throws IOException
IOException
public abstract void mkdirs(File f) throws IOException
IOException
public abstract void lock(File f, boolean shared) throws IOException
IOException
public abstract void release(File f) throws IOException
IOException
public abstract void copyFromLocalFile(File src, File dst) throws IOException
IOException
public abstract void moveFromLocalFile(File src, File dst) throws IOException
IOException
public abstract void copyToLocalFile(File src, File dst) throws IOException
IOException
public abstract File startLocalOutput(File nfsOutputFile, File tmpLocalFile) throws IOException
IOException
public abstract void completeLocalOutput(File nfsOutputFile, File tmpLocalFile) throws IOException
IOException
public abstract File startLocalInput(File nfsInputFile, File tmpLocalFile) throws IOException
IOException
public abstract void completeLocalInput(File localFile) throws IOException
IOException
public abstract void close() throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |