Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E61A0200C41 for ; Fri, 24 Mar 2017 11:14:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E4BDF160B96; Fri, 24 Mar 2017 10:14:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3C97A160B82 for ; Fri, 24 Mar 2017 11:14:46 +0100 (CET) Received: (qmail 45118 invoked by uid 500); 24 Mar 2017 10:14:45 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 45109 invoked by uid 99); 24 Mar 2017 10:14:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Mar 2017 10:14:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E6231181069 for ; Fri, 24 Mar 2017 10:14:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 44wwxAq0pqrN for ; Fri, 24 Mar 2017 10:14:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id ACCED5FBA1 for ; Fri, 24 Mar 2017 10:14:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 15C49E05BE for ; Fri, 24 Mar 2017 10:14:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8AD2324062 for ; Fri, 24 Mar 2017 10:14:41 +0000 (UTC) Date: Fri, 24 Mar 2017 10:14:41 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-6034) Add KeyedStateHandle for the snapshots in keyed streams MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 24 Mar 2017 10:14:47 -0000 [ https://issues.apache.org/jira/browse/FLINK-6034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15940108#comment-15940108 ] ASF GitHub Bot commented on FLINK-6034: --------------------------------------- Github user StefanRRichter commented on a diff in the pull request: https://github.com/apache/flink/pull/3531#discussion_r107870871 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java --- @@ -290,19 +291,19 @@ private static void assignTaskStatesToOperatorInstances( *

*

This is publicly visible to be used in tests. */ - public static List getKeyGroupsStateHandles( - Collection allKeyGroupsHandles, - KeyGroupRange subtaskKeyGroupIds) { + public static List getKeyedStateHandles( + Collection keyedStateHandles, + KeyGroupRange subtaskKeyGroupRange) { - List subtaskKeyGroupStates = new ArrayList<>(); + List subtaskKeyedStateHandles = new ArrayList<>(); - for (KeyGroupsStateHandle storedKeyGroup : allKeyGroupsHandles) { - KeyGroupsStateHandle intersection = storedKeyGroup.getKeyGroupIntersection(subtaskKeyGroupIds); - if (intersection.getNumberOfKeyGroups() > 0) { - subtaskKeyGroupStates.add(intersection); - } + for (KeyedStateHandle keyedStateHandle : keyedStateHandles) { + KeyedStateHandle intersectedKeyedStateHandle = keyedStateHandle.getIntersection(subtaskKeyGroupRange); + + subtaskKeyedStateHandles.add(intersectedKeyedStateHandle); --- End diff -- I think we should only add a state handle if the key group range from the intersection is non-empty. Even though those empty handles are probably ignored later, I think it is cleaner. > Add KeyedStateHandle for the snapshots in keyed streams > ------------------------------------------------------- > > Key: FLINK-6034 > URL: https://issues.apache.org/jira/browse/FLINK-6034 > Project: Flink > Issue Type: Sub-task > Components: State Backends, Checkpointing > Reporter: Xiaogang Shi > Assignee: Xiaogang Shi > > Currently, the only type of the snapshots in keyed streams is {{KeyGroupsStateHandle}} which is full and store the states one group after another. With the introduction of incremental checkpointing, we need a higher level abstraction of keyed snapshots to allow flexible snapshot formats. > The implementation of {{KeyedStateHandle}} s may vary a lot in different backends. The only information needed in {{KeyedStateHandle}} s is their key group range. When recovering the job with a different degree of parallelism, {{KeyedStateHandle}} s will be assigned to those subtasks whose key group ranges overlap with their ranges. -- This message was sent by Atlassian JIRA (v6.3.15#6346)