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 0072B200BB3 for ; Wed, 19 Oct 2016 05:27:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F2FF1160AFC; Wed, 19 Oct 2016 03:27:24 +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 55817160AE5 for ; Wed, 19 Oct 2016 05:27:24 +0200 (CEST) Received: (qmail 34036 invoked by uid 500); 19 Oct 2016 03:27:23 -0000 Mailing-List: contact commits-help@eagle.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@eagle.incubator.apache.org Delivered-To: mailing list commits@eagle.incubator.apache.org Received: (qmail 33939 invoked by uid 99); 19 Oct 2016 03:27:23 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2016 03:27:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D763A1A0592 for ; Wed, 19 Oct 2016 03:27:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 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=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id wlPs0gEBKgPg for ; Wed, 19 Oct 2016 03:27:21 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id A71A35F257 for ; Wed, 19 Oct 2016 03:27:18 +0000 (UTC) Received: (qmail 33058 invoked by uid 99); 19 Oct 2016 03:27: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; Wed, 19 Oct 2016 03:27:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 38253F1595; Wed, 19 Oct 2016 03:27:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hao@apache.org To: commits@eagle.incubator.apache.org Date: Wed, 19 Oct 2016 03:27:31 -0000 Message-Id: <6e2348bef318489baa9af0d3cb1af353@git.apache.org> In-Reply-To: <679f7884b2ff4acc87cbf4e51a1de5db@git.apache.org> References: <679f7884b2ff4acc87cbf4e51a1de5db@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [16/50] incubator-eagle git commit: EAGLE-602: Exception that Spec Version [xxx] of AlertBolt is newer than Stream Event Version [null] archived-at: Wed, 19 Oct 2016 03:27:25 -0000 EAGLE-602: Exception that Spec Version [xxx] of AlertBolt is newer than Stream Event Version [null] Auhtor: Zeng, Bryant Reviewer: ralphsu This closes #486 Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/74c3cbb5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/74c3cbb5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/74c3cbb5 Branch: refs/heads/master Commit: 74c3cbb5b1653974870e805b717987eb75e5113d Parents: 3301c9d Author: mizeng Authored: Mon Oct 10 17:58:54 2016 +0800 Committer: Ralph, Su Committed: Thu Oct 13 15:26:19 2016 +0800 ---------------------------------------------------------------------- .../org/apache/eagle/alert/engine/runner/AlertBolt.java | 11 ++++++----- .../engine/serialization/impl/StreamEventSerializer.java | 6 ++++++ 2 files changed, 12 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/74c3cbb5/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java index f437d43..fbee580 100755 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java +++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/runner/AlertBolt.java @@ -107,11 +107,12 @@ public class AlertBolt extends AbstractStreamBolt implements AlertBoltSpecListen try { PartitionedEvent pe = deserialize(input.getValueByField(AlertConstants.FIELD_0)); String streamEventVersion = pe.getEvent().getMetaVersion(); - if (streamEventVersion != null && !streamEventVersion.equals(specVersion)) { - if (streamEventVersion == null) { - // if stream event version is null, need to initialize it - pe.getEvent().setMetaVersion(specVersion); - } else if (specVersion != null && streamEventVersion != null + + if (streamEventVersion == null) { + // if stream event version is null, need to initialize it + pe.getEvent().setMetaVersion(specVersion); + } else if (streamEventVersion != null && !streamEventVersion.equals(specVersion)) { + if (specVersion != null && streamEventVersion != null && specVersion.contains("spec_version_") && streamEventVersion.contains("spec_version_")) { // check if specVersion is older than stream_event_version // Long timestamp_of_specVersion = Long.valueOf(specVersion.split("spec_version_")[1]); http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/74c3cbb5/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/serialization/impl/StreamEventSerializer.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/serialization/impl/StreamEventSerializer.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/serialization/impl/StreamEventSerializer.java index d7119db..8ffcb83 100644 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/serialization/impl/StreamEventSerializer.java +++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/serialization/impl/StreamEventSerializer.java @@ -89,6 +89,12 @@ public class StreamEventSerializer implements Serializer { String metaVersionStreamId = dataInput.readUTF(); String streamId = metaVersionStreamId.split("/")[1]; String metaVersion = metaVersionStreamId.split("/")[0]; + // sometimes metaVersionStreamId will be "null/id", then metaVersion will be "null" rather than null + // need to handle it for future use + if (metaVersion.equals("null")) { + metaVersion = null; + } + event.setStreamId(streamId); event.setMetaVersion(metaVersion);