Memoir 发表于 2024-11-29 23:58:02

手游-cfm星辰裸奔吸附公益辅助



卡密随便输入即可

地址:
**** Hidden Message *****

wentao200341 发表于 2024-11-30 00:15:58

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

// Mapper 类
public static class PurchaseCountMapper extends Mapper<LongWritable, Text, Text, IntWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
      String line = value.toString();
      String[] parts = line.split("\t");// 根据实际数据的分隔符进行拆分
      String goods = parts;// 假设商品名称在第二列
      context.write(new Text(goods), new IntWritable(1));
    }
}

// Reducer 类
public static class PurchaseCountReducer extends Reducer<Text, IntWritable, Text, IntWritable> {
    @Override
    protected void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {
      int sum = 0;
      for (IntWritable value : values) {
            sum += value.get();
      }
      context.write(key, new IntWritable(sum));
    }
}

871882045 发表于 2024-11-30 09:43:40

啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊

大帅哥123 发表于 2024-11-30 11:37:13

谢谢你的支持!

祈星. 发表于 2024-11-30 15:47:38

:lol:lol:lol:lol

da651330289 发表于 2024-11-30 16:22:04

应该不会被封吧?
支持你奥,正需要,辛苦啦!
页: [1]
查看完整版本: 手游-cfm星辰裸奔吸附公益辅助