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 2CA3E2009E8 for ; Mon, 30 May 2016 12:17:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2B342160A16; Mon, 30 May 2016 10:17:21 +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 71BF7160A19 for ; Mon, 30 May 2016 12:17:20 +0200 (CEST) Received: (qmail 82333 invoked by uid 500); 30 May 2016 10:17:19 -0000 Mailing-List: contact commits-help@beam.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.incubator.apache.org Delivered-To: mailing list commits@beam.incubator.apache.org Received: (qmail 82324 invoked by uid 99); 30 May 2016 10:17:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2016 10:17:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3EC29C0227 for ; Mon, 30 May 2016 10:17:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id iKZdf1Q5RrOR for ; Mon, 30 May 2016 10:17:18 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id E0C625F257 for ; Mon, 30 May 2016 10:17:17 +0000 (UTC) Received: (qmail 82230 invoked by uid 99); 30 May 2016 10:17:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2016 10:17:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EE5DFE0252; Mon, 30 May 2016 10:17:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mxm@apache.org To: commits@beam.incubator.apache.org Date: Mon, 30 May 2016 10:17:16 -0000 Message-Id: <37bd3a340ad1471faa2932c52a0335af@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/4] incubator-beam git commit: [Beam-312] don't checkpoint if CheckpointCoder not available archived-at: Mon, 30 May 2016 10:17:21 -0000 Repository: incubator-beam Updated Branches: refs/heads/master cca2577c6 -> 36a27f538 [Beam-312] don't checkpoint if CheckpointCoder not available This skips the checkpoint logic in the UnboundedSourceWrapper if the UnboundedSource doesn't supply a CheckpointMarkCoder. Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/9c4072ad Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/9c4072ad Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/9c4072ad Branch: refs/heads/master Commit: 9c4072ad87f25248f77e437e5bcf674aff19982b Parents: cca2577 Author: Maximilian Michels Authored: Mon May 30 15:59:12 2016 +0200 Committer: Maximilian Michels Committed: Sat May 28 16:17:15 2016 +0200 ---------------------------------------------------------------------- .../streaming/io/UnboundedSourceWrapper.java | 24 +++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/9c4072ad/runners/flink/runner/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java ---------------------------------------------------------------------- diff --git a/runners/flink/runner/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java b/runners/flink/runner/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java index b816e2a..7f26a65 100644 --- a/runners/flink/runner/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java +++ b/runners/flink/runner/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java @@ -120,10 +120,17 @@ public class UnboundedSourceWrapper< } Coder checkpointMarkCoder = source.getCheckpointMarkCoder(); - Coder> sourceCoder = - SerializableCoder.of(new TypeDescriptor>() {}); + if (checkpointMarkCoder == null) { + LOG.info("No CheckpointMarkCoder specified for this source. Won't create snapshots."); + checkpointCoder = null; + } else { + + Coder> sourceCoder = + SerializableCoder.of(new TypeDescriptor>() { + }); - checkpointCoder = (ListCoder) ListCoder.of(KvCoder.of(sourceCoder, checkpointMarkCoder)); + checkpointCoder = (ListCoder) ListCoder.of(KvCoder.of(sourceCoder, checkpointMarkCoder)); + } // get the splits early. we assume that the generated splits are stable, // this is necessary so that the mapping of state to source is correct @@ -308,6 +315,12 @@ public class UnboundedSourceWrapper< @Override public byte[] snapshotState(long l, long l1) throws Exception { + + if (checkpointCoder == null) { + // no checkpoint coder available in this source + return null; + } + // we checkpoint the sources along with the CheckpointMarkT to ensure // than we have a correct mapping of checkpoints to sources when // restoring @@ -333,6 +346,11 @@ public class UnboundedSourceWrapper< @Override public void restoreState(byte[] bytes) throws Exception { + if (checkpointCoder == null) { + // no checkpoint coder available in this source + return; + } + try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes)) { restoredState = checkpointCoder.decode(bais, Coder.Context.OUTER); }