masteryhx commented on code in PR #19142: URL: https://github.com/apache/flink/pull/19142#discussion_r853009395
########## flink-dstl/flink-dstl-dfs/src/main/java/org/apache/flink/changelog/fs/FsStateChangelogStorageForRecovery.java: ########## @@ -0,0 +1,33 @@ +package org.apache.flink.changelog.fs; + +import org.apache.flink.annotation.Experimental; +import org.apache.flink.api.common.operators.MailboxExecutor; +import org.apache.flink.runtime.state.KeyGroupRange; +import org.apache.flink.runtime.state.changelog.ChangelogStateHandleStreamImpl; +import org.apache.flink.runtime.state.changelog.StateChangelogHandleReader; +import org.apache.flink.runtime.state.changelog.StateChangelogHandleStreamHandleReader; +import org.apache.flink.runtime.state.changelog.StateChangelogStorage; +import org.apache.flink.runtime.state.changelog.StateChangelogWriter; + +import javax.annotation.concurrent.ThreadSafe; + +/** Filesystem-based implementation of {@link StateChangelogStorage} just for recovery. */ +@Experimental +@ThreadSafe +public class FsStateChangelogStorageForRecovery + implements StateChangelogStorage<ChangelogStateHandleStreamImpl> { + + @Override + public StateChangelogWriter<ChangelogStateHandleStreamImpl> createWriter( + String operatorID, KeyGroupRange keyGroupRange, MailboxExecutor mailboxExecutor) { + // The StateChangelogWriter will not be used when recovery + // under current design of Filesystem-based State Changelog Storage + throw new UnsupportedOperationException( + "createWriter is not supported for recovery from Changelog"); + } + + @Override + public StateChangelogHandleReader<ChangelogStateHandleStreamImpl> createReader() { + return new StateChangelogHandleStreamHandleReader(new StateChangeFormat()); + } +} Review Comment: Yeah, I agree. I just use StateChangelogStorageView to produce reader as you suggested. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org