@@ -125,7 +125,6 @@ protected RewriteRpc(JsonRpc jsonRpc, Environment marketplace, Duration timeout)
125
125
Map <String , Recipe > preparedRecipes = new HashMap <>();
126
126
Map <Recipe , Cursor > recipeCursors = new IdentityHashMap <>();
127
127
128
- jsonRpc .rpc ("GetRef" , new GetRef .Handler (remoteRefs , localRefs , batchSize , traceSendPackets ));
129
128
jsonRpc .rpc ("Visit" , new Visit .Handler (localObjects , preparedRecipes , recipeCursors ,
130
129
this ::getObject , this ::getCursor ));
131
130
jsonRpc .rpc ("Generate" , new Generate .Handler (localObjects , preparedRecipes , recipeCursors ,
@@ -280,11 +279,7 @@ public boolean tryAdvance(Consumer<? super SourceFile> action) {
280
279
if (ids == null ) {
281
280
// FIXME handle `TimeoutException` gracefully
282
281
ids = send ("Parse" , new Parse (mappedInputs , relativeTo != null ? relativeTo .toString () : null ), ParseResponse .class );
283
-
284
- // If batch is empty, we're done
285
- if (ids .isEmpty ()) {
286
- return false ;
287
- }
282
+ assert ids .size () == inputList .size ();
288
283
}
289
284
290
285
// Process current item in batch
@@ -364,7 +359,7 @@ public <T> T getObject(String id) {
364
359
String lastKnownId = localObject != null ? id : null ;
365
360
366
361
RpcReceiveQueue q = new RpcReceiveQueue (remoteRefs , traceFile , () -> send ("GetObject" ,
367
- new GetObject (id , lastKnownId ), GetObjectResponse .class ), this :: getRef );
362
+ new GetObject (id , lastKnownId ), GetObjectResponse .class ));
368
363
Object remoteObject = q .receive (localObject , null );
369
364
if (q .take ().getState () != END_OF_OBJECT ) {
370
365
throw new IllegalStateException ("Expected END_OF_OBJECT" );
@@ -377,27 +372,6 @@ public <T> T getObject(String id) {
377
372
return (T ) remoteObject ;
378
373
}
379
374
380
- private Object getRef (Integer refId ) {
381
- RpcReceiveQueue q = new RpcReceiveQueue (remoteRefs , traceFile , () -> send ("GetRef" ,
382
- new GetRef (refId ), GetRefResponse .class ), nestedRefId -> {
383
- throw new IllegalStateException ("Nested ref calls not supported in GetRef: " + nestedRefId );
384
- });
385
-
386
- Object ref = q .receive (null , null );
387
- if (q .take ().getState () != END_OF_OBJECT ) {
388
- throw new IllegalStateException ("Expected END_OF_OBJECT" );
389
- }
390
-
391
- if (ref == null ) {
392
- throw new IllegalStateException ("Reference " + refId + " not found on remote" );
393
- }
394
-
395
- remoteRefs .put (refId , ref );
396
- localRefs .put (ref , refId );
397
-
398
- return ref ;
399
- }
400
-
401
375
protected <P > P send (String method , @ Nullable RpcRequest body , Class <P > responseType ) {
402
376
try {
403
377
// TODO handle error
0 commit comments