> >I made the following changes:
> >
> >current nutch-0.9 code:
> >-----
> > if ("local".equals(this.fs.getName())) {
> > return FSDirectory.getDirectory(file.toString(), false);
> >-----
> >
> >new code:
> >-----
> > if ("local".equals(this.conf.get("fs.default.name"))) {
> > return FSDirectory.getDirectory(file.toString());
>
> This is not a fool-proof way to do this. "local" is a literal string,
> supported for backwards-compatibility, but it's possible to put there
> also "file:///", at which point your test would fail ..
The use of "local" is most likely in reference to the
description of the fs.default.name property:
-----
The name of the default file system. Either the literal string
"local" or a host:port for NDFS.
-----
The full code for this method in IndexSearcher.java
is as follows:
-----
private Directory getDirectory(Path file) throws IOException {
if ("local".equals(this.fs.getName())) {
return FSDirectory.getDirectory(file.toString(), false);
} else {
return new FsDirectory(this.fs, file, false, this.conf);
}
}
-----
If someone put in "file:///" now, using the above code,
what happens when it drops down to the else action?
> A better method would be this:
>
> if (this.fs.getUri().equals(LocalFileSystem.NAME)) {
> ...
>
> because Hadoop reserves a specific URI of the local FS abstraction, no
> matter what is its implementation.
I found LocalFileSystem documentation at
http://hadoop.apache.org/core/docs/r0.14.4/api/org/apache/hadoop/fs/LocalFileSystem.html
Is this supported in hadoop r0.12.2 (nutch 0.9)?
Can you explain the use of '.NAME'? Is that a
literal?
Thanks for your assistance!
JohnM
--
john mendenhall
[EMAIL PROTECTED]
surf utopia
internet services