import java.io.InputStream;
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.io.IOUtils;
public class FileSystemCat {
public static void main(String [] args) throws Exception
{
String uri=args[0];
Configuration conf = new Configuration();
FileSystem fs= FileSystem. get(URI.create(uri),conf);
InputStream in =null;
try {
in =fs.open(new Path(uri));
IOUtils.copyBytes(in,System.out,4096,false);
}finally {
IOUtils.closeStream(in);
}
}
}
hadoop jar FileSystemCat.jar FileSystemCat /class4/quangle.txt
jar -cvf FileSystemCat.jar File*.class
http://dblab.xmu.edu.cn/blog/1080-2/?tdsourcetag=s_pcqq_aiomsg
下载 Hive1.1.1地址: http://www.eu.apache.org/dist/hive/
下载 Mysql JDCB 地址: http://dev.mysql.com/downloads/connector/j/