ee.Reducer.combine
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tạo một Reducer chạy song song hai reducer. Đầu ra của bộ kết hợp sẽ là đầu ra của reducer1, sau đó là đầu ra của reducer2, trong đó tên đầu ra của reducer2 có tiền tố là chuỗi đã cho.
Nếu sharedInputs là true, thì các reducer phải có cùng số lượng đầu vào và các đầu vào của reducer kết hợp sẽ khớp với các đầu vào này; nếu sharedInputs là false, thì các đầu vào của reducer kết hợp sẽ là các đầu vào của reducer1, sau đó là các đầu vào của reducer2.
Cách sử dụng | Giá trị trả về |
---|
Reducer.combine(reducer2, outputPrefix, sharedInputs) | Bộ giảm tốc |
Đối số | Loại | Thông tin chi tiết |
---|
this: reducer1 | Bộ giảm tốc | Trình giảm tốc đầu tiên. |
reducer2 | Bộ giảm tốc | Trình giảm thứ hai. |
outputPrefix | Chuỗi, mặc định: "" | Tiền tố cho tên đầu ra của reducer2. |
sharedInputs | Boolean, mặc định: false | Liệu các hàm giảm có chia sẻ dữ liệu đầu vào hay không. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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. |"]]