Skip to content

Commit

Permalink
Remove the legacy implementation SimpleWorkerPool.
Browse files Browse the repository at this point in the history
#cleanup

PiperOrigin-RevId: 706981324
Change-Id: Ifda37ff1152e4c280e5406acc96f284f2127ce41
  • Loading branch information
bigelephant29 authored and copybara-github committed Dec 17, 2024
1 parent 21214f2 commit 69e066b
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 440 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/google/devtools/build/lib/worker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ java_library(
java_library(
name = "worker_pool_impl",
srcs = [
"SimpleWorkerPool.java",
"WorkerPoolImpl.java",
],
deps = [
Expand All @@ -243,7 +242,6 @@ java_library(
":worker_pool",
":worker_pool_config",
":worker_process_status",
"//third_party:apache_commons_pool2",
"//third_party:flogger",
"//third_party:guava",
"//third_party:jsr305",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void destroyWorker(WorkerKey key, Worker worker) {
/**
* Returns true if this worker is still valid. The worker is considered to be valid as long as its
* process has not exited and its files have not changed on disk. Validity is checked when the
* worker is created, borrowed and returned (see {@code SimpleWorkerPool.SimpleWorkerPoolConfig}).
* worker is created, borrowed and returned.
*/
@Override
public boolean validateObject(WorkerKey key, PooledObject<Worker> p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,10 @@
*
* <p>TODO(b/323880131): Remove documentation once we completely remove the legacy implementation.
*
* <p>Difference in internal implementation from {@code WorkerPoolLegacy}:
*
* <ul>
* <li>Legacy: WorkerPoolLegacy wraps multiple {@code SimpleWorkerPool} for each mnemonic. Each
* SimpleWorkerPool contains {@code Worker} instances capped per {@code WorkerKey}.
* <li>Current: This implementation flattens this to have a single {@code WorkerKeyPool} for each
* worker key (we don't need the indirection in referencing both mnemonic and worker key since
* the mnemonic is part of the key).
* <li>Legacy: SimpleWorkerPool extends {@code GenericKeyedObjectPool} that handles the logic to
* concurrent calls to borrow, return, invalidate and evict workers.
* <li>Current: WorkerKeyPool replaces this functionality directly, but can only handle pool logic
* for a single key (as compared to SimpleWorkerPool that handles multiple worker keys of the
* same mnemonic). Additionally, it bakes in pool shrinking logic so that we can handle
* concurrent calls.
* </ul>
* <p>This implementation flattens this to have a single {@code WorkerKeyPool} for each worker key
* (we don't need the indirection in referencing both mnemonic and worker key since the mnemonic is
* part of the key). Additionally, it bakes in pool shrinking logic so that we can handle concurrent
* calls.
*/
public class WorkerPoolImpl implements WorkerPool {

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/google/devtools/build/lib/worker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/worker:worker_pool",
"//src/main/java/com/google/devtools/build/lib/worker:worker_spawn_runner",
"//src/test/java/com/google/devtools/build/lib/actions/util",
"//third_party:error_prone_annotations",
"//third_party:guava",
],
)
Expand Down Expand Up @@ -136,7 +137,6 @@ java_library(
"//src/test/java/com/google/devtools/build/lib/vfs/util",
"//third_party:apache_commons_pool2",
"//third_party:guava",
"//third_party:guava-testlib",
"//third_party:jsr305",
"//third_party:junit4",
"//third_party:mockito",
Expand Down

This file was deleted.

Loading

0 comments on commit 69e066b

Please sign in to comment.