[jira] [Updated] (FLINK-11167) Optimize RocksDBList#put for no empty input
[ https://issues.apache.org/jira/browse/FLINK-11167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ASF GitHub Bot updated FLINK-11167: --- Labels: pull-request-available (was: ) > Optimize RocksDBList#put for no empty input > --- > > Key: FLINK-11167 > URL: https://issues.apache.org/jira/browse/FLINK-11167 > Project: Flink > Issue Type: Improvement > Components: State Backends, Checkpointing >Reporter: Congxian Qiu >Assignee: Congxian Qiu >Priority: Major > Labels: pull-request-available > > In `RocksDBListState.putInternal` we will first remove the current state and > then add the new list if needed(list is no empty) such as below. > I think if the list is not empty, we could {color:#FF}skip the remove > operation{color}. > > {code:java} > public void updateInternal(List values) { >Preconditions.checkNotNull(values, "List of values to add cannot be > null."); >clear(); >if (!values.isEmpty()) { > try { > writeCurrentKeyWithGroupAndNamespace(); > byte[] key = dataOutputView.getCopyOfBuffer(); > byte[] premerge = getPreMergedValue(values, elementSerializer, > dataOutputView); > backend.db.put(columnFamily, writeOptions, key, premerge); > } catch (IOException | RocksDBException e) { > throw new FlinkRuntimeException("Error while updating data to > RocksDB", e); > } >} > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (FLINK-11167) Optimize RocksDBList#put for no empty input
[ https://issues.apache.org/jira/browse/FLINK-11167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Congxian Qiu updated FLINK-11167: - Component/s: State Backends, Checkpointing > Optimize RocksDBList#put for no empty input > --- > > Key: FLINK-11167 > URL: https://issues.apache.org/jira/browse/FLINK-11167 > Project: Flink > Issue Type: Improvement > Components: State Backends, Checkpointing >Reporter: Congxian Qiu >Assignee: Congxian Qiu >Priority: Major > > In `RocksDBListState.putInternal` we will first remove the current state and > then add the new list if needed(list is no empty) such as below. > I think if the list is not empty, we could {color:#FF}skip the remove > operation{color}. > > {code:java} > public void updateInternal(List values) { >Preconditions.checkNotNull(values, "List of values to add cannot be > null."); >clear(); >if (!values.isEmpty()) { > try { > writeCurrentKeyWithGroupAndNamespace(); > byte[] key = dataOutputView.getCopyOfBuffer(); > byte[] premerge = getPreMergedValue(values, elementSerializer, > dataOutputView); > backend.db.put(columnFamily, writeOptions, key, premerge); > } catch (IOException | RocksDBException e) { > throw new FlinkRuntimeException("Error while updating data to > RocksDB", e); > } >} > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)