flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sihuazhou <...@git.apache.org>
Subject [GitHub] flink pull request #5239: [FLINK-8360] Implement task-local state recovery
Date Fri, 16 Feb 2018 14:56:17 GMT
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5239#discussion_r168777737
  
    --- Diff: flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java
---
    @@ -266,11 +305,16 @@ public RocksDBKeyedStateBackend(
     		RocksIterator iterator = db.newIterator(columnInfo.f0);
     		iterator.seekToFirst();
     
    -		Iterable<K> iterable = () -> new RocksIteratorWrapper<>(iterator, state,
keySerializer, keyGroupPrefixBytes);
    +		Iterable<K> iterable = () -> new RocksIteratorToJavaIteratorAdapter<>(iterator,
state, keySerializer, keyGroupPrefixBytes);
     		Stream<K> targetStream = StreamSupport.stream(iterable.spliterator(), false);
    --- End diff --
    
    Checked. In `HeapKeyedStateBackend` the implementation is 
    ```
    	@Override
    	public <N> Stream<K> getKeys(String state, N namespace) {
    		if (!stateTables.containsKey(state)) {
    			return Stream.empty();
    		}
    		StateTable<K, N, ?> table = (StateTable<K, N, ?>) stateTables.get(state);
    		return table.getKeys(namespace);
    	}
    ```
    So I think `namespace` is useful ...


---

Mime
View raw message