flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl0u <...@git.apache.org>
Subject [GitHub] flink pull request #5691: [FLINK-8802] [QS] Fix concurrent access to non-dup...
Date Tue, 13 Mar 2018 14:15:16 GMT
Github user kl0u commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5691#discussion_r174145613
  
    --- Diff: flink-queryable-state/flink-queryable-state-runtime/src/main/java/org/apache/flink/queryablestate/server/KvStateServerHandler.java
---
    @@ -78,13 +75,22 @@ public KvStateServerHandler(
     		final CompletableFuture<KvStateResponse> responseFuture = new CompletableFuture<>();
     
     		try {
    -			final InternalKvState<?> kvState = registry.getKvState(request.getKvStateId());
    +			final KvStateEntry<?, ?, ?> kvState = registry.getKvState(request.getKvStateId());
     			if (kvState == null) {
     				responseFuture.completeExceptionally(new UnknownKvStateIdException(getServerName(),
request.getKvStateId()));
     			} else {
     				byte[] serializedKeyAndNamespace = request.getSerializedKeyAndNamespace();
     
    -				byte[] serializedResult = kvState.getSerializedValue(serializedKeyAndNamespace);
    +				// here we remove any type check...
    +				// Ideally we want to keep that the info match the state.
    +				final InternalKvState state = kvState.getState();
    +				final KvStateInfo info = kvState.getInfoForCurrentThread();
    +
    +				byte[] serializedResult = state.getSerializedValue(
    --- End diff --
    
    "Word on the street" :P is that `Kryo` duplication is pretty expensive. This is why I
went for this solution.


---

Mime
View raw message