Search in sources :

Example 1 with MainThreadValidatorUtil

use of org.apache.flink.runtime.rpc.MainThreadValidatorUtil in project flink by apache.

the class SlotPoolTest method setUp.

@Before
public void setUp() throws Exception {
    this.rpcService = new TestingSerialRpcService();
    this.jobId = new JobID();
    this.slotPool = new SlotPool(rpcService, jobId);
    this.mainThreadValidatorUtil = new MainThreadValidatorUtil(slotPool);
    mainThreadValidatorUtil.enterMainThread();
    slotPool.start(UUID.randomUUID());
    this.resourceManagerGateway = mock(ResourceManagerGateway.class);
    when(resourceManagerGateway.requestSlot(any(UUID.class), any(UUID.class), any(SlotRequest.class), any(Time.class))).thenReturn(mock(Future.class));
    slotPool.connectToResourceManager(UUID.randomUUID(), resourceManagerGateway);
}
Also used : TestingSerialRpcService(org.apache.flink.runtime.rpc.TestingSerialRpcService) MainThreadValidatorUtil(org.apache.flink.runtime.rpc.MainThreadValidatorUtil) Future(org.apache.flink.runtime.concurrent.Future) Time(org.apache.flink.api.common.time.Time) UUID(java.util.UUID) SlotRequest(org.apache.flink.runtime.resourcemanager.SlotRequest) JobID(org.apache.flink.api.common.JobID) ResourceManagerGateway(org.apache.flink.runtime.resourcemanager.ResourceManagerGateway) Before(org.junit.Before)

Aggregations

UUID (java.util.UUID)1 JobID (org.apache.flink.api.common.JobID)1 Time (org.apache.flink.api.common.time.Time)1 Future (org.apache.flink.runtime.concurrent.Future)1 ResourceManagerGateway (org.apache.flink.runtime.resourcemanager.ResourceManagerGateway)1 SlotRequest (org.apache.flink.runtime.resourcemanager.SlotRequest)1 MainThreadValidatorUtil (org.apache.flink.runtime.rpc.MainThreadValidatorUtil)1 TestingSerialRpcService (org.apache.flink.runtime.rpc.TestingSerialRpcService)1 Before (org.junit.Before)1