首页 > 解决方案 > Eclipse 忽略条件断点(java for hadoop)

问题描述

这是我的java代码:

public class MoviesReviewsMapper extends Mapper <LongWritable, Text, Text, Text>
{
    public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException
    {

        String [] tokens = value.toString().split("::");        
        context.write(new Text(tokens[2]), new Text(tokens[0]));
    }
}

这是一个条件断点:

条件断点

Eciplse/SDK 的版本是 v4.7.0。有什么问题?

标签: javaeclipsehadoopconditionalbreakpoints

解决方案


像这样比较你的字符串:

"1".equals(tokens[2])

问题是您正在比较变量引用,而不是对象本身。


推荐阅读