<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                *(面試:Combiner 的運行位置及其作用)* <br/> 1. Combiner 是 MR 程序中 Mapper 和 Reducer 之外的一種組件。 2. Combiner 組件的父類就是 Reducer。 3. Combiner 和 Reducer 的區別在于<mark>運行的位置</mark>: ? <ins>Combiner 是在每一個 MapTask 所在的節點運行</ins>; ? Reducer 是接收全局所有 Mapper 的輸出結果; 4. <ins>Combiner 的意義就是對每一個 maptask 的輸出先進行局部匯總,以減小網絡傳輸量</ins>。 5. Combiner 能夠應用的前提是不能影響最終的業務邏輯(比如求平均值就不能使用),而且,Combiner 的輸出 kv 應該跟 Reducer 的輸入 kv 類型要對應起來。 6. 自定義 Combiner 實現步驟: ``` 為【MapReduce基本使用 -> WordCount案例 -> WordCount案例代碼】這個示例設置Combiner. ``` (1)自定義一個 combiner 繼承 Reducer,重寫 reduce 方法。 將 WordcountReducer 作為 combiner 在 WordcountDriver 驅動類中指定(也可以自定義 combiner,使用自定 reducer 作為 combiner 的前提是,reducer 的輸入和 combiner 的輸出類型相同)。 (2)在 Driver 中添加combiner。 ```java // 指定需要使用 combiner,以及用哪個類作為 combiner 的邏輯 job.setCombinerClass(WordcountReducer.class); ``` 運行程序: ![](https://img.kancloud.cn/9d/3b/9d3b75ea9ecc7c8dc712fa3d3f599c31_1198x340.png) ![](https://img.kancloud.cn/7d/e3/7de378f87ac00b812b265e2248a378cd_1203x345.png) 從輸出結果上可以分析出,加入 Combiner 之后,會在 Map 端進行局部集合,減少了 Reducer 端拉取數據的數據量。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看