51
51
import com .google .common .collect .ImmutableMap ;
52
52
import com .google .common .collect .ImmutableSortedMap ;
53
53
import com .google .common .collect .Maps ;
54
- import com .google .common .eventbus .EventBus ;
55
54
import com .google .common .util .concurrent .ListeningScheduledExecutorService ;
56
55
import com .google .common .util .concurrent .MoreExecutors ;
57
56
import com .google .devtools .build .lib .actions .ActionInputHelper ;
61
60
import com .google .devtools .build .lib .authandtls .CallCredentialsProvider ;
62
61
import com .google .devtools .build .lib .authandtls .GoogleAuthUtils ;
63
62
import com .google .devtools .build .lib .clock .JavaClock ;
64
- import com .google .devtools .build .lib .events .Reporter ;
63
+ import com .google .devtools .build .lib .events .NullEventHandler ;
65
64
import com .google .devtools .build .lib .remote .RemoteRetrier .ExponentialBackoff ;
66
65
import com .google .devtools .build .lib .remote .Retrier .Backoff ;
67
66
import com .google .devtools .build .lib .remote .common .RemoteActionExecutionContext ;
@@ -132,7 +131,6 @@ public class GrpcCacheClientTest {
132
131
private Path execRoot ;
133
132
private FileOutErr outErr ;
134
133
private FakeActionInputFileCache fakeFileCache ;
135
- private final Reporter reporter = new Reporter (new EventBus ());
136
134
private final MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry ();
137
135
private final String fakeServerName = "fake server for " + getClass ();
138
136
private Server fakeServer ;
@@ -271,7 +269,7 @@ private static byte[] downloadBlob(
271
269
public void testVirtualActionInputSupport () throws Exception {
272
270
RemoteOptions options = Options .getDefaults (RemoteOptions .class );
273
271
RemoteExecutionCache client =
274
- new RemoteExecutionCache (reporter , newClient (options ), options , DIGEST_UTIL );
272
+ new RemoteExecutionCache (newClient (options ), options , DIGEST_UTIL );
275
273
PathFragment execPath = PathFragment .create ("my/exec/path" );
276
274
VirtualActionInput virtualActionInput =
277
275
ActionsTestUtil .createVirtualActionInput (execPath , "hello" );
@@ -381,7 +379,7 @@ public void testDownloadAllResults() throws Exception {
381
379
// arrange
382
380
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
383
381
GrpcCacheClient client = newClient (remoteOptions );
384
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
382
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
385
383
386
384
Digest fooDigest = DIGEST_UTIL .computeAsUtf8 ("foo-contents" );
387
385
Digest barDigest = DIGEST_UTIL .computeAsUtf8 ("bar-contents" );
@@ -404,7 +402,7 @@ public void testDownloadAllResults() throws Exception {
404
402
public void testUploadDirectory () throws Exception {
405
403
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
406
404
GrpcCacheClient client = newClient (remoteOptions );
407
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
405
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
408
406
409
407
final Digest fooDigest =
410
408
fakeFileCache .createScratchInput (ActionInputHelper .fromPath ("a/foo" ), "xyz" );
@@ -468,7 +466,7 @@ public void updateActionResult(
468
466
public void testUploadDirectoryEmpty () throws Exception {
469
467
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
470
468
GrpcCacheClient client = newClient (remoteOptions );
471
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
469
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
472
470
473
471
final Digest barDigest =
474
472
fakeFileCache .createScratchInputDirectory (
@@ -507,7 +505,7 @@ public void updateActionResult(
507
505
public void testUploadDirectoryNested () throws Exception {
508
506
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
509
507
GrpcCacheClient client = newClient (remoteOptions );
510
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
508
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
511
509
512
510
final Digest wobbleDigest =
513
511
fakeFileCache .createScratchInput (ActionInputHelper .fromPath ("bar/test/wobble" ), "xyz" );
@@ -583,7 +581,7 @@ private ActionResult upload(
583
581
outputs ,
584
582
outErr ,
585
583
0 );
586
- return uploadManifest .upload (context , remoteCache );
584
+ return uploadManifest .upload (context , remoteCache , NullEventHandler . INSTANCE );
587
585
}
588
586
589
587
private ActionResult uploadDirectory (RemoteCache remoteCache , List <Path > outputs )
@@ -658,7 +656,7 @@ public void getActionResult(
658
656
serviceRegistry .addService (ServerInterceptors .intercept (actionCache , interceptor ));
659
657
660
658
GrpcCacheClient client = newClient (remoteOptions );
661
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
659
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
662
660
remoteCache .downloadActionResult (
663
661
context ,
664
662
DIGEST_UTIL .asActionKey (DIGEST_UTIL .computeAsUtf8 ("key" )),
@@ -669,7 +667,7 @@ public void getActionResult(
669
667
public void testUpload () throws Exception {
670
668
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
671
669
GrpcCacheClient client = newClient (remoteOptions );
672
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
670
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
673
671
674
672
final Digest fooDigest =
675
673
fakeFileCache .createScratchInput (ActionInputHelper .fromPath ("a/foo" ), "xyz" );
@@ -745,7 +743,7 @@ public void testUploadSplitMissingDigestsCall() throws Exception {
745
743
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
746
744
remoteOptions .maxOutboundMessageSize = 80 ; // Enough for one digest, but not two.
747
745
GrpcCacheClient client = newClient (remoteOptions );
748
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
746
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
749
747
750
748
final Digest fooDigest =
751
749
fakeFileCache .createScratchInput (ActionInputHelper .fromPath ("a/foo" ), "xyz" );
@@ -810,7 +808,7 @@ public void updateActionResult(
810
808
public void testUploadCacheMissesWithRetries () throws Exception {
811
809
RemoteOptions remoteOptions = Options .getDefaults (RemoteOptions .class );
812
810
GrpcCacheClient client = newClient (remoteOptions );
813
- RemoteCache remoteCache = new RemoteCache (reporter , client , remoteOptions , DIGEST_UTIL );
811
+ RemoteCache remoteCache = new RemoteCache (client , remoteOptions , DIGEST_UTIL );
814
812
815
813
final Digest fooDigest =
816
814
fakeFileCache .createScratchInput (ActionInputHelper .fromPath ("a/foo" ), "xyz" );
0 commit comments