Virender Bhargav
03/21/2023, 4:34 PMExistingSavepoint savepoint = Savepoint.load(bEnv, savepointPath, new EmbeddedRocksDBStateBackend());
DataSet<KeyedState> keyedState = savepoint.readKeyedState(""uid1"", new CoreProcessStateReaderFunction());
BootstrapTransformation<KeyedState> transformation = OperatorTransformation
.bootstrapWith(keyedState)
.keyBy(state -> state.id )
.transform(new StateBootstrapper());
Savepoint.load(bEnv, savepointPath, new EmbeddedRocksDBStateBackend())
.withOperator("uid1", transformation)
.removeOperator("uid1")
.write(newSavePointPath);
The intent is to perform a "transformation" on KeyedState and replace older operate state with modified one.
• CoreProcessStateReaderFunction : KeyedStateReaderFunction to read existing savepoint
• StateBootstrapper : KeyedStateBootstrapFunction for state modification/cleanup
I end up with an empty new savepoint(it has only _metadata folder and nothing else). Can someone help me with what I might be doing wrong?David Artiga
03/22/2023, 7:58 AM.withOperator("uid1", transformation)
.removeOperator("uid1")
shouldn't that be the other way around? like
.removeOperator("uid1")
.withOperator("uid1", transformation)
otherwise you might be removing the newly added transformation from the underlying Map 🤔