亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nutchfilesystem.java

?? 爬蟲數據的改進,并修正了一些bug
?? JAVA
字號:
/* Copyright (c) 2004 The Nutch Organization.  All rights reserved.   */
/* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */
package net.nutch.fs;

import java.io.*;
import java.net.*;
import java.util.*;
import java.util.logging.*;

import net.nutch.ndfs.*;
import net.nutch.util.*;

/****************************************************************
 * 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.
 * 
 * @author Mike Cafarella
 *****************************************************************/
public abstract class NutchFileSystem {
    public static final Logger LOG = LogFormatter.getLogger("net.nutch.util.NutchFileSystem");

    /**
     * Parse the cmd-line args, starting at i.  Remove consumed args
     * from array.  We expect param in the form:
     * '-local | -ndfs <namenode:port>'
     */
    public static NutchFileSystem parseArgs(String argv[], int i) throws IOException {
        /**
        if (argv.length - i < 1) {
            throw new IOException("Must indicate filesystem type for NDFS");
        }
        */
        int orig = i;
        NutchFileSystem nfs = null;
        String cmd = argv[i];
        if ("-ndfs".equals(cmd)) {
            i++;
            InetSocketAddress addr = NDFS.createSocketAddr(argv[i++]);
            nfs = new NDFSFileSystem(addr);
        } else if ("-local".equals(cmd)) {
            i++;
            nfs = new LocalFileSystem();
        } else {
            LOG.info("No NutchFileSystem indicated, so defaulting to local fs.");
            nfs = new LocalFileSystem();
        }
        System.arraycopy(argv, i, argv, orig, argv.length - i);
        for (int j = argv.length - i; j < argv.length; j++) {
            argv[j] = null;
        }
        return nfs;
    }

    ///////////////////////////////////////////////////////////////
    // NutchFileSystem
    ///////////////////////////////////////////////////////////////
    /**
     */
    public NutchFileSystem() {
    }

    /**
     * Opens an InputStream for the indicated File, whether local
     * or via NDFS.
     */
    public abstract NFSInputStream open(File f) throws IOException;

    /**
     * Opens an OutputStream at the indicated File, whether local
     * or via NDFS.
     */
    public abstract NFSOutputStream create(File f) throws IOException;
    public abstract NFSOutputStream create(File f, boolean overwrite) throws IOException;

    /**
     * Creates the given File as a brand-new zero-length file.  If
     * create fails, or if it already existed, return false.
     */
    public boolean createNewFile(File f) throws IOException {
        if (exists(f)) {
            return false;
        } else {
            OutputStream out = create(f);
            try {
            } finally {
                out.close();
            }
            return true;
        }
    }

    /**
     * Renames File src to File dst.  Can take place on local fs
     * or remote NDFS.
     */
    public abstract boolean rename(File src, File dst) throws IOException;

    /**
     * Deletes File
     */
    public abstract boolean delete(File f) throws IOException;

    /**
     * Check if exists
     */
    public abstract boolean exists(File f) throws IOException;

    /**
     */
    public abstract boolean isDirectory(File f) throws IOException;

    /**
     */
    public boolean isFile(File f) throws IOException {
        if (exists(f) && ! isDirectory(f)) {
            return true;
        } else {
            return false;
        }
    }
    
    /**
     */
    public abstract long getLength(File f) throws IOException;

    /**
     */
    public abstract File[] listFiles(File f) throws IOException;

    public File[] listFiles(File f, FileFilter filter) throws IOException {
        Vector results = new Vector();
        File listing[] = listFiles(f);
        for (int i = 0; i < listing.length; i++) {
            if (filter.accept(listing[i])) {
                results.add(listing[i]);
            }
        }
        return (File[]) results.toArray(new File[results.size()]);
    }

    /**
     * Make the given file and all non-existent parents into
     * directories.
     */
    public abstract void mkdirs(File f) throws IOException;

    /**
     * Obtain a lock on the given File
     */
    public abstract void lock(File f, boolean shared) throws IOException;

    /**
     * Release the lock
     */
    public abstract void release(File f) throws IOException;

    /**
     * The src file is on the local disk.  Add it to NFS at
     * the given dst name and the source is kept intact afterwards
     */
    // not implemneted yet
    public abstract void copyFromLocalFile(File src, File dst) throws IOException;

    /**
     * The src file is on the local disk.  Add it to NFS at
     * the given dst name, removing the source afterwards.
     */
    public abstract void moveFromLocalFile(File src, File dst) throws IOException;

    /**
     * The src file is under NFS2, and the dst is on the local disk.
     * Copy it from NFS control to the local dst name.
     */
    public abstract void copyToLocalFile(File src, File dst) throws IOException;

    /**
     * the same as copyToLocalFile(File src, File dst), except that
     * the source is removed afterward.
     */
    // not implemented yet
    //public abstract void moveToLocalFile(File src, File dst) throws IOException;

    /**
     * Returns a local File that the user can write output to.  The caller
     * provides both the eventual NFS target name and the local working
     * file.  If the NFS is local, we write directly into the target.  If
     * the NFS is remote, we write into the tmp local area.
     */
    public abstract File startLocalOutput(File nfsOutputFile, File tmpLocalFile) throws IOException;

    /**
     * Called when we're all done writing to the target.  A local NFS will
     * do nothing, because we've written to exactly the right place.  A remote
     * NFS will copy the contents of tmpLocalFile to the correct target at
     * nfsOutputFile.
     */
    public abstract void completeLocalOutput(File nfsOutputFile, File tmpLocalFile) throws IOException;

    /**
     * Returns a local File that the user can read from.  The caller 
     * provides both the eventual NFS target name and the local working
     * file.  If the NFS is local, we read directly from the source.  If
     * the NFS is remote, we write data into the tmp local area.
     */
    public abstract File startLocalInput(File nfsInputFile, File tmpLocalFile) throws IOException;

    /**
     * Called when we're all done writing to the target.  A local NFS will
     * do nothing, because we've written to exactly the right place.  A remote
     * NFS will copy the contents of tmpLocalFile to the correct target at
     * nfsOutputFile.
     */
    public abstract void completeLocalInput(File localFile) throws IOException;

    /**
     * Create an empty File in the given directory (or /tmp, if directory is
     * null) using the given prefix and suffix to guide name generation.
     */
    public abstract File createTempFile(String prefix, String suffix, File directory) throws IOException;

    /**
     * No more filesystem operations are needed.  Will
     * release any held locks.
     */
    public abstract void close() throws IOException;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美mv和日韩mv的网站| 日本网站在线观看一区二区三区| 不卡的电影网站| 蜜臀a∨国产成人精品| 亚洲欧洲精品一区二区三区| 国产精品一区二区果冻传媒| 免费成人深夜小野草| 午夜日韩在线电影| 一区二区三区色| 亚洲色图19p| 日韩免费一区二区三区在线播放| 99久久综合精品| 国产精品一区二区视频| 蜜桃av一区二区三区电影| 麻豆国产精品视频| 婷婷夜色潮精品综合在线| 亚洲男女一区二区三区| 国产色综合久久| 亚洲视频免费在线| 成人免费一区二区三区在线观看| 国产欧美中文在线| 国产精品欧美久久久久无广告| 中文字幕色av一区二区三区| 久久久综合九色合综国产精品| 欧美sm美女调教| 久久综合九色综合欧美就去吻| 欧美国产日韩精品免费观看| 精品国产一区二区三区av性色| 欧美v亚洲v综合ⅴ国产v| 日韩欧美一区二区视频| 日韩一区二区高清| 精品国产凹凸成av人网站| 欧美sm美女调教| 欧美国产综合一区二区| 日韩女优制服丝袜电影| 国产精品乱人伦中文| 一区2区3区在线看| 奇米在线7777在线精品| 成人免费观看视频| 欧美自拍偷拍午夜视频| 日韩精品在线网站| 欧美国产日韩a欧美在线观看 | 国产精品嫩草99a| 国产精品情趣视频| 夜夜精品视频一区二区| 日韩精品每日更新| 国产成人免费视频网站| 91捆绑美女网站| 日韩一区二区三区视频| 国产欧美日韩不卡免费| 一区二区欧美视频| 久久精品国产亚洲高清剧情介绍| 丁香啪啪综合成人亚洲小说| 成人黄色777网| 久久久影视传媒| 一区二区理论电影在线观看| 久久成人免费电影| 99久久免费国产| 国产肉丝袜一区二区| 亚洲国产精品影院| 国产iv一区二区三区| 欧美精品色综合| 中文字幕一区三区| 蜜臀av一区二区三区| 色婷婷综合久久久| 欧美精品三级日韩久久| 国产精品入口麻豆原神| 蜜臀99久久精品久久久久久软件| 色综合咪咪久久| 精品美女在线播放| 亚洲午夜精品一区二区三区他趣| 国产精品一区二区三区网站| 欧美性大战久久| 国产精品女上位| 久久99精品国产麻豆不卡| 91精品国产福利在线观看| 亚洲欧美偷拍另类a∨色屁股| 精品一区二区三区不卡| 777午夜精品视频在线播放| 视频在线观看91| 在线看日本不卡| 最新日韩av在线| 成人一级视频在线观看| 久久久国产午夜精品| 久久超碰97中文字幕| 777久久久精品| 一区二区三区欧美日韩| 成人久久视频在线观看| 精品国产乱码久久久久久免费 | 国产成人99久久亚洲综合精品| 欧美日本一道本| 亚洲不卡一区二区三区| 在线视频欧美精品| 亚洲一级二级在线| 欧美视频在线一区| 亚洲制服欧美中文字幕中文字幕| 色国产综合视频| 一区二区三区加勒比av| 欧美图片一区二区三区| 一区二区三区欧美亚洲| 欧美日韩国产bt| 亚洲成人动漫在线免费观看| 欧美日韩激情在线| 亚洲自拍偷拍麻豆| 欧美成人a∨高清免费观看| 欧美日韩免费电影| 亚洲影院在线观看| 午夜精彩视频在线观看不卡| 一本色道亚洲精品aⅴ| 天天操天天干天天综合网| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国产欧美精品一区二区三区四区| 成人h动漫精品一区二区| 亚洲午夜在线电影| 久久蜜桃av一区二区天堂| 91丨九色丨蝌蚪富婆spa| 免费精品99久久国产综合精品| 一区在线播放视频| 538在线一区二区精品国产| 国产成人99久久亚洲综合精品| 亚洲男人电影天堂| 精品国产乱码久久| 欧美性猛交xxxx黑人交| 国产成人精品免费| 久久精品噜噜噜成人av农村| 亚洲精品乱码久久久久久久久| 亚洲精品一区二区精华| 91黄视频在线| 粉嫩绯色av一区二区在线观看| 日韩精品三区四区| 亚洲一区二区三区影院| 欧美国产禁国产网站cc| 欧美日韩亚洲综合| 国产乱子轮精品视频| 亚洲电影第三页| 中日韩av电影| 日韩一区二区电影在线| 99v久久综合狠狠综合久久| 狠狠久久亚洲欧美| 亚洲综合激情网| 国产精品水嫩水嫩| 日韩欧美一区二区视频| 欧美日韩国产免费| 97久久精品人人做人人爽50路| 精品亚洲国内自在自线福利| 综合久久久久综合| 欧美久久一二三四区| 色吧成人激情小说| 国产九九视频一区二区三区| 亚洲伊人色欲综合网| 国产日产欧美精品一区二区三区| 欧美成人官网二区| 欧美人与禽zozo性伦| 成人va在线观看| 国产91精品免费| 国产精品99久久久久久宅男| 日韩中文字幕区一区有砖一区| 中文字幕乱码亚洲精品一区 | 3751色影院一区二区三区| 9i在线看片成人免费| 日本免费新一区视频| 国产精品久久福利| 日韩欧美成人一区二区| 欧美在线免费视屏| 美女爽到高潮91| 亚洲精品成人天堂一二三| 26uuu另类欧美| 国内久久精品视频| 免费欧美高清视频| 久久国产日韩欧美精品| 欧美不卡一区二区| 欧美日韩精品综合在线| 91麻豆自制传媒国产之光| 日本三级韩国三级欧美三级| 麻豆精品久久精品色综合| 日韩av电影免费观看高清完整版| 亚洲第一会所有码转帖| 久久69国产一区二区蜜臀| 久久er精品视频| 一本色道久久综合精品竹菊| 91精品婷婷国产综合久久竹菊| 日韩欧美中文字幕精品| 亚洲欧美在线另类| 激情综合网av| 欧美一区二区三区的| 亚洲最大的成人av| 色综合天天性综合| 色婷婷综合五月| 91精品综合久久久久久| 精品电影一区二区| 国产女人aaa级久久久级| 亚洲午夜国产一区99re久久| 亚洲国产aⅴ成人精品无吗| 国产福利视频一区二区三区| 97久久超碰国产精品| 成人免费在线视频| 精品亚洲成a人| 亚洲一二三专区| 欧美午夜影院一区| 中文字幕第一区二区|