flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bowenli86 <...@git.apache.org>
Subject [GitHub] flink pull request #4722: [FLINK-7683] Iterate over keys in KeyedStateBacken...
Date Mon, 25 Sep 2017 21:43:48 GMT
Github user bowenli86 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4722#discussion_r140907101
  
    --- Diff: flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java
---
    @@ -252,6 +257,43 @@ public RocksDBKeyedStateBackend(
     		LOG.debug("Setting initial keyed backend uid for operator {} to {}.", this.operatorIdentifier,
this.backendUID);
     	}
     
    +	@Override
    +	public <N> Stream<K> getKeys(String field, N namespace) {
    +		Tuple2<ColumnFamilyHandle, ?> columnInfo = kvStateInformation.get(field);
    +		if (columnInfo == null) {
    +			return Stream.empty();
    +		}
    +
    +		RocksIterator iterator = db.newIterator(columnInfo.f0);
    +		iterator.seekToFirst();
    +
    +		Iterator<K> sourceIterator = new Iterator<K>() {
    --- End diff --
    
    I believe it's better to move impl of this iterator to a standalone or inner class


---

Mime
View raw message