[
https://issues.apache.org/jira/browse/BEAM-6876?focusedWorklogId=218975&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-218975
]
ASF GitHub Bot logged work on BEAM-6876:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Mar/19 22:20
Start Date: 26/Mar/19 22:20
Worklog Time Spent: 10m
Work Description: tweise commented on pull request #8118: [BEAM-6876]
Cleanup user state in portable Flink Runner
URL: https://github.com/apache/beam/pull/8118#discussion_r269338568
##########
File path:
runners/flink/src/test/java/org/apache/beam/runners/flink/streaming/ExecutableStageDoFnOperatorTest.java
##########
@@ -340,6 +346,38 @@ public void testStageBundleClosed() throws Exception {
verifyNoMoreInteractions(bundle);
}
+ @Test
+ public void testEnsureStateCleanupWithKeyedInput() throws Exception {
+ TupleTag<Integer> mainOutput = new TupleTag<>("main-output");
+ DoFnOperator.MultiOutputOutputManagerFactory<Integer> outputManagerFactory
=
+ new DoFnOperator.MultiOutputOutputManagerFactory(mainOutput,
VoidCoder.of());
+ VarIntCoder keyCoder = VarIntCoder.of();
+ ExecutableStageDoFnOperator<Integer, Integer> operator =
+ getOperator(mainOutput, Collections.emptyList(), outputManagerFactory,
keyCoder);
+
+ KeyedOneInputStreamOperatorTestHarness<Integer, WindowedValue<Integer>,
WindowedValue<Integer>>
+ testHarness =
+ new KeyedOneInputStreamOperatorTestHarness(
+ operator, val -> val, new CoderTypeInformation<>(keyCoder));
+
+ RemoteBundle bundle = Mockito.mock(RemoteBundle.class);
+ when(bundle.getInputReceivers())
+ .thenReturn(
+ ImmutableMap.<String, FnDataReceiver<WindowedValue>>builder()
+ .put("input", Mockito.mock(FnDataReceiver.class))
+ .build());
+ when(stageBundleFactory.getBundle(any(), any(), any())).thenReturn(bundle);
+
+ testHarness.open();
+
+ Object doFnRunner = Whitebox.getInternalState(operator, "doFnRunner");
+ assertThat(doFnRunner, instanceOf(DoFnRunnerWithMetricsUpdate.class));
+
+ // There should be a StatefulDoFnRunner installed which takes care of
clearing state
+ Object statefulDoFnRunner = Whitebox.getInternalState(doFnRunner,
"delegate");
+ assertThat(statefulDoFnRunner, instanceOf(StatefulDoFnRunner.class));
Review comment:
This is pretty good, though we have no coverage for the cleanup itself.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 218975)
Time Spent: 1.5h (was: 1h 20m)
> User state cleanup in portable Flink runner
> -------------------------------------------
>
> Key: BEAM-6876
> URL: https://issues.apache.org/jira/browse/BEAM-6876
> Project: Beam
> Issue Type: Bug
> Components: runner-flink
> Affects Versions: 2.11.0
> Reporter: Thomas Weise
> Assignee: Maximilian Michels
> Priority: Major
> Labels: portability-flink
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> State is currently not being cleaned up by the runner.
> [https://lists.apache.org/thread.html/86f0809fbfa3da873051287b9ff249d6dd5a896b45409db1e484cf38@%3Cdev.beam.apache.org%3E]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)