|
28 | 28 | import org.apache.flink.runtime.metrics.MetricNames;
|
29 | 29 | import org.apache.flink.runtime.rpc.RpcService;
|
30 | 30 | import org.apache.flink.runtime.rpc.RpcSystem;
|
31 |
| -import org.apache.flink.runtime.rpc.akka.AkkaRpcService; |
32 | 31 | import org.apache.flink.runtime.taskexecutor.TaskManagerServices;
|
33 | 32 | import org.apache.flink.runtime.taskexecutor.TaskManagerServicesBuilder;
|
34 | 33 | import org.apache.flink.runtime.taskexecutor.slot.TestingTaskSlotTable;
|
|
40 | 39 |
|
41 | 40 | import org.apache.flink.shaded.guava18.com.google.common.collect.Sets;
|
42 | 41 |
|
43 |
| -import akka.actor.ActorSystem; |
44 | 42 | import org.junit.After;
|
45 | 43 | import org.junit.Assert;
|
46 | 44 | import org.junit.Assume;
|
|
54 | 52 | import static org.apache.flink.runtime.metrics.util.MetricUtils.METRIC_GROUP_FLINK;
|
55 | 53 | import static org.apache.flink.runtime.metrics.util.MetricUtils.METRIC_GROUP_MANAGED_MEMORY;
|
56 | 54 | import static org.apache.flink.runtime.metrics.util.MetricUtils.METRIC_GROUP_MEMORY;
|
57 |
| -import static org.hamcrest.CoreMatchers.instanceOf; |
58 | 55 | import static org.hamcrest.Matchers.is;
|
59 | 56 | import static org.junit.Assert.assertThat;
|
60 | 57 |
|
@@ -83,17 +80,10 @@ public void testStartMetricActorSystemRespectsThreadPriority() throws Exception
|
83 | 80 | final RpcService rpcService =
|
84 | 81 | MetricUtils.startRemoteMetricsRpcService(
|
85 | 82 | configuration, "localhost", RpcSystem.load());
|
86 |
| - assertThat(rpcService, instanceOf(AkkaRpcService.class)); |
87 |
| - |
88 |
| - final ActorSystem actorSystem = ((AkkaRpcService) rpcService).getActorSystem(); |
89 | 83 |
|
90 | 84 | try {
|
91 | 85 | final int threadPriority =
|
92 |
| - actorSystem |
93 |
| - .settings() |
94 |
| - .config() |
95 |
| - .getInt("akka.actor.default-dispatcher.thread-priority"); |
96 |
| - |
| 86 | + rpcService.execute(() -> Thread.currentThread().getPriority()).get(); |
97 | 87 | assertThat(threadPriority, is(expectedThreadPriority));
|
98 | 88 | } finally {
|
99 | 89 | rpcService.stopService().get();
|
|
0 commit comments