[ 
https://issues.apache.org/jira/browse/FLINK-7475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310737#comment-16310737
 ] 

ASF GitHub Bot commented on FLINK-7475:
---------------------------------------

Github user bowenli86 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4963#discussion_r159582753
  
    --- Diff: 
flink-contrib/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/benchmark/RocksDBListStatePerformanceTest.java
 ---
    @@ -0,0 +1,133 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.contrib.streaming.state.benchmark;
    +
    +import org.apache.flink.contrib.streaming.state.PredefinedOptions;
    +import org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend;
    +import org.apache.flink.contrib.streaming.state.util.MergeUtils;
    +import org.apache.flink.testutils.junit.RetryOnFailure;
    +import org.apache.flink.testutils.junit.RetryRule;
    +import org.apache.flink.util.TestLogger;
    +import org.junit.Rule;
    +import org.junit.Test;
    +import org.junit.rules.TemporaryFolder;
    +import org.rocksdb.CompactionStyle;
    +import org.rocksdb.NativeLibraryLoader;
    +import org.rocksdb.Options;
    +import org.rocksdb.RocksDB;
    +import org.rocksdb.WriteOptions;
    +
    +import java.io.File;
    +import java.nio.charset.StandardCharsets;
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +/**
    + * Test that validates that the performance of APIs of RocksDB's ListState 
is as expected.
    + *
    + * Benchmarking
    + * Computer: MacbookPro (Mid 2015), Flash Storage, Processor 2.5GHz Intel 
Core i7, Memory 16GB 1600MHz DDR3
    + *
    + * Number of values added | time for add()   |  time for update() | perf 
improvement of update() over add()
    + * 500                                             978703 ns               
        55397 ns                        17.66x
    + * 1000                                            3044179 ns              
        89474 ns                        34.02x
    --- End diff --
    
    I'm not sure why the formatting is a few spaces behind others on github. 
They are aligned on my computer


> support update() in ListState
> -----------------------------
>
>                 Key: FLINK-7475
>                 URL: https://issues.apache.org/jira/browse/FLINK-7475
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core, DataStream API, State Backends, Checkpointing
>    Affects Versions: 1.4.0
>            Reporter: yf
>            Assignee: Bowen Li
>             Fix For: 1.5.0
>
>
> If I want to update the list. 
> I have to do two steps: 
> listState.clear() 
> for (Element e : myList) { 
>     listState.add(e); 
> } 
> Why not I update the state by: 
> listState.update(myList) ?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to