ee.Reducer.combine
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้าง Reducer ที่เรียกใช้ Reducer 2 รายการแบบขนาน เอาต์พุตของตัวลดรวมจะเป็นเอาต์พุตของตัวลด 1 ตามด้วยเอาต์พุตของตัวลด 2 โดยชื่อเอาต์พุตของตัวลด 2 จะมีสตริงที่กำหนดเป็นคำนำหน้า
หาก sharedInputs เป็นจริง ตัวลดต้องมีอินพุตจำนวนเท่ากัน และตัวลดที่รวมกันจะตรงกับอินพุตเหล่านั้น หากเป็นเท็จ อินพุตของตัวลดที่รวมกันจะเป็นอินพุตของตัวลด 1 ตามด้วยอินพุตของตัวลด 2
การใช้งาน | การคืนสินค้า |
---|
Reducer.combine(reducer2, outputPrefix, sharedInputs) | ตัวลดตำแหน่ง |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ reducer1 | ตัวลดตำแหน่ง | ตัวลดตำแหน่งแรก |
reducer2 | ตัวลดตำแหน่ง | ตัวลดตำแหน่งที่ 2 |
outputPrefix | String, ค่าเริ่มต้น: "" | คำนำหน้าสำหรับชื่อเอาต์พุตของ Reducer2 |
sharedInputs | บูลีน ค่าเริ่มต้น: false | ไม่ว่าตัวลดจะแชร์อินพุตหรือไม่ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eCreates a combined Reducer by running two reducers (reducer1 and reducer2) concurrently, with the outputs of reducer1 preceding those of reducer2.\u003c/p\u003e\n"],["\u003cp\u003eOutputs of reducer2 are prefixed with a specified string to differentiate them from reducer1's outputs.\u003c/p\u003e\n"],["\u003cp\u003eInput handling for the combined reducer is configurable: if \u003ccode\u003esharedInputs\u003c/code\u003e is true, both reducers utilize the same inputs; otherwise, the combined reducer's inputs are those of reducer1 followed by those of reducer2.\u003c/p\u003e\n"],["\u003cp\u003eIt can be invoked using \u003ccode\u003eReducer.combine()\u003c/code\u003e method, accepting reducer2, output prefix, and shared input preference as arguments.\u003c/p\u003e\n"]]],[],null,["# ee.Reducer.combine\n\nCreates a Reducer that runs two reducers in parallel. The combined reducer's outputs will be those of reducer1 followed by those of reducer2, where the output names of reducer2 are prefixed with the given string.\n\n\u003cbr /\u003e\n\nIf sharedInputs is true, the reducers must have the same number of inputs, and the combined reducer's will match them; if it is false, the inputs of the combined reducer will be those of reducer1 followed by those of reducer2.\n\n| Usage | Returns |\n|------------------------------------------------------------------|---------|\n| Reducer.combine`(reducer2, `*outputPrefix* `, `*sharedInputs*`)` | Reducer |\n\n| Argument | Type | Details |\n|------------------|-------------------------|-------------------------------------|\n| this: `reducer1` | Reducer | The first reducer. |\n| `reducer2` | Reducer | The second reducer. |\n| `outputPrefix` | String, default: \"\" | Prefix for reducer2's output names. |\n| `sharedInputs` | Boolean, default: false | Whether the reducers share inputs. |"]]