Hey, I am trying to use State Processor API to cle...
# troubleshooting
v
Hey, I am trying to use State Processor API to cleanup an existing savepoint.
Copy code
ExistingSavepoint 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?
d
Copy code
.withOperator("uid1", transformation)
.removeOperator("uid1")
shouldn't that be the other way around? like
Copy code
.removeOperator("uid1")
.withOperator("uid1", transformation)
otherwise you might be removing the newly added transformation from the underlying
Map
🤔