Search in sources :

Example 1 with PrioritizedOperatorSubtaskStateInputSplit

use of org.apache.flink.state.api.input.splits.PrioritizedOperatorSubtaskStateInputSplit in project flink by apache.

the class StreamOperatorContextBuilderTest method testStateBackendLoading.

@Test(expected = CustomStateBackendFactory.ExpectedException.class)
public void testStateBackendLoading() throws Exception {
    Configuration configuration = new Configuration();
    configuration.set(StateBackendOptions.STATE_BACKEND, CustomStateBackendFactory.class.getCanonicalName());
    StreamOperatorContextBuilder builder = new StreamOperatorContextBuilder(new MockStreamingRuntimeContext(true, 1, 0), configuration, new OperatorState(new OperatorID(), 1, 128), new PrioritizedOperatorSubtaskStateInputSplit() {

        @Override
        public PrioritizedOperatorSubtaskState getPrioritizedOperatorSubtaskState() {
            return PrioritizedOperatorSubtaskState.emptyNotRestored();
        }

        @Override
        public int getSplitNumber() {
            return 0;
        }
    }, new CloseableRegistry(), null);
    builder.build(LOG);
}
Also used : MockStreamingRuntimeContext(org.apache.flink.streaming.util.MockStreamingRuntimeContext) Configuration(org.apache.flink.configuration.Configuration) PrioritizedOperatorSubtaskState(org.apache.flink.runtime.checkpoint.PrioritizedOperatorSubtaskState) CustomStateBackendFactory(org.apache.flink.state.api.utils.CustomStateBackendFactory) PrioritizedOperatorSubtaskStateInputSplit(org.apache.flink.state.api.input.splits.PrioritizedOperatorSubtaskStateInputSplit) OperatorID(org.apache.flink.runtime.jobgraph.OperatorID) CloseableRegistry(org.apache.flink.core.fs.CloseableRegistry) OperatorState(org.apache.flink.runtime.checkpoint.OperatorState) Test(org.junit.Test)

Aggregations

Configuration (org.apache.flink.configuration.Configuration)1 CloseableRegistry (org.apache.flink.core.fs.CloseableRegistry)1 OperatorState (org.apache.flink.runtime.checkpoint.OperatorState)1 PrioritizedOperatorSubtaskState (org.apache.flink.runtime.checkpoint.PrioritizedOperatorSubtaskState)1 OperatorID (org.apache.flink.runtime.jobgraph.OperatorID)1 PrioritizedOperatorSubtaskStateInputSplit (org.apache.flink.state.api.input.splits.PrioritizedOperatorSubtaskStateInputSplit)1 CustomStateBackendFactory (org.apache.flink.state.api.utils.CustomStateBackendFactory)1 MockStreamingRuntimeContext (org.apache.flink.streaming.util.MockStreamingRuntimeContext)1 Test (org.junit.Test)1