Github user sihuazhou commented on a diff in the pull request:
https://github.com/apache/flink/pull/5979#discussion_r187278034
--- Diff:
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBMapState.java
---
@@ -356,6 +369,20 @@ private UV deserializeUserValue(byte[] rawValueBytes,
TypeSerializer<UV> valueSe
return isNull ? null : valueSerializer.deserialize(in);
}
+ private boolean startWithKeyPrefix(byte[] keyPrefixBytes, byte[]
rawKeyBytes) {
+ if (rawKeyBytes.length < keyPrefixBytes.length) {
+ return false;
+ }
+
+ for (int i = keyPrefixBytes.length; --i >=
backend.getKeyGroupPrefixBytes(); ) {
--- End diff --
Ah, this is a function that simply polled out from the
`RocksDBMapState#RocksDBMapIterator`, in`RocksDBMapState#RocksDBMapIterator`
it's name was `underSameKey()` , I didn't change any code related to it's
implementation.
But concern this loop, yes, I was the person that written this loop for
this method(`underSameKey()`), and your suggestion was the first version that I
implemented it, but during the reviewing by @StefanRRichter , he suggest that
the current style, and I feel that looks more simpler, so I made it into the
current shape finally, personally I would't against the current version.Ah,
this is a function that simply polled out from the
`RocksDBMapState#RocksDBMapIterator`, in`RocksDBMapState#RocksDBMapIterator`
it's name was `underSameKey()` , I didn't change any code related to it's
implementation.
But concern this loop, yes, I was the person that written this loop for
this method(`underSameKey()`), and your suggestion was the first version that I
implemented it, but during the reviewing by @StefanRRichter , he suggest that
the current style, and I feel that looks more simpler, so I made it into the
current shape finally, personally I would't against the current version.
---