Hadoop源码篇--Reduce篇

基于hadoop下的使用map reduce分布式系统的高考高频词汇统计(内有源码下载) hadoop课程设计报告一、设计目的与要求1、设计目的通过hadoop课程设计可以加深、巩固对本门专业课程理论知识的掌握。通过eclipse和hadoop来编写课设报告等方面的实践训练,筑牢编程基础,培养良好的逻辑思维能力,提高综合运用能力。同时也锻炼学生自我管理和自我发展的能力,合理安排时间完成自己的任务,促进个人和集体良好的合作交往。基于hadoop下的mapreduce分布式系统具体要求:二、设计内容1、设计题目和环境题目:基于hadoop下的高考英语高频词汇分析语言:Java+Linux环境:ecl 阅读详情

声明~由于不同博客平台代码阅读样式不一样,所以欢迎访问

本人博客园地址:Hadoop源码篇--Reduce篇

个人网页博客地址:Hadoop源码篇--Reduce篇 

带给你不一样的阅读体验~

一。前述

Reduce文件会从Mapper任务中拉取很多小文件,小文件内部有序,但是整体是没序的,Reduce会合并小文件,然后套个归并算法,变成一个整体有序的文件。

二。代码

 ReduceTask源码:

 public void run(JobConf job, final TaskUmbilicalProtocol umbilical)
    throws IOException, InterruptedException, ClassNotFoundException {
    job.setBoolean(JobContext.SKIP_RECORDS, isSkipping());

    if (isMapOrReduce()) {
      copyPhase = getProgress().addPhase("copy");
      sortPhase  = getProgress().addPhase("sort");
      reducePhase = getProgress().addPhase("reduce");
    }
    // start thread that will handle communication with parent
    TaskReporter reporter = startReporter(umbilical);
    
    boolean useNewApi = job.getUseNewReducer();
    initialize(job, getJobID(), reporter, useNewApi);

    // check if it is a cleanupJobTask
    if (jobCleanup) {
      runJobCleanupTask(umbilical, reporter);
      return;
    }
    if (jobSetup) {
      runJobSetupTask(umbilical, reporter);
      return;
    }
    if (taskCleanup) {
      runTaskCleanupTask(umbilical, reporter);
      return;
    }
    
    // Initialize the codec
    codec = initCodec();
    RawKeyValueIterator rIter = null;
    ShuffleConsumerPlugin shuffleConsumerPlugin = null;
    
    Class combinerClass = conf.getCombinerClass();
    CombineOutputCollector combineCollector = 
      (null != combinerClass) ? 
     new CombineOutputCollector(reduceCombineOutputCounter, reporter, conf) : null;

    Class<? extends ShuffleConsumerPlugin> clazz =
          job.getClass(MRConfig.SHUFFLE_CONSUMER_PLUGIN, Shuffle.class, ShuffleConsumerPlugin.class);
                    
    shuffleConsumerPlugin = ReflectionUtils.newInstance(clazz, job);
    LOG.info("Using ShuffleConsumerPlugin: " + shuffleConsumerPlugin);

    ShuffleConsumerPlugin.Context shuffleContext = 
      new ShuffleConsumerPlugin.Context(getTaskID(), job, FileSystem.getLocal(job), umbilical, 
                  super.lDirAlloc, reporter, codec, 
                  combinerClass, combineCollector, 
                  spilledRecordsCounter, reduceCombineInputCounter,
                  shuffledMapsCounter,
                  reduceShuffleBytes, failedShuffleCounter,
                  mergedMapOutputsCounter,
                  taskStatus, copyPhase, sortPhase, this,
                  mapOutputFile, localMapFiles);
    shuffleConsumerPlugin.init(shuffleContext);

    rIter = shuffleConsumerPlugin.run();//按顺序迭代

    // free up the data structures
    mapOutputFilesOnDisk.clear();
    
    sortPhase.complete();                         // sort is complete
    setPhase(TaskStatus.Phase.REDUCE); 
    statusUpdate(umbilical);
    Class keyClass = job.getMapOutputKeyClass();
    Class valueClass = job.getMapOutputValueClass();
    RawComparator comparator = job.getOutputValueGroupingComparator();//分组比较 对应解析源码1

    if (useNewApi) {
      runNewReducer(job, umbilical, reporter, rIter, comparator, //对应解析源码2
                    keyClass, valueClass);
    } else {
      runOldReducer(job, umbilical, reporter, rIter, comparator, 
                    keyClass, valueClass);
    }

    shuffleConsumerPlugin.close();
    done(umbilical, reporter);
  }

 源码1:分组比较器的源码

public RawComparator getOutputValueGroupingComparator() {
    Class<? extends RawComparator> theClass = getClass(
      JobContext.GROUP_COMPARATOR_CLASS, null, RawComparator.class);//用户没有设置分组比较器的时候,用默认的
    if (theClass == null) {
      return getOutputKeyComparator();//对应解析源码1.1
    }
    
    return ReflectionUtils.newInstance(theClass, this);
  }


    源码1.1排序比较器,当用户不设置的时候取排序比较器实现,此时如果用户配置排序比较器,用排序比较器,没有的话用默认的Key的比较器

  public RawComparator getOutputKeyComparator() {
    Class<? extends RawComparator> theClass = getClass(
      JobContext.KEY_COMPARATOR, null, RawComparator.class);
    if (theClass != null)
      return ReflectionUtils.newInstance(theClass, this);
    return WritableComparator.get(getMapOutputKeyClass().asSubclass(WritableComparable.class), this);
  }


 总结:

 在Map端是真正改变(调整)Key的顺序的,在Reduce端是不会真正改变(调整)拉过来的其顺序的,Reduce不会重新排序,Reduce端强依赖Map端的输出。

解析源码2:runNewReduce的实现

void runNewReducer(JobConf job,
                     final TaskUmbilicalProtocol umbilical,
                     final TaskReporter reporter,
                     RawKeyValueIterator rIter,
                     RawComparator<INKEY> comparator,
                     Class<INKEY> keyClass,
                     Class<INVALUE> valueClass
                     ) throws IOException,InterruptedException, 
                              ClassNotFoundException {
    // wrap value iterator to report progress.
    final RawKeyValueIterator rawIter = rIter;//真正的迭代器
    rIter = new RawKeyValueIterator() {
      public void close() throws IOException {
        rawIter.close();
      }
      public DataInputBuffer getKey() throws IOException {
        return rawIter.getKey();
      }
      public Progress getProgress() {
        return rawIter.getProgress();
      }
      public DataInputBuffer getValue() throws IOException {
        return rawIter.getValue();
      }
      public boolean next() throws IOException {
        boolean ret = rawIter.next();
        reporter.setProgress(rawIter.getProgress().getProgress());
        return ret;
      }
    };
    // make a task context so we can get the classes
    org.apache.hadoop.mapreduce.TaskAttemptContext taskContext =
      new org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl(job,
          getTaskID(), reporter);
    // make a reducer
    org.apache.hadoop.mapreduce.Reducer<INKEY,INVALUE,OUTKEY,OUTVALUE> reducer =
      (org.apache.hadoop.mapreduce.Reducer<INKEY,INVALUE,OUTKEY,OUTVALUE>)
        ReflectionUtils.newInstance(taskContext.getReducerClass(), job);
    org.apache.hadoop.mapreduce.RecordWriter<OUTKEY,OUTVALUE> trackedRW = 
      new NewTrackingRecordWriter<OUTKEY, OUTVALUE>(this, taskContext);
    job.setBoolean("mapred.skip.on", isSkipping());
    job.setBoolean(JobContext.SKIP_RECORDS, isSkipping());
    org.apache.hadoop.mapreduce.Reducer.Context 
         reducerContext = createReduceContext(reducer, job, getTaskID(),
                                               rIter, reduceInputKeyCounter, //构建上下文的时候把迭代器传进来
                                               reduceInputValueCounter, 
                                               trackedRW,
                                               committer,
                                               reporter, comparator, keyClass,//比较器  解析源码2.1
                                               valueClass);
    try {
      reducer.run(reducerContext);//构建完上下文之后运行Redude的Run方法 解析源码Reduce2.2
    } finally {
      trackedRW.close(reducerContext);
    }
  }

解析源码2.1: createReduceContext实现构建上下文的源码

public ReduceContextImpl(Configuration conf, TaskAttemptID taskid,
                           RawKeyValueIterator input, //把迭代器传给输入对象Input
                           Counter inputKeyCounter,
                           Counter inputValueCounter,
                           RecordWriter<KEYOUT,VALUEOUT> output,
                           OutputCommitter committer,
                           StatusReporter reporter,
                           RawComparator<KEYIN> comparator,
                           Class<KEYIN> keyClass,
                           Class<VALUEIN> valueClass
                          ) throws InterruptedException, IOException{
    super(conf, taskid, output, committer, reporter);
    this.input = input;
    this.inputKeyCounter = inputKeyCounter;
    this.inputValueCounter = inputValueCounter;
    this.comparator = comparator;
    this.serializationFactory = new SerializationFactory(conf);
    this.keyDeserializer = serializationFactory.getDeserializer(keyClass);
    this.keyDeserializer.open(buffer);
    this.valueDeserializer = serializationFactory.getDeserializer(valueClass);
    this.valueDeserializer.open(buffer);
    hasMore = input.next();
    this.keyClass = keyClass;
    this.valueClass = valueClass;
    this.conf = conf;
    this.taskid = taskid;
  }
/** Start processing next unique key. */
  public boolean nextKey() throws IOException,InterruptedException {//实际上Reduce中run方法中的contect.netKey调用的逻辑
    while (hasMore && nextKeyIsSame) {//第一次假 放空
      nextKeyValue();
    }
    if (hasMore) {
      if (inputKeyCounter != null) {
        inputKeyCounter.increment(1);
      }
      return nextKeyValue();
    } else {
      return false;
    }
  }

  /**
   * Advance to the next key/value pair.
   */
  @Override
  public boolean nextKeyValue() throws IOException, InterruptedException {
    if (!hasMore) {
      key = null;
      value = null;
      return false;
    }
    firstValue = !nextKeyIsSame;
    DataInputBuffer nextKey = input.getKey();
    currentRawKey.set(nextKey.getData(), nextKey.getPosition(), 
                      nextKey.getLength() - nextKey.getPosition());
    buffer.reset(currentRawKey.getBytes(), 0, currentRawKey.getLength());
    key = keyDeserializer.deserialize(key);
    DataInputBuffer nextVal = input.getValue();
    buffer.reset(nextVal.getData(), nextVal.getPosition(), nextVal.getLength()
        - nextVal.getPosition());
    value = valueDeserializer.deserialize(value);

    currentKeyLength = nextKey.getLength() - nextKey.getPosition();
    currentValueLength = nextVal.getLength() - nextVal.getPosition();

    if (isMarked) {
      backupStore.write(nextKey, nextVal);
    }

    hasMore = input.next();
    if (hasMore) {
      nextKey = input.getKey();
      nextKeyIsSame = comparator.compare(currentRawKey.getBytes(), 0, 
                                     currentRawKey.getLength(),
                                     nextKey.getData(),
                                     nextKey.getPosition(),
                                     nextKey.getLength() - nextKey.getPosition()
                                         ) == 0;//判断当前key和下一个Key是否相等。
    } else {
      nextKeyIsSame = false;
    }
    inputValueCounter.increment(1);
    return true;
  }

  public KEYIN getCurrentKey() {
    return key;
  }

  @Override
  public VALUEIN getCurrentValue() {
    return value;
  }
  

解析源码2.2 Reduce

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.hadoop.mapreduce;

import java.io.IOException;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapreduce.task.annotation.Checkpointable;

import java.util.Iterator;


 * public class IntSumReducer<Key> extends Reducer<Key,IntWritable,
 *                                                 Key,IntWritable> {
 *   private IntWritable result = new IntWritable();
 * 
 *   public void reduce(Key key, Iterable<IntWritable> values,
 *                      Context context) throws IOException, InterruptedException {
 *     int sum = 0;
 *     for (IntWritable val : values) {
 *       sum += val.get();
 *     }
 *     result.set(sum);
 *     context.write(key, result);
 *   }
 * }
 * </pre></blockquote></p>
 * 
 * @see Mapper
 * @see Partitioner
 */
@Checkpointable
@InterfaceAudience.Public
@InterfaceStability.Stable
public class Reducer<KEYIN,VALUEIN,KEYOUT,VALUEOUT> {

  /**
   * The <code>Context</code> passed on to the {@link Reducer} implementations.
   */
  public abstract class Context 
    implements ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> {
  }

  /**
   * Called once at the start of the task.
   */
  protected void setup(Context context
                       ) throws IOException, InterruptedException {
    // NOTHING
  }

  /**
   * This method is called once for each key. Most applications will define
   * their reduce class by overriding this method. The default implementation
   * is an identity function.
   */
  @SuppressWarnings("unchecked")
  protected void reduce(KEYIN key, Iterable<VALUEIN> values, Context context
                        ) throws IOException, InterruptedException {
    for(VALUEIN value: values) {
      context.write((KEYOUT) key, (VALUEOUT) value);
    }
  }

  /**
   * Called once at the end of the task.
   */
  protected void cleanup(Context context
                         ) throws IOException, InterruptedException {
    // NOTHING
  }

  /**
   * Advanced application writers can use the 
   * {@link #run(org.apache.hadoop.mapreduce.Reducer.Context)} method to
   * control how the reduce task works.
   */
  public void run(Context context) throws IOException, InterruptedException {
    setup(context);
    try {
      while (context.nextKey()) {//实际上在这一步里实际上调用了NextKeyValue的值更新了 hasmore,nextKeyisSame,Key,Value的值
        reduce(context.getCurrentKey(), context.getValues(), context);//解析源码2.2.1
        // If a back up store is used, reset it
        Iterator<VALUEIN> iter = context.getValues().iterator();
        if(iter instanceof ReduceContext.ValueIterator) {
          ((ReduceContext.ValueIterator<VALUEIN>)iter).resetBackupStore();        
        }
      }
    } finally {
      cleanup(context);
    }
  }
}

源码2.2.1context.getValues的最终实现是一个迭代器

protected class ValueIterator implements ReduceContext.ValueIterator<VALUEIN> {

    private boolean inReset = false;
    private boolean clearMarkFlag = false;

    @Override
    public boolean hasNext() {
      try {
        if (inReset && backupStore.hasNext()) {
          return true;
        } 
      } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException("hasNext failed", e);
      }
      return firstValue || nextKeyIsSame;
    }

    @Override
    public VALUEIN next() {
      if (inReset) {
        try {
          if (backupStore.hasNext()) {
            backupStore.next();
            DataInputBuffer next = backupStore.nextValue();
            buffer.reset(next.getData(), next.getPosition(), next.getLength()
                - next.getPosition());
            value = valueDeserializer.deserialize(value);
            return value;
          } else {
            inReset = false;
            backupStore.exitResetMode();
            if (clearMarkFlag) {
              clearMarkFlag = false;
              isMarked = false;
            }
          }
        } catch (IOException e) {
          e.printStackTrace();
          throw new RuntimeException("next value iterator failed", e);
        }
      } 

      // if this is the first record, we don't need to advance
      if (firstValue) {
        firstValue = false;
        return value;
      }
      // if this isn't the first record and the next key is different, they
      // can't advance it here.
      if (!nextKeyIsSame) {
        throw new NoSuchElementException("iterate past last value");
      }
      // otherwise, go to the next key/value pair
      try {
        nextKeyValue();//这个迭代器自身是没有数据的,在Next中调用的还是 nextKeyValue,在这个NextKeyValue中调用的是Input的输入数据
        return value;
      } catch (IOException ie) {
        throw new RuntimeException("next value iterator failed", ie);
      } catch (InterruptedException ie) {
        // this is bad, but we can't modify the exception list of java.util
        throw new RuntimeException("next value iterator interrupted", ie);        
      }
    }

总结:以上说明一个流程。Reduce会拉回一个数据集,然后封装一个迭代器,真迭代器,ReduceContext会基于这个迭代器给我们封装一个方法,其中包括NextKeyValue这个方法,通过这个方法简介更新Key,Value的值,然后再Reduce方法的Run中有一个While循环,调用的是NextKey方法,底层调用的还是netxkeyValue方法,然后调用Reduce方法,传进去context.getCurrentKey(), context.getValues()两个方法,然后基于Value方法迭代,里面有HasNext和Next方法,Next方法实际上调用的还是真正的迭代器,最终数据时从镇迭代器中迭代出来的,在真正迭代器中有一个重要的标识NextKeyisSame,这个标识会被hasNext方法用到然后判断下一个key是否 相同,直到一组数据。

PS:补充一个知识点:

 next调用的是NextKeyValue的方法,会把KeyValue真正改变,所以这块传的是引用传递。会改变同一块内存中的数据。

 

持续更新中。。。。,欢迎大家关注我的公众号LHWorld.

 

 

hadoop中关于reduce参数values遍历导致key值变化和遍历中value对象是一个的问题源码分析 hadoop中关于reduce参数values遍历导致key值变化和遍历中value对象是一个的问题分析 一,问题发现 1,遍历reduce中的values参数 key值也会随之变化 假设有如下需求:有一批订单 一个订单有多个商品 现在需要根据订单id分组 在把一组订单中的商品按照价格排序 mapper代码 /** * @ClassName Job13Mapper * @Description... 阅读详情

相关推荐

Hadoop整个MR的过程源码解析(三)-reduce端任务的执行

刚刚又从头到尾的看了一下reduce的源码,个人感觉有几个重点,shuffle、sort、以及reduce,其中shuffle和sort阶段是并行发生的,当内存中的数据到达默认的内存峰值时,会自动触发文件的落地操作。相对于前两个阶段,reduce就更为直接,重要的东西由这几个,底层迭代器,封装的二次迭代器,nextKeyValue的方法,nextKeyIsSame的用处以及赋值。接下来仔细看代码 ...

Galaxy_songypd的博客 1001

控制MapReduce输出文件个数及格式

控制MapReduce多文件输出 默认情况下MapReduce任务结束后一个reduce产生一个输出文件,文件名类似part-xxxxx, 有时为了方便后续对这些文件的处理,比如根据文件名import到不通的hive分区,我们需要控制reduce输出产生的文件名,让相同的reduce key写入同一个文件,此时可继承MultipleOutputFormat重载generateFileNameFo...

jinjiating的专栏 6077

让一个reducer产生多个输出文件.docx

让一个reducer产生多个输出文件.docx

MapReduce-多个输出(使用MultipleOutput,不指定reduce任务个数)

多个输出 FileOutputFormat及其子类产生的文件放在输出目录下。每个reduce一个文件并且文件由分区号命名:part-r-00000,part-r-00001,等等。有时可能需要对输出的文件名进行控制或让每个reducer输出多个文件。MapReduce为此提供了MultipleOutputFormat类。 案例:数据分割 按气象站来区分气象数据。这需要运行一个作业,作业的输出...

weixin_30617737的博客 334

LEF 5.8 Language Reference学习笔记

您可以在一个 LEF 文件中定义所有元件库信息,但这样会产生一个复杂且难以管理的大文件。相反,您可以将信息分为两个文件,一个是 "technology "LEF 文件,另一个是 "cell library "LEF 文件。

yajuan的专栏 4108

eCognition易康面向对象分类批量选择样本,批量导出shp

可以的,使用这个工具条最右边那个三角尺manual editing toolbar,这是用来直接指定类别的,咱们可以拿它选完以后把指定的类别转成训练样本。另一个好处是,这个选出来的样本可以直接导出成shp,但select sample是不可以的,只能导出TTAMask也就是栅格掩膜。如果要导出shp,要在转之前导出。中间那条有点点的红线就是我的鼠标轨迹,只要碰到的对象就会全部选中,然后一点3的那个按钮就直接全部划分为林地了,十分丝滑。在弹出来的工作条里,首先选择你的类别,比如这里选一个forest。

qq_61845364的博客 4071

hadoop 源码解析其二(reduce)

reduce 过程的实现(不包含数据拉取部分)首先调用 ReduceTask run 方法开始: 1, 实现 shuffer 拉取数据 返回是迭代器 ,然后构造reducerContext(Reducer 上下文),返还给 reducer.run(reducerContext) 2, 在 reducer.run(reducerContext)之中 调用 ReduceConte...

351

宝塔面板 python管理器2.0安装Mrdoc

自从python管理器从1.9升级2.0后,导致原教程不能使用。 故关于2.0新开教程如下。 关于python管理器2.0 最大的区别在于: python管理器2.0不再需要进入虚拟环境,直接在当前环境进行操作,但是需要指定python路径及pip路径。 1、新建mrdoc工程目录,下载源码: 新建目录【mrdoc】,进入mrdoc目录,并在宝塔ssh或或远程ssh中执行 ,下载源码 git clone https://gitee.com/yang_lite/MrDoc.git .

debj031634的专栏 6002

MapReduce详解

在研究了几天的MapReduce框架后,发现确实是和之前的编程思路不太一样,在此先转一篇供大家学习。     3.3 新的WordCount分析 1)源代码程序   package org.apache.hadoop.examples; import java.io.IOException; import java.util.StringTokenizer; impo

cy20101234的博客 1316

Tessent MBIST SDC

主要是两个PROC,tessent_constrain_${design_name}_mentor_ijtag_non_modal和tessent_constrain_${design_name}_mentor_memory_bist_modal。其中,Memory/MBIST controller/MEM Interface可以从func_clk_1来(用func_clk_1和func_clk_2的高频时钟),如图中红色线。其中,SIB和BAP用ijtag_tck的clock,如图绿色线。

po_poo的博客 1994

华为OD干了两个月,还是跑了

​本人工作了快13年,base南京。2024年2月份由于公司业务变动第一次拿到了公司发的大礼包,同时也面临着失业的问题,我对自己的技术还是很有信心的,但是,找了大概有一个多月时间,发现心意的工作的确不太好找,当然收到挺多家offer,就是薪资不太满意,外包也一直不想去,不过说实话外包给的薪资普遍要比自研的单位要高一些,最后为了钱还是进华为(既然选择外包那就选择好一些的吧),毕竟中年老男人工作不能断太久。

啊渊的专栏 1万+

MapReduce 进阶

1HDFS数据格式详解: 1.1文件格式 分为面向行和面向列的两大类文件格式 面向行 : 文本文件格式(.TXT) 可切分 优点:查看方便编辑简单 缺点:无压缩占空间打,传输业利达,数据解析开销大 适用场景:学习练习使用 面向行: 序列文件格式(.seq) 可切分 优点:衍生支持,二进制kv存储,支持行和块压缩 缺点:本地查看不方便,小文件合并成KV结构后不易查看内部数据 适用场景:生产环境使用。map 输出的默认文件格式 面向列:(.rc)可切分 优点:数据加载快,查询快,空间利用率高,高负载

weixin_46579297的博客 534

LPDDR6与LPDDR5 State Diagram技术探讨

LPDDR6与LPDDR5 State Diagram技术探讨

zilan23的博客 1178

Hadoop源码篇之Reduce

Reduce文件会从Mapper任务中拉取很多小文件,小文件内部有序,但是整体是没序的,Reduce会合并小文件,然后套个归并算法,变成一个整体有序的文件。 一、代码 public void run(JobConf job, final TaskUmbilicalProtocol umbilical) throws IOException, InterruptedException,...

lixinkuan的博客 868

【华为OD机试真题】3、 路灯照明问题 | 机试真题+思路参考+代码解析(C++、Java、Py、C语言、JS)

题目描述 >在一条笔直的公路上安装了N个路灯,从位置0开始安装,路灯之间间距固定为100米。 每个路灯都有自己的照明半径,请计算第一个路灯和最后一个路灯之间,无法照明的区间的长度和。

KJ.JK 1万+

【语音识别】基于MFCC特征实现说话人语音识别matlab源码

1 模型 采用能够反映人对语音的感知特性的Mel频率倒谱系数(MFCC)作为特征参数,以及为避免时间规整问题采用矢量量化技术开发的说话人识别系统.MFCC主要的是模拟人耳的听觉过程,相对于其它参数它对语音波形的变化不敏感,更加稳定,系统取得很好的识别结果,实验表明系统训练和识别的计算量和存储量都比较低. 2 部分代码 functionvarargout=Main(varargin) % MAIN M-file for Main.fig % MAIN, by itself...

qq_59747472的博客 852

Linux设备驱动工程师:核心技能、高薪逻辑与入行路线全解析

设备驱动是操作系统与底层硬件之间的桥梁,其本质是让CPU通过统一接口驾驭千差万别的外设。理解设备驱动,需要从内核态与用户态的分工、字符设备框架、设备树解耦机制,以及中断与并发同步等核心原理入手。驱动开发的工程价值在于保障系统的稳定性与实时性,尤其在智能汽车、物联网、边缘计算和国产芯片替代等场景中,Linux内核驱动人才需求持续攀升。掌握驱动技能,不仅意味着能读懂芯片手册和内核源码,更意味着具备从寄存器配置到系统级调试的全局能力。本文围绕驱动工程师的日常工作、关键技术栈、薪资构成及面试要点展开,为零基础转型者

weixin_34268169的博客 339

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Hadoop学习日记(七)——wordcount编写和提交集群运行

Hadoop学习日记(七) 2019.03.08 主题:wordcount编写和提交集群运行 这部分内容的学习主要参考段海涛Hadoop之p24 这部分的学习主要是编写了WCMapper、WCReducer、WCRunner三个类,以及最终打包成jar包提交集群运行。 一、关键点汇总 1. 在wordcount实例里,WCReducer中Reduce()方法数据输入的value其实是一...

WorkAsBryant的博客 319

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Hadoop-MapReduce-Reduce阶段调用reduce()方法过程源码分析

Hadoop-MapReduce-Reduce阶段调用reduce()方法过程源码分析

H_X_P_的博客 895

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

Hadoop Map-Reduce源码分析(Map)

Hadoop Map-Reduce源码分析(Map) Mapper 注本文前提条件,您已知道Map的逻辑和其具体的细分步骤 以WordCount代码为例子 public class MyMapperMap extends Mapper<Object, Text, Text, IntWritable> public class MyMapperReduce extends Reducer<Text, IntWritable, Text, IntWritable> 我们自己写的

qq_32193775的博客 368

Hadoop 教程 - Hadoop MapReduce Reduce阶段核心源码分析

Hadoop MapReduce的Reduce阶段负责聚集Map阶段产生的中间键值对,对其进行合并、排序,最终生成最终输出结果。

qq_33240556的博客 480

Hadoop生态圈(二十九)- MapReduce Reduce阶段核心源码分析

Reduce阶段整体概述,前置:解读ReduceTask类,第一层调用(ReduceTask.run),reduce阶段的任务划分,shuffle操作,第二层调用(runNewReducer)准备部分,第二层调用(runNewReducer)工作部分,Shuffle-init,Shuffle-run,Shuffle-Copy阶段,Shuffle-Merge阶段,Shuffle-Sort阶段,OutputFormat,EventFetcher线程,fetchers线程

程序园@大Null 2135

Hadoop源码篇之客户端Job

一、前述 剖析hadoop源码,首先从Client看起,因为Client在MapReduce的过程中承担了很多重要的角色。 二、MapReduce框架主类 代码如下: public static void main(String[] args) throws Exception { // System.setProperty("hadoop.home.dir", "E:/Hadoo...

lixinkuan的博客 1025

hadoop源码阅读

1、hadoop源码下载 下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/ 2、我们看一下hadoop源码中提供的一个程序WordCount 1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * ...

weixin_30502965的博客 197
上一篇: Hadoop源码篇---解读Mapprer源码outPut输出
下一篇: HBase篇--搭建HBase完全分布式集群
L先生AI课堂
L先生AI课堂 领域专家: 大数据技术领域 领域专家: 大数据技术领域
博客等级 码龄9年 678粉丝 216原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

L先生AI课堂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值