运行Hadoop测试代码

$ cd $HADOOP_HOME

$ ant jar-test

$ bin/hadoop jar build/hadoop-0.19.1-dc-test.jar

//从列表中选择想运行的程序TEST_PROGRAM

$ bin/hadoop jar build/hadoop-0.19.1-dc-test.jar TEST_PROGRAM [args...]

 

若报错:

Caused by: java.lang.ClassNotFoundException: org.apache.jasper.runtime.JspSourceDependent

这种类找不到的错误,就是classpath没设好,没有把需要的class包含进来。

解决:

先查找缺失的类在哪个包,上面的类在lib/jsp-2.1/jsp-2.1.jar,所以要把jsp-2.1.jar放到lib下,或者改classpath。

 

对于测试框架中的NNThroughputBenchmark类,源码中没有把它编译进*-test.jar,查看build.xml后知道在AllTestDriver.java里面加上:

pgd.addClass("nnthroughput", NNThroughputBenchmark.class, "measure namenode throughput");

重新编译test包运行。

 

自己添加的新测试类,如果想用单机测试Namenode性能,需要在NameNode.createNameNode(argv, conf)前修改conf:

    //disable modification of access time for open/list/...
    conf.setInt("dfs.access.time.precision", 0);

    FileSystem.setDefaultUri(conf, "hdfs://localhost:" + 0);
    conf.set("dfs.http.address", "0.0.0.0:0");
    NameNode.format(conf);

 

 

 

运行单元测试:ant test-core -Dtestcase=org.apache.hadoop.hdfs.TestNNThroughputBenchmark

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值