You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Zhengguo 'Mike' SUN <zh...@yahoo.com> on 2008/10/16 22:40:39 UTC

Any one successfully ran the c++ pipes example?

Hi,

I was trying to write an application using the pipes api. But it seemed the serialization part is not working correctly. More specifically, I can't deserialize a string from an StringInStream constructed from context.getInputSplit(). Even with the examples bundled in the distribution archive(wordcount-nopipe.cc), it threw exceptions. If anyone had experience on that, please kindly give some advise.

P.S.
The code that I am suspecting:

HadoopUtils::StringInStream stream(context.getInputSplit());
HadoopUtils::deserializeString(fname, stream);

fname should be deserialized from that stream, but it actually wasn't.


      

Re: Any one successfully ran the c++ pipes example?

Posted by Owen O'Malley <om...@apache.org>.
On Oct 16, 2008, at 1:40 PM, Zhengguo 'Mike' SUN wrote:

> I was trying to write an application using the pipes api. But it  
> seemed the serialization part is not working correctly. More  
> specifically, I can't deserialize a string from an StringInStream  
> constructed from context.getInputSplit(). Even with the examples  
> bundled in the distribution archive(wordcount-nopipe.cc), it threw  
> exceptions. If anyone had experience on that, please kindly give  
> some advise.

So you mean the example with a C++ record reader? You have to use the  
InputFormat that generates input splits that consists of strings. Look  
at src/test/org/apache/hadoop/pipes/WordCountInputFormat.java

It would be useful to have a C++ impl of FileInputSplit too...

-- Owen