2525import org .apache .doris .thrift .TStatusCode ;
2626import org .apache .doris .thrift .TUniqueId ;
2727
28+ import com .google .common .collect .ImmutableList ;
2829import com .google .common .util .concurrent .Futures ;
2930import org .junit .Assert ;
3031import org .junit .Test ;
3132import org .mockito .MockedStatic ;
3233import org .mockito .Mockito ;
3334
34- import java .util .List ;
3535import java .util .concurrent .TimeUnit ;
3636import java .util .concurrent .atomic .AtomicLong ;
3737
@@ -50,8 +50,9 @@ private static PCancelPlanFragmentResult response(TStatusCode status) {
5050 @ Test
5151 public void cancelReachesAllBackendsWithoutLiveCoordinatorOrResultFragment () throws Exception {
5252 FlightSqlQueryCancellation routes = new FlightSqlQueryCancellation (() -> 0L );
53+ // Use Guava collection factories because FE tests compile against the Java 8 API.
5354 // The selected endpoint and its coordinator have finished; only routing metadata survives.
54- routes .register (QUERY , List .of (FIRST , SECOND ), List .of (FINISHED_BE , ACTIVE_BE ), 120 );
55+ routes .register (QUERY , ImmutableList .of (FIRST , SECOND ), ImmutableList .of (FINISHED_BE , ACTIVE_BE ), 120 );
5556 BackendServiceProxy proxy = Mockito .mock (BackendServiceProxy .class );
5657 Mockito .when (proxy .cancelPipelineXPlanFragmentAsync (Mockito .any (), Mockito .eq (QUERY ), Mockito .any ()))
5758 .thenReturn (Futures .immediateFuture (response (TStatusCode .OK )));
@@ -69,7 +70,7 @@ public void cancelReachesAllBackendsWithoutLiveCoordinatorOrResultFragment() thr
6970 @ Test
7071 public void applicationErrorKeepsRouteForRetry () throws Exception {
7172 FlightSqlQueryCancellation routes = new FlightSqlQueryCancellation (() -> 0L );
72- routes .register (QUERY , List .of (FIRST ), List .of (ACTIVE_BE ), 120 );
73+ routes .register (QUERY , ImmutableList .of (FIRST ), ImmutableList .of (ACTIVE_BE ), 120 );
7374 BackendServiceProxy proxy = Mockito .mock (BackendServiceProxy .class );
7475 Mockito .when (proxy .cancelPipelineXPlanFragmentAsync (Mockito .any (), Mockito .eq (QUERY ), Mockito .any ()))
7576 .thenReturn (Futures .immediateFuture (response (TStatusCode .CANCELLED )),
@@ -85,7 +86,7 @@ public void applicationErrorKeepsRouteForRetry() throws Exception {
8586 public void routesExpireAfterExecutionTimeout () {
8687 AtomicLong clock = new AtomicLong ();
8788 FlightSqlQueryCancellation routes = new FlightSqlQueryCancellation (clock ::get );
88- routes .register (QUERY , List .of (FIRST , SECOND ), List .of (ACTIVE_BE ), 120 );
89+ routes .register (QUERY , ImmutableList .of (FIRST , SECOND ), ImmutableList .of (ACTIVE_BE ), 120 );
8990 clock .set (TimeUnit .SECONDS .toNanos (126 ));
9091 Assert .assertEquals (TStatusCode .NOT_FOUND , routes .cancel (FIRST ).getStatusCode ());
9192 Assert .assertEquals (TStatusCode .NOT_FOUND , routes .cancel (SECOND ).getStatusCode ());
@@ -95,7 +96,7 @@ public void routesExpireAfterExecutionTimeout() {
9596 public void channelCleanupRemovesItsRoutes () {
9697 FlightSqlChannel channel = new FlightSqlChannel ();
9798 try {
98- channel .registerRemoteQuery (QUERY , List .of (FIRST , SECOND ), List .of (ACTIVE_BE ), 120 );
99+ channel .registerRemoteQuery (QUERY , ImmutableList .of (FIRST , SECOND ), ImmutableList .of (ACTIVE_BE ), 120 );
99100 channel .reset ();
100101 Assert .assertEquals (TStatusCode .NOT_FOUND ,
101102 FlightSqlQueryCancellation .INSTANCE .cancel (FIRST ).getStatusCode ());
0 commit comments