欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

Yarn下分片和分塊源代碼分析

系統 1687 0
      public class FileSplit extends InputSplit implements Writable {

	private Path file;

	private long start;

	private long length;

	private String[] hosts;



	public FileSplit() {

	}



	public FileSplit(Path file, long start, long length, String[] hosts) {

		this.file = file;

		this.start = start;

		this.length = length;

		this.hosts = hosts;

	}



	public Path getPath() {

		return this.file;

	}



	public long getStart() {

		return this.start;

	}



	public long getLength() {

		return this.length;

	}



	public String toString() {

		return this.file + ":" + this.start + "+" + this.length;

	}



	public void write(DataOutput out) throws IOException {

		Text.writeString(out, this.file.toString());

		out.writeLong(this.start);

		out.writeLong(this.length);

	}



	public void readFields(DataInput in) throws IOException {

		this.file = new Path(Text.readString(in));

		this.start = in.readLong();

		this.length = in.readLong();

		this.hosts = null;

	}



	public String[] getLocations() throws IOException {

		if (this.hosts == null) {

			return new String[0];

		}

		return this.hosts;

	}

}


    

代碼比較簡單, 四部分組成? 文件路徑 ,啟始位置,長度,Host列表

Host為什么是個列表

看分片的時候創建函數

splits.add(makeSplit(path, length - bytesRemaining,
?? ??? ??? ??? ??? ??? ??? ??? ?splitSize, blkLocations[blkIndex].getHosts()));

再來看塊的源代碼

      
        public
      
      
        class
      
      
         BlockLocation {

    
      
      
        private
      
      
         String[] hosts;

    
      
      
        private
      
      
         String[] names;

    
      
      
        private
      
      
         String[] topologyPaths;

    
      
      
        private
      
      
        long
      
      
         offset;

    
      
      
        private
      
      
        long
      
      
         length;

    
      
      
        private
      
      
        boolean
      
      
         corrupt;



    
      
      
        public
      
      
         BlockLocation() {

        
      
      
        this
      
      (
      
        new
      
       String[0], 
      
        new
      
       String[0], 0L, 0L
      
        );

    }



    
      
      
        public
      
       BlockLocation(String[] names, String[] hosts, 
      
        long
      
      
         offset,

            
      
      
        long
      
      
         length) {

        
      
      
        this
      
      (names, hosts, offset, length, 
      
        false
      
      
        );

    }



    
      
      
        public
      
       BlockLocation(String[] names, String[] hosts, 
      
        long
      
      
         offset,

            
      
      
        long
      
       length, 
      
        boolean
      
      
         corrupt) {

        
      
      
        if
      
       (names == 
      
        null
      
      
        )

            
      
      
        this
      
      .names = 
      
        new
      
       String[0
      
        ];

        
      
      
        else
      
      
         {

            
      
      
        this
      
      .names =
      
         names;

        }

        
      
      
        if
      
       (hosts == 
      
        null
      
      
        )

            
      
      
        this
      
      .hosts = 
      
        new
      
       String[0
      
        ];

        
      
      
        else
      
      
         {

            
      
      
        this
      
      .hosts =
      
         hosts;

        }

        
      
      
        this
      
      .offset =
      
         offset;

        
      
      
        this
      
      .length =
      
         length;

        
      
      
        this
      
      .topologyPaths = 
      
        new
      
       String[0
      
        ];

        
      
      
        this
      
      .corrupt =
      
         corrupt;

    }



    
      
      
        public
      
      
         BlockLocation(String[] names, String[] hosts,

            String[] topologyPaths, 
      
      
        long
      
       offset, 
      
        long
      
      
         length) {

        
      
      
        this
      
      (names, hosts, topologyPaths, offset, length, 
      
        false
      
      
        );

    }



    
      
      
        public
      
      
         BlockLocation(String[] names, String[] hosts,

            String[] topologyPaths, 
      
      
        long
      
       offset, 
      
        long
      
       length, 
      
        boolean
      
      
         corrupt) {

        
      
      
        this
      
      
        (names, hosts, offset, length, corrupt);

        
      
      
        if
      
       (topologyPaths == 
      
        null
      
      
        )

            
      
      
        this
      
      .topologyPaths = 
      
        new
      
       String[0
      
        ];

        
      
      
        else
      
      
        this
      
      .topologyPaths =
      
         topologyPaths;

    }



    
      
      
        public
      
       String[] getHosts() 
      
        throws
      
      
         IOException {

        
      
      
        if
      
       ((
      
        this
      
      .hosts == 
      
        null
      
      ) || (
      
        this
      
      .hosts.length == 0
      
        )) {

            
      
      
        return
      
      
        new
      
       String[0
      
        ];

        }

        
      
      
        return
      
      
        this
      
      
        .hosts;

    }



    
      
      
        public
      
       String[] getNames() 
      
        throws
      
      
         IOException {

        
      
      
        if
      
       ((
      
        this
      
      .names == 
      
        null
      
      ) || (
      
        this
      
      .names.length == 0
      
        )) {

            
      
      
        return
      
      
        new
      
       String[0
      
        ];

        }

        
      
      
        return
      
      
        this
      
      
        .names;

    }



    
      
      
        public
      
       String[] getTopologyPaths() 
      
        throws
      
      
         IOException {

        
      
      
        if
      
       ((
      
        this
      
      .topologyPaths == 
      
        null
      
      ) || (
      
        this
      
      .topologyPaths.length == 0
      
        )) {

            
      
      
        return
      
      
        new
      
       String[0
      
        ];

        }

        
      
      
        return
      
      
        this
      
      
        .topologyPaths;

    }



    
      
      
        public
      
      
        long
      
      
         getOffset() {

        
      
      
        return
      
      
        this
      
      
        .offset;

    }



    
      
      
        public
      
      
        long
      
      
         getLength() {

        
      
      
        return
      
      
        this
      
      
        .length;

    }



    
      
      
        public
      
      
        boolean
      
      
         isCorrupt() {

        
      
      
        return
      
      
        this
      
      
        .corrupt;

    }



    
      
      
        public
      
      
        void
      
       setOffset(
      
        long
      
      
         offset) {

        
      
      
        this
      
      .offset =
      
         offset;

    }



    
      
      
        public
      
      
        void
      
       setLength(
      
        long
      
      
         length) {

        
      
      
        this
      
      .length =
      
         length;

    }



    
      
      
        public
      
      
        void
      
       setCorrupt(
      
        boolean
      
      
         corrupt) {

        
      
      
        this
      
      .corrupt =
      
         corrupt;

    }



    
      
      
        public
      
      
        void
      
       setHosts(String[] hosts) 
      
        throws
      
      
         IOException {

        
      
      
        if
      
       (hosts == 
      
        null
      
      
        )

            
      
      
        this
      
      .hosts = 
      
        new
      
       String[0
      
        ];

        
      
      
        else
      
      
        this
      
      .hosts =
      
         hosts;

    }



    
      
      
        public
      
      
        void
      
       setNames(String[] names) 
      
        throws
      
      
         IOException {

        
      
      
        if
      
       (names == 
      
        null
      
      
        )

            
      
      
        this
      
      .names = 
      
        new
      
       String[0
      
        ];

        
      
      
        else
      
      
        this
      
      .names =
      
         names;

    }



    
      
      
        public
      
      
        void
      
       setTopologyPaths(String[] topologyPaths) 
      
        throws
      
      
         IOException {

        
      
      
        if
      
       (topologyPaths == 
      
        null
      
      
        )

            
      
      
        this
      
      .topologyPaths = 
      
        new
      
       String[0
      
        ];

        
      
      
        else
      
      
        this
      
      .topologyPaths =
      
         topologyPaths;

    }



    
      
      
        public
      
      
         String toString() {

        StringBuilder result 
      
      = 
      
        new
      
      
         StringBuilder();

        result.append(
      
      
        this
      
      
        .offset);

        result.append(
      
      ','
      
        );

        result.append(
      
      
        this
      
      
        .length);

        
      
      
        if
      
       (
      
        this
      
      
        .corrupt) {

            result.append(
      
      "(corrupt)"
      
        );

        }

        
      
      
        for
      
       (String h : 
      
        this
      
      
        .hosts) {

            result.append(
      
      ','
      
        );

            result.append(h);

        }

        
      
      
        return
      
      
         result.toString();

    }

}
      
    

?

?

?

Yarn下分片和分塊源代碼分析


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!??!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 五月天婷婷免费观看视频在线 | 久久综合色之久久综合 | 91拍拍在线观看 | 成人免费视频网站在线观看 | 亚洲在线一区 | 精品免费国产一区二区三区四区介绍 | 最新伦理片 | 十六以下岁女子毛片免费 | 国产91精品黄网在线观看 | 老司机免费福利视频无毒午夜 | 欧美日韩在线观看免费 | 天天插天天舔 | 视频福利在线观看 | 精品午夜久久网成年网 | 成人影院欧美大片免费看 | 日韩三级视频 | 日韩一区二区三区在线看 | 亚洲 综合 欧美 动漫 丝袜图 | 中文字幕网在线 | 激情五月色播五月 | 香蕉视频在线观看免费国产婷婷 | 日韩福利视频导航 | www.精品久久 | 一区二区三区毛片 | 亚洲日韩欧洲无码av夜夜摸 | 五月久久亚洲七七综合中文网 | 黄片毛片一级 | 奇米影视8888狠狠狠狠 | 免费午夜视频在线观看 | 欧美黄区| 日韩a在线 | 99久久人妻无码精品系列性欧美 | 精品欧美在线观看 | 久久综合九色综合97婷婷群聊 | 奇米激情| 久久精品免费视频观看 | 国产免费视频 | 国产亚洲一区二区精品 | 亚洲精品欧美一区二区三区 | a级毛片高清免费视频 | 二级黄绝大片中国免费视频 |