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 Nan Zhu <zh...@gmail.com> on 2013/12/15 01:53:03 UTC
manipulate DFSInputStream in FSDataInputStream?
Hi, all
I’m modifying FSDataInputStream for some project,
I would like to directly manipulate “in" object in my implementation
as in the constructor a DFSInputStream is passed, so I convert “in” from InputStream to DFSInputStream with
import org.apache.hadoop.hdfs.DFSClient;
DFSClient.DFSInputStream dins = (DFSClient.DFSInputStream) in;
dins.somemethod(…)
when I compile my code with ant
it says that
[javac] /Users/zhunan/codes/SDNBigData/hadoop-1.2.1/src/core/org/apache/hadoop/fs/FSDataInputStream.java:20: error: package org.apache.hadoop.hdfs does not exist
[javac] import org.apache.hadoop.hdfs.DFSClient;
What does this mean?
it means that core is compiled before hdfs, so I cannot do this?
Thank you very much!
Best,
--
Nan Zhu
School of Computer Science,
McGill University
Re: manipulate DFSInputStream in FSDataInputStream?
Posted by Nan Zhu <zh...@gmail.com>.
Solved by declare an empty somemethod() in FSInputStream and override it in DFSInputStream
--
Nan Zhu
School of Computer Science,
McGill University
On Saturday, December 14, 2013 at 7:53 PM, Nan Zhu wrote:
> Hi, all
>
> I’m modifying FSDataInputStream for some project,
>
> I would like to directly manipulate “in" object in my implementation
>
> as in the constructor a DFSInputStream is passed, so I convert “in” from InputStream to DFSInputStream with
>
> import org.apache.hadoop.hdfs.DFSClient;
>
> DFSClient.DFSInputStream dins = (DFSClient.DFSInputStream) in;
> dins.somemethod(…)
>
>
> when I compile my code with ant
>
> it says that
>
> [javac] /Users/zhunan/codes/SDNBigData/hadoop-1.2.1/src/core/org/apache/hadoop/fs/FSDataInputStream.java:20: error: package org.apache.hadoop.hdfs does not exist
> [javac] import org.apache.hadoop.hdfs.DFSClient;
>
>
>
> What does this mean?
>
> it means that core is compiled before hdfs, so I cannot do this?
>
> Thank you very much!
>
> Best,
>
> --
> Nan Zhu
> School of Computer Science,
> McGill University
>
Re: manipulate DFSInputStream in FSDataInputStream?
Posted by Nan Zhu <zh...@gmail.com>.
Solved by declare an empty somemethod() in FSInputStream and override it in DFSInputStream
--
Nan Zhu
School of Computer Science,
McGill University
On Saturday, December 14, 2013 at 7:53 PM, Nan Zhu wrote:
> Hi, all
>
> I’m modifying FSDataInputStream for some project,
>
> I would like to directly manipulate “in" object in my implementation
>
> as in the constructor a DFSInputStream is passed, so I convert “in” from InputStream to DFSInputStream with
>
> import org.apache.hadoop.hdfs.DFSClient;
>
> DFSClient.DFSInputStream dins = (DFSClient.DFSInputStream) in;
> dins.somemethod(…)
>
>
> when I compile my code with ant
>
> it says that
>
> [javac] /Users/zhunan/codes/SDNBigData/hadoop-1.2.1/src/core/org/apache/hadoop/fs/FSDataInputStream.java:20: error: package org.apache.hadoop.hdfs does not exist
> [javac] import org.apache.hadoop.hdfs.DFSClient;
>
>
>
> What does this mean?
>
> it means that core is compiled before hdfs, so I cannot do this?
>
> Thank you very much!
>
> Best,
>
> --
> Nan Zhu
> School of Computer Science,
> McGill University
>
Re: manipulate DFSInputStream in FSDataInputStream?
Posted by Nan Zhu <zh...@gmail.com>.
Solved by declare an empty somemethod() in FSInputStream and override it in DFSInputStream
--
Nan Zhu
School of Computer Science,
McGill University
On Saturday, December 14, 2013 at 7:53 PM, Nan Zhu wrote:
> Hi, all
>
> I’m modifying FSDataInputStream for some project,
>
> I would like to directly manipulate “in" object in my implementation
>
> as in the constructor a DFSInputStream is passed, so I convert “in” from InputStream to DFSInputStream with
>
> import org.apache.hadoop.hdfs.DFSClient;
>
> DFSClient.DFSInputStream dins = (DFSClient.DFSInputStream) in;
> dins.somemethod(…)
>
>
> when I compile my code with ant
>
> it says that
>
> [javac] /Users/zhunan/codes/SDNBigData/hadoop-1.2.1/src/core/org/apache/hadoop/fs/FSDataInputStream.java:20: error: package org.apache.hadoop.hdfs does not exist
> [javac] import org.apache.hadoop.hdfs.DFSClient;
>
>
>
> What does this mean?
>
> it means that core is compiled before hdfs, so I cannot do this?
>
> Thank you very much!
>
> Best,
>
> --
> Nan Zhu
> School of Computer Science,
> McGill University
>
Re: manipulate DFSInputStream in FSDataInputStream?
Posted by Nan Zhu <zh...@gmail.com>.
Solved by declare an empty somemethod() in FSInputStream and override it in DFSInputStream
--
Nan Zhu
School of Computer Science,
McGill University
On Saturday, December 14, 2013 at 7:53 PM, Nan Zhu wrote:
> Hi, all
>
> I’m modifying FSDataInputStream for some project,
>
> I would like to directly manipulate “in" object in my implementation
>
> as in the constructor a DFSInputStream is passed, so I convert “in” from InputStream to DFSInputStream with
>
> import org.apache.hadoop.hdfs.DFSClient;
>
> DFSClient.DFSInputStream dins = (DFSClient.DFSInputStream) in;
> dins.somemethod(…)
>
>
> when I compile my code with ant
>
> it says that
>
> [javac] /Users/zhunan/codes/SDNBigData/hadoop-1.2.1/src/core/org/apache/hadoop/fs/FSDataInputStream.java:20: error: package org.apache.hadoop.hdfs does not exist
> [javac] import org.apache.hadoop.hdfs.DFSClient;
>
>
>
> What does this mean?
>
> it means that core is compiled before hdfs, so I cannot do this?
>
> Thank you very much!
>
> Best,
>
> --
> Nan Zhu
> School of Computer Science,
> McGill University
>