为什么下载到一半会提示下载失败?

下载

良人已去 良人已去
回答
  • 花仙子 花仙子

    public static void getfilelocal()throws ioexception {
    configuration conf=new configuration();filesystem fs=filesystem.get(conf);path path=new path("/user/hadoop1/input/10000");filestatus status=fs.getfilestatus(path);blocklocation[]locations=fs.getfileblocklocations(status,0,
    status.getlen());int length=locations.length;system.out.println("total locations="+length);for(int i=0;i;i+){
    string[]ss1=locations[i].getnames();string[]ss2=locations[i].gethosts();system.out.println("-names-");for(string s:ss1){
    system.out.print(s+",");}
    system.out.println();system.out.println("-hosts-");for(string s:ss2){
    system.out.print(s+",");}
    }
    }
    按照上面的代码来,location.getnames和location.gethosts得到的不是字符串而是一个字符串数组,遍历数组就可以了

类似问答
精品推荐

友情链接

友链互换QQ:

谷财 备案编号:蜀ICP备11019336号-3商务合作:235-677-2621

Copyright 2009-2020 Chengdu Sanzilewan Technology Co.,Ltd all rights reserve

抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活