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

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

?? fsnamesystem.java

?? Hadoop是一個用于運行應用程序在大型集群的廉價硬件設備上的框架。Hadoop為應用程序透明的提供了一組穩定/可靠的接口和數據運動。在 Hadoop中實現了Google的MapReduce算法
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/** * Copyright 2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.apache.hadoop.dfs;import org.apache.hadoop.io.*;import org.apache.hadoop.conf.*;import org.apache.hadoop.util.*;import java.io.*;import java.util.*;import java.util.logging.*;/*************************************************** * FSNamesystem does the actual bookkeeping work for the * DataNode. * * It 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 ***************************************************/class FSNamesystem implements FSConstants {    public static final Logger LOG = LogFormatter.getLogger("org.apache.hadoop.fs.FSNamesystem");    //    // Stores the correct file name hierarchy    //    FSDirectory dir;    //    // Stores the block-->datanode(s) map.  Updated only in response    // to client-sent information.    //    TreeMap blocksMap = new TreeMap();    //    // Stores the datanode-->block map.  Done by storing a     // set of datanode info objects, sorted by name.  Updated only in    // response to client-sent information.    //    TreeMap datanodeMap = new TreeMap();    //    // Keeps a Vector for every named machine.  The Vector contains    // blocks that have recently been invalidated and are thought to live    // on the machine in question.    //    TreeMap recentInvalidateSets = new TreeMap();    //    // Keeps a TreeSet for every named node.  Each treeset contains    // a list of the blocks that are "extra" at that location.  We'll    // eventually remove these extras.    //    TreeMap excessReplicateMap = new TreeMap();    //    // Keeps track of files that are being created, plus the    // blocks that make them up.    //    TreeMap pendingCreates = new TreeMap();    //    // Keeps track of the blocks that are part of those pending creates    //    TreeSet pendingCreateBlocks = new TreeSet();    //    // Stats on overall usage    //    long totalCapacity = 0, totalRemaining = 0;    //    Random r = new Random();    //    // Stores a set of datanode info objects, sorted by heartbeat    //    TreeSet heartbeats = new TreeSet(new Comparator() {        public int compare(Object o1, Object o2) {            DatanodeInfo d1 = (DatanodeInfo) o1;            DatanodeInfo d2 = (DatanodeInfo) o2;                        long lu1 = d1.lastUpdate();            long lu2 = d2.lastUpdate();            if (lu1 < lu2) {                return -1;            } else if (lu1 > lu2) {                return 1;            } else {                return d1.getName().compareTo(d2.getName());            }        }    });    //    // Store set of Blocks that need to be replicated 1 or more times.    // We also store pending replication-orders.    //    private TreeSet neededReplications = new TreeSet();    private TreeSet pendingReplications = new TreeSet();    //    // Used for handling lock-leases    //    private TreeMap leases = new TreeMap();    private TreeSet sortedLeases = new TreeSet();    //    // Threaded object that checks to see if we have been    // getting heartbeats from all clients.     //    HeartbeatMonitor hbmon = null;    LeaseMonitor lmon = null;    Daemon hbthread = null, lmthread = null;    boolean fsRunning = true;    long systemStart = 0;    private Configuration conf;    //  DESIRED_REPLICATION is how many copies we try to have at all times    private int desiredReplication;    //  The maximum number of replicates we should allow for a single block    private int maxReplication;    //  How many outgoing replication streams a given node should have at one time    private int maxReplicationStreams;    // MIN_REPLICATION is how many copies we need in place or else we disallow the write    private int minReplication;    // HEARTBEAT_RECHECK is how often a datanode sends its hearbeat    private int heartBeatRecheck;    /**     * dir is where the filesystem directory state      * is stored     */    public FSNamesystem(File dir, Configuration conf) throws IOException {        this.dir = new FSDirectory(dir);        this.hbthread = new Daemon(new HeartbeatMonitor());        this.lmthread = new Daemon(new LeaseMonitor());        hbthread.start();        lmthread.start();        this.systemStart = System.currentTimeMillis();        this.conf = conf;                this.desiredReplication = conf.getInt("dfs.replication", 3);        this.maxReplication = desiredReplication;        this.maxReplicationStreams = conf.getInt("dfs.max-repl-streams", 2);        this.minReplication = 1;        this.heartBeatRecheck= 1000;    }    /** Close down this filesystem manager.     * Causes heartbeat and lease daemons to stop; waits briefly for     * them to finish, but a short timeout returns control back to caller.     */    public void close() {      synchronized (this) {        fsRunning = false;      }        try {            hbthread.join(3000);        } catch (InterruptedException ie) {        } finally {          // using finally to ensure we also wait for lease daemon          try {            lmthread.join(3000);          } catch (InterruptedException ie) {          }        }    }    /////////////////////////////////////////////////////////    //    // These methods are called by HadoopFS clients    //    /////////////////////////////////////////////////////////    /**     * The client wants to open the given filename.  Return a     * list of (block,machineArray) pairs.  The sequence of unique blocks     * in the list indicates all the blocks that make up the filename.     *     * The client should choose one of the machines from the machineArray     * at random.     */    public Object[] open(UTF8 src) {        Object results[] = null;        Block blocks[] = dir.getFile(src);        if (blocks != null) {            results = new Object[2];            DatanodeInfo machineSets[][] = new DatanodeInfo[blocks.length][];            for (int i = 0; i < blocks.length; i++) {                TreeSet containingNodes = (TreeSet) blocksMap.get(blocks[i]);                if (containingNodes == null) {                    machineSets[i] = new DatanodeInfo[0];                } else {                    machineSets[i] = new DatanodeInfo[containingNodes.size()];                    int j = 0;                    for (Iterator it = containingNodes.iterator(); it.hasNext(); j++) {                        machineSets[i][j] = (DatanodeInfo) it.next();                    }                }            }            results[0] = blocks;            results[1] = machineSets;        }        return results;    }    /**     * The client would like to create a new block for the indicated     * filename.  Return an array that consists of the block, plus a set      * of machines.  The first on this list should be where the client      * writes data.  Subsequent items in the list must be provided in     * the connection to the first datanode.     * @return Return an array that consists of the block, plus a set     * of machines, or null if src is invalid for creation (based on     * {@link FSDirectory#isValidToCreate(UTF8)}.     */    public synchronized Object[] startFile(UTF8 src, UTF8 holder, UTF8 clientMachine, boolean overwrite) {        Object results[] = null;        if (pendingCreates.get(src) == null) {            boolean fileValid = dir.isValidToCreate(src);            if (overwrite && ! fileValid) {                delete(src);                fileValid = true;            }            if (fileValid) {                results = new Object[2];                // Get the array of replication targets                 DatanodeInfo targets[] = chooseTargets(this.desiredReplication, null, clientMachine);                if (targets.length < this.minReplication) {                    LOG.warning("Target-length is " + targets.length +                        ", below MIN_REPLICATION (" + this.minReplication+ ")");                    return null;                }                // Reserve space for this pending file                pendingCreates.put(src, new Vector());                synchronized (leases) {                    Lease lease = (Lease) leases.get(holder);                    if (lease == null) {                        lease = new Lease(holder);                        leases.put(holder, lease);                        sortedLeases.add(lease);                    } else {                        sortedLeases.remove(lease);                        lease.renew();                        sortedLeases.add(lease);                    }                    lease.startedCreate(src);                }                // Create next block                results[0] = allocateBlock(src);                results[1] = targets;            } else { // ! fileValid              LOG.warning("Cannot start file because it is invalid. src=" + src);            }        } else {            LOG.warning("Cannot start file because pendingCreates is non-null. src=" + src);        }        return results;    }    /**     * The client would like to obtain an additional block for the indicated     * filename (which is being written-to).  Return an array that consists     * of the block, plus a set of machines.  The first on this list should     * be where the client writes data.  Subsequent items in the list must     * be provided in the connection to the first datanode.     *     * Make sure the previous blocks have been reported by datanodes and     * are replicated.  Will return an empty 2-elt array if we want the     * client to "try again later".     */    public synchronized Object[] getAdditionalBlock(UTF8 src, UTF8 clientMachine) {        Object results[] = null;        if (dir.getFile(src) == null && pendingCreates.get(src) != null) {            results = new Object[2];            //            // If we fail this, bad things happen!            //            if (checkFileProgress(src)) {                // Get the array of replication targets                 DatanodeInfo targets[] = chooseTargets(this.desiredReplication, null, clientMachine);                if (targets.length < this.minReplication) {                    return null;                }                // Create next block                results[0] = allocateBlock(src);                results[1] = targets;            }        }        return results;    }    /**     * The client would like to let go of the given block     */    public synchronized boolean abandonBlock(Block b, UTF8 src) {        //        // Remove the block from the pending creates list        //        Vector pendingVector = (Vector) pendingCreates.get(src);        if (pendingVector != null) {            for (Iterator it = pendingVector.iterator(); it.hasNext(); ) {                Block cur = (Block) it.next();                if (cur.compareTo(b) == 0) {                    pendingCreateBlocks.remove(cur);                    it.remove();                    return true;                }            }        }        return false;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃精品视频在线观看| 337p粉嫩大胆色噜噜噜噜亚洲| 色综合久久天天| 久久久久久久久久电影| 欧美日韩久久久| 蜜桃精品在线观看| 亚洲午夜在线电影| 亚洲综合色噜噜狠狠| 亚洲福利视频一区| 色哟哟日韩精品| 91丨porny丨蝌蚪视频| 成人综合婷婷国产精品久久免费| 青青草97国产精品免费观看无弹窗版| 尤物视频一区二区| 午夜精品福利一区二区蜜股av | 亚洲一区在线视频观看| 国产精品一区二区在线看| 久久久精品综合| 成人美女在线视频| 亚洲精品视频免费看| 3d动漫精品啪啪1区2区免费 | 欧美日韩专区在线| 国产成人综合网| 精品亚洲aⅴ乱码一区二区三区| 国产精品影音先锋| 色www精品视频在线观看| 91精选在线观看| 在线国产电影不卡| 欧美日韩精品综合在线| 久久久久九九视频| 成人免费福利片| 欧美乱妇15p| 亚洲天堂福利av| 久久精品人人做| voyeur盗摄精品| 日韩av中文字幕一区二区三区| 2020国产精品久久精品美国| 欧美日韩一卡二卡三卡| 国产在线播精品第三| 亚洲一二三四久久| 国产欧美一区二区精品性色| 宅男在线国产精品| 亚洲精品乱码久久久久久黑人| 成人av网在线| 国产视频在线观看一区二区三区 | 久久久青草青青国产亚洲免观| 亚洲午夜影视影院在线观看| 日本韩国欧美国产| 麻豆精品视频在线观看| 成人开心网精品视频| 色狠狠一区二区三区香蕉| 夜夜夜精品看看| 欧美三级在线播放| 亚洲一本大道在线| 精品亚洲国产成人av制服丝袜| 国产精品乱人伦| 亚洲人吸女人奶水| 亚洲视频 欧洲视频| 欧美一区二区三区视频免费播放| 亚洲国产精品精华液网站| 一区二区三区久久| 亚洲人成影院在线观看| 中文字幕av在线一区二区三区| 国产欧美日韩在线看| 亚洲视频免费看| 色婷婷综合久久久久中文一区二区 | 亚洲色图清纯唯美| 欧洲视频一区二区| 青青草国产精品97视觉盛宴| 久久久久久久久久电影| 国产一区91精品张津瑜| 欧美中文字幕一二三区视频| 精品中文字幕一区二区小辣椒| 亚洲天堂福利av| 顶级嫩模精品视频在线看| 日韩成人免费在线| 国产一区二区在线视频| 色乱码一区二区三区88| 欧美精品视频www在线观看| 日韩精品影音先锋| 中文字幕中文字幕一区二区| 免费高清视频精品| 欧美亚洲动漫制服丝袜| 欧美a级一区二区| 精品少妇一区二区三区免费观看 | 久久天天做天天爱综合色| 国产精品久久久久影院老司| 视频一区在线播放| 亚洲天堂av老司机| 国产欧美日韩中文久久| 精品成a人在线观看| 日韩一区二区免费在线观看| 国产在线观看一区二区| 国产喷白浆一区二区三区| 在线综合亚洲欧美在线视频| 蜜桃av一区二区在线观看| 国产成人亚洲精品青草天美| 欧美不卡123| 日韩精品一二区| 56国语精品自产拍在线观看| 亚洲一级二级三级在线免费观看| 色综合久久中文字幕综合网| 国产精品久久毛片a| 夫妻av一区二区| 精品久久久久一区二区国产| 捆绑调教一区二区三区| 久久精品国产亚洲aⅴ| 免费成人在线视频观看| 国产精品一区二区在线看| 夜夜嗨av一区二区三区| 7777精品久久久大香线蕉 | 一区二区在线免费观看| 亚洲男人的天堂av| 亚州成人在线电影| 精品一区二区三区视频| 成人免费精品视频| 欧美日本一区二区三区四区| 99视频精品免费视频| 久久综合九色综合97婷婷| 久久毛片高清国产| 91一区二区三区在线播放| 亚洲制服丝袜在线| 欧美一级欧美三级在线观看| 激情久久久久久久久久久久久久久久 | 97精品久久久午夜一区二区三区 | 日韩av一级片| 成人精品鲁一区一区二区| 亚欧色一区w666天堂| 另类小说图片综合网| 日韩黄色免费网站| 国产一区二区网址| 在线不卡中文字幕| 一二三四区精品视频| 99久久精品国产一区二区三区| 日韩欧美www| 国产精品第五页| 日韩亚洲国产中文字幕欧美| 成人黄色软件下载| 国产精品一区二区91| 午夜婷婷国产麻豆精品| 亚洲男人的天堂在线观看| 国产亚洲精品资源在线26u| 欧美巨大另类极品videosbest| 高清在线观看日韩| 九一九一国产精品| 国产在线一区二区| 国产成人午夜高潮毛片| 国产色综合一区| 久久国产三级精品| 美女视频网站黄色亚洲| 日韩精品中文字幕一区二区三区| 美女任你摸久久| 国产清纯白嫩初高生在线观看91 | 日韩avvvv在线播放| 午夜视频一区二区三区| 国产在线视视频有精品| 亚洲国产精品精华液2区45| 久久久蜜桃精品| 美洲天堂一区二卡三卡四卡视频| 91精品国产美女浴室洗澡无遮挡| 久久99国产乱子伦精品免费| 色哟哟国产精品| 92国产精品观看| 在线观看欧美黄色| 91精品福利在线| 欧美另类高清zo欧美| 欧美疯狂性受xxxxx喷水图片| 91精品国产欧美一区二区成人| 日韩欧美国产三级电影视频| 国产精品人成在线观看免费| 亚洲一区在线观看免费观看电影高清| 日本在线不卡视频| 久久精品视频免费| 成人在线视频首页| 亚洲影视资源网| 亚洲国产精品v| 欧美日韩久久久| 国内久久精品视频| 亚洲精品亚洲人成人网| www日韩大片| 精品三级在线看| 欧美美女一区二区三区| 欧美无乱码久久久免费午夜一区 | 蜜臀久久99精品久久久画质超高清| 自拍偷拍亚洲综合| 亚洲精品一区二区精华| 欧美aaaaaa午夜精品| 日韩一区二区视频在线观看| 亚洲免费观看高清| 国产传媒久久文化传媒| 欧美一区二区二区| 亚洲午夜私人影院| 99re热这里只有精品免费视频| 欧美成人一区二区三区在线观看| 亚洲一区在线观看免费| 972aa.com艺术欧美| 国产精品毛片高清在线完整版| 日本最新不卡在线| 亚洲精品伦理在线| 国产精品色婷婷久久58|