Yun Tang created FLINK-11874:
--------------------------------
Summary: [checkpoint] Split CheckpointStorage interface to distinguish JM and TM side
Key: FLINK-11874
URL:
https://issues.apache.org/jira/browse/FLINK-11874 Project: Flink
Issue Type: Improvement
Components: Runtime / Checkpointing
Reporter: Yun Tang
Assignee: Yun Tang
Fix For: 1.9.0
Currently, interface {{CheckpointStorage}} mixed JM and TM side, which would be confusing for users and developers to distinguish them.
Take [FLINK-11696|
https://issues.apache.org/jira/browse/FLINK-11696] as an example, the directories should only be created once from JM side. However, since we mixed the JM and TM side, TMs would also create directories again.
We could let interface {{CheckpointStorage}} only has two methods:
{code:java}
CheckpointStreamFactory resolveCheckpointStorageLocation(
long checkpointId,
CheckpointStorageLocationReference reference)
CheckpointStateOutputStream createTaskOwnedStateStream()
{code}
And a new interface {{ChekcpointCoordinatorStorgae}} could be introduced extending {{CheckpointStorage}} and have methods below:
{code:java}
boolean supportsHighlyAvailableStorage()
boolean hasDefaultSavepointLocation()
CompletedCheckpointStorageLocation resolveCheckpoint(String externalPointer)
CheckpointStorageLocation initializeLocationForCheckpoint(long checkpointId)
CheckpointStorageLocation initializeLocationForSavepoint(
long checkpointId,
@Nullable String externalLocationPointer)
{code}
With this refactor, JM would only use cast {{ChekcpointCoordinatorStorgae}} so that we could shield TMs from accidentally calling unexpected methods.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)