flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aljoscha <...@git.apache.org>
Subject [GitHub] flink pull request #5230: [FLINK-8345] Add iterator of keyed state on broadc...
Date Thu, 25 Jan 2018 14:12:50 GMT
Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5230#discussion_r163849551
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/state/DefaultOperatorStateBackend.java
---
    @@ -601,21 +805,43 @@ public void addAll(List<S> values) throws Exception {
     		}
     	}
     
    +	private static <K, V> void deserializeBroadcastStateValues(
    +			final BackendWritableBroadcastState<K, V> broadcastStateForName,
    +			final FSDataInputStream in,
    +			final OperatorStateHandle.StateMetaInfo metaInfo) throws Exception {
    +
    +		if (metaInfo != null) {
    +			long[] offsets = metaInfo.getOffsets();
    +			if (offsets != null) {
    +				DataInputView div = new DataInputViewStreamWrapper(in);
    +
    +				TypeSerializer<K> keySerializer = broadcastStateForName.getStateMetaInfo().getKeySerializer();
    +				TypeSerializer<V> valueSerializer = broadcastStateForName.getStateMetaInfo().getValueSerializer();
    +
    +				for (long offset : offsets) {
    +					in.seek(offset);
    --- End diff --
    
    As mentioned in `BackendWritableBroadcastState`, we don't need the offsets, then we also
don't need to to all the seeking here.


---

Mime
View raw message