Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
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.
ParallelDeviceExecutor
public
class
ParallelDeviceExecutor
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.executor.ParallelDeviceExecutor<V>
|
Trình bao bọc ERROR(/ExecutorService)
để thực thi một hàm song song.
Tóm tắt
Phương thức công khai |
|
getErrors()
Danh sách lỗi khi thực thi tất cả tác vụ.
|
boolean
|
hasErrors()
Liệu có xảy ra lỗi hay không.
|
|
invokeAll( callableTasks, long timeout, TimeUnit unit)
Gọi tất cả ERROR(/Callable) có giới hạn thời gian chờ.
|
Hàm khởi tạo công khai
ParallelDeviceExecutor
public ParallelDeviceExecutor (int poolSize)
Phương thức công khai
getErrors
public getErrors ()
Danh sách lỗi khi thực thi tất cả tác vụ.
hasErrors
public boolean hasErrors ()
Liệu có xảy ra lỗi hay không.
invokeAll
public invokeAll ( callableTasks,
long timeout,
TimeUnit unit)
Gọi tất cả ERROR(/Callable)
có giới hạn thời gian chờ.
Tham số |
callableTasks |
: Danh sách việc cần làm. |
timeout |
long : Thời gian chờ áp dụng hoặc 0 để không giới hạn. |
unit |
TimeUnit : Đơn vị của thời gian chờ. |
Giá trị trả về |
|
Danh sách kết quả cho mỗi tác vụ có thể gọi. |
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# ParallelDeviceExecutor\n======================\n\n\n`\npublic\n\n\nclass\nParallelDeviceExecutor\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.util.executor.ParallelDeviceExecutor\\\u003cV\\\u003e |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nWrapper of [ERROR(/ExecutorService)](../../../../../../../) to execute a function in parallel.\n\nSummary\n-------\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[ParallelDeviceExecutor](../../../../../../../reference/tradefed/com/android/tradefed/util/executor/ParallelDeviceExecutor.html#ParallelDeviceExecutor(int))`(int poolSize) ` |\n\n| ### Public methods ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` ` | ` `[getErrors](../../../../../../../reference/tradefed/com/android/tradefed/util/executor/ParallelDeviceExecutor.html#getErrors())`() ` The list of errors from the execution of all tasks. |\n| ` boolean` | ` `[hasErrors](../../../../../../../reference/tradefed/com/android/tradefed/util/executor/ParallelDeviceExecutor.html#hasErrors())`() ` Whether or not some errors occurred or not. |\n| ` ` | ` `[invokeAll](../../../../../../../reference/tradefed/com/android/tradefed/util/executor/ParallelDeviceExecutor.html#invokeAll(\u003cany\u003e,%20long,%20TimeUnit))`(` callableTasks, long timeout, TimeUnit unit) Invoke all the [ERROR(/Callable)](../../../../../../../) with the timeout limit. |\n\nPublic constructors\n-------------------\n\n### ParallelDeviceExecutor\n\n```\npublic ParallelDeviceExecutor (int poolSize)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------|\n| `poolSize` | `int` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### getErrors\n\n```\npublic getErrors ()\n```\n\nThe list of errors from the execution of all tasks.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|--------|\n| | \u003cbr /\u003e |\n\n### hasErrors\n\n```\npublic boolean hasErrors ()\n```\n\nWhether or not some errors occurred or not.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n### invokeAll\n\n```\npublic invokeAll ( callableTasks, \n long timeout, \n TimeUnit unit)\n```\n\nInvoke all the [ERROR(/Callable)](../../../../../../../) with the timeout limit.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------------|-------------------------------------------------------------|\n| `callableTasks` | : The List of tasks. \u003cbr /\u003e |\n| `timeout` | `long`: The timeout to apply, or zero for unlimited. \u003cbr /\u003e |\n| `unit` | `TimeUnit`: The unit of the timeout. \u003cbr /\u003e |\n\n| Returns ||\n|---|----------------------------------------------------|\n| | The list of results for each callable task. \u003cbr /\u003e |"]]