[jira] [Created] (FLINK-14833) Remove unnecessary SnapshotStrategySynchronicityBehavior from HeapSnapshotStrategy

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-14833) Remove unnecessary SnapshotStrategySynchronicityBehavior from HeapSnapshotStrategy

Shang Yuanchun (Jira)
Jiayi Liao created FLINK-14833:
----------------------------------

             Summary: Remove unnecessary SnapshotStrategySynchronicityBehavior from HeapSnapshotStrategy
                 Key: FLINK-14833
                 URL: https://issues.apache.org/jira/browse/FLINK-14833
             Project: Flink
          Issue Type: Improvement
    Affects Versions: 1.9.1
            Reporter: Jiayi Liao


Since all methods implementing from {{SnapshotStrategySynchronicityBehavior}} in {{HeapSnapshotStrategy}} are executing as the same pattern below: 
{code:java}
@Override
public void finalizeSnapshotBeforeReturnHook(Runnable runnable) {
   snapshotStrategySynchronicityTrait.finalizeSnapshotBeforeReturnHook(runnable);
}

@Override
public boolean isAsynchronous() {
   return snapshotStrategySynchronicityTrait.isAsynchronous();
}

@Override
public <N, V> StateTable<K, N, V> newStateTable(
   InternalKeyContext<K> keyContext,
   RegisteredKeyValueStateBackendMetaInfo<N, V> newMetaInfo,
   TypeSerializer<K> keySerializer) {
   return snapshotStrategySynchronicityTrait.newStateTable(keyContext, newMetaInfo, keySerializer);
}
{code}

It looks like {{SnapshotStrategySynchronicityBehavior}} is not necessary for {{HeapSnapshotStrategy}} and we can just remove it and the related {{@Override}} annotations. And {{HeapSnapshotStrategy}} doesn't match the java docs in {{SnapshotStrategySynchronicityBehavior}} also.


 cc [~liyu]

And please correct me if there is a reason here.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)