GitHub user bowenli86 opened a pull request: https://github.com/apache/flink/pull/5323
[FLINK-8441] [State Backend] [RocksDB] change RocksDBListState to serialize values and separators in stream to avoid extra bytes copying ## What is the purpose of the change Currently, `RocksDBListState#update()` and `addAll()` will both serialize values into a list of bytes, manually merge the list of bytes with separators to an array of bytes, and then write to RocksDB. It results in extra step of copying bytes back and forth. ## Brief change log Changed `RocksDBListState#update()` and `addAll()` to serialize values and separators directly into `keySerializationStream`, which avoids extra copying. ## Verifying this change This change is already covered by existing tests, such as `RocksDBStateBackendTest` ## Does this pull request potentially affect one of the following parts: none ## Documentation none cc @StefanRRichter You can merge this pull request into a Git repository by running: $ git pull https://github.com/bowenli86/flink FLINK-8441 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/5323.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #5323 ---- commit ca1636c40276c6cb826eb8b0cd221f3d2d440315 Author: Bowen Li <bowenli86@...> Date: 2018-01-02T19:21:28Z update local branch commit e0cc43f051c76202416a72545dbf0cc024f718bc Author: Bowen Li <bowenli86@...> Date: 2018-01-04T01:35:11Z remove sh commit e5fcd4d844ac904cad9f25d3337554128b085363 Author: Bowen Li <bowenli86@...> Date: 2018-01-20T06:19:06Z [FLINK-8441] change RocksDBListState to serialize values and separators in stream to avoid extra bytes copying ---- ---