Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-11167

Optimize RocksDBList#put for no empty input

    XMLWordPrintableJSON

Details

    Description

      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 skip the remove operation.

       

      public void updateInternal(List<V> 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);
            }
         }
      }
      

      Attachments

        Issue Links

          Activity

            People

              klion26 Congxian Qiu
              klion26 Congxian Qiu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h