Rion Williams
09/02/2023, 2:05 PMcom.someproject.widget.WidgetClass and I now have a need to share this class in another Flink job so I attempted to migrate it to a separate “common” project. Now the namespacing changed, the class uses com.common.widget.WidgetClass .
When attempting to upgrade the job, I noticed continual failures as the job attempted to restore state using the previous, now non-existant, class:
Caused by: org.apache.flink.runtime.state.BackendBuildingException: Failed when trying to restore operator state backend
at org.apache.flink.runtime.state.DefaultOperatorStateBackendBuilder.build(DefaultOperatorStateBackendBuilder.java:83)
at org.apache.flink.contrib.streaming.state.EmbeddedRocksDBStateBackend.createOperatorStateBackend(EmbeddedRocksDBStateBackend.java:503)
at org.apache.flink.streaming.api.operators.StreamTaskStateInitializerImpl.lambda$operatorStateBackend$0(StreamTaskStateInitializerImpl.java:277)
at org.apache.flink.streaming.api.operators.BackendRestorerProcedure.attemptCreateAndRestore(BackendRestorerProcedure.java:168)
at org.apache.flink.streaming.api.operators.BackendRestorerProcedure.createAndRestore(BackendRestorerProcedure.java:135)
... 13 more
Caused by: java.io.IOException: Could not find class 'com.someproject.widget.WidgetClass' in classpath.
at org.apache.flink.util.InstantiationUtil.resolveClassByName(InstantiationUtil.java:775)
at org.apache.flink.util.InstantiationUtil.resolveClassByName(InstantiationUtil.java:750)
Any recommendations would be welcome as I have to imagine this can occasionally happen. I’m guessing since this is technically a breaking schema change per the Flink docs (i.e. namespace cannot change), I’d likely need to perform some process to either rebootstrap the state, but maybe there’s a alternate way to handle it.Joe Karayusuf
09/05/2023, 1:52 PMWidgetClass to the new common package. Then, create a subclass of it in the existing project.
package com.someproject.widget.WidgetClass
class WidgetClass extends com.common.widget.WidgetClass {}Pedro Mázala
09/05/2023, 3:12 PMBarisa Obradovic
09/06/2023, 12:47 PMRion Williams
09/06/2023, 1:16 PM