eclipse忽略条件断点(java for hadoop)

x33g5p2x  于 2021-05-31  发布在  Hadoop
关注(0)|答案(1)|浏览(311)

这是我的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。有什么问题吗?

rqqzpn5f

rqqzpn5f1#

像这样比较字符串:

"1".equals(tokens[2])

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

相关问题