rehouse/sample_07/sample_07.csv";
>>>>>>> int DATANODE_PORT = 50010;
>>>>>>> int NAMENODE_PORT = 8020;
>>>>>>> String HOST_IP = "192.168.1.230";
>>&
int NAMENODE_PORT = 8020;
>>>>>>String HOST_IP = "192.168.1.230";
>>>>>>
>>>>>>byte[] buf=new byte[1000];
>>>>>>
>>>>>>
>>>>>>try{
>>>>>>
>>>>>> ClientProtocol client= DFSClie
>>> for(LocatedBlock block : located.getLocatedBlocks()){
>>>>> Socket sock =
>>>>>SocketFactory.getDefault().createSoc
Utils.connect(sock, targetAddr, 10000);
>>>> sock.setSoTimeout(1);
>>>>
>>>>
>>>>BlockReader
>>>>
gt;>reader=BlockReader.newBlockReader(sock, filename,
>>> block.getBlock().getBlockId(),
>>>block.getBlockToken(),
>>> block.getBlock().getGenerationStamp(), 0,
>>> block.getBlockSize(),
>>> 1000);
>>
>int length;
>>while((length=reader.read(buf,0,1000))>0){
>>//System.out.print(new
>>String(buf,0,length,"UTF-8"));
>> if (length<1000) break;
>>}
>>
rint(new
> String(buf,0,length,"UTF-8"));
> if (length<1000) break;
> }
> reader.close();
> sock.close();
> }
>
>
> }catch(IOException ex){
> ex.print
}
}catch(IOException ex){
ex.printStackTrace();
}
}
***
From: Denny Ye
Reply-To:
Date: Mon, 9 Jan 2012 16:29:18 +0800
To:
Subject: Re: How-to use DFSClien
hi David
Please refer to the method "DFSInputStream#blockSeekTo", it has
same purpose with you.
***
LocatedBlock targetBlock = getBlockAt(target, true);
assert (target==this.pos) : "Wrong postion " + pos +