[ 
https://issues.apache.org/jira/browse/FLINK-14997?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephan Ewen resolved FLINK-14997.
----------------------------------
    Resolution: Fixed

Fixed in 1.10 via e041d51fc9ca6f2f97ce006622338b7518941a65

> Avoid to call unnecessary delete within RocksDBState's mergeNamespaces 
> implementation
> -------------------------------------------------------------------------------------
>
>                 Key: FLINK-14997
>                 URL: https://issues.apache.org/jira/browse/FLINK-14997
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / State Backends
>            Reporter: Yun Tang
>            Assignee: Yun Tang
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> After FLINK-7700, we delete old state when merging namespaces of RocksDB 
> state. However, this change still leaves some performance space to improve:
> {code:java}
> byte[] valueBytes = backend.db.get(columnFamily, sourceKey);
> backend.db.delete(columnFamily, writeOptions, sourceKey);
> if (valueBytes != null) {
>    backend.db.merge(columnFamily, writeOptions, targetKey, valueBytes);
> }
> {code}
> As you can see, we would call delete instantly after we get the 
> {{valueBytes}}. However, since we did not allow {{null}} in list state value 
> and the delete operation could be removed to the statement block which has 
> verified the {{valueBytes}} is not null. By doing this, we could avoid 
> unnecessary {{delete}} calls if {{sourceKey}} not existed actually.



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

Reply via email to