Return-Path: X-Original-To: apmail-helix-user-archive@minotaur.apache.org Delivered-To: apmail-helix-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E635110B7C for ; Mon, 15 Dec 2014 23:39:12 +0000 (UTC) Received: (qmail 34432 invoked by uid 500); 15 Dec 2014 23:39:12 -0000 Delivered-To: apmail-helix-user-archive@helix.apache.org Received: (qmail 34384 invoked by uid 500); 15 Dec 2014 23:39:12 -0000 Mailing-List: contact user-help@helix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@helix.apache.org Delivered-To: mailing list user@helix.apache.org Received: (qmail 34374 invoked by uid 99); 15 Dec 2014 23:39:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2014 23:39:12 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of prvs=4197aaa61=zzhang@linkedin.com designates 69.28.149.80 as permitted sender) Received: from [69.28.149.80] (HELO esv4-mav04.corp.linkedin.com) (69.28.149.80) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2014 23:39:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkedin.com; i=@linkedin.com; q=dns/txt; s=proddkim1024; t=1418686748; x=1450222748; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=XBGB6WcTjvgIvjPKx255l2jTWYdydQu7de5y5qIXRqk=; b=s5Qr0NjEwYI2EkmY5yPzmLbNz6MB3pLQe9nnaI78Oj4VDfF1t7eQpB5s Pm9Q/4g9/GmL21zczYC45lk+6xMiXXiLW65GdskB7z4DYj6jvuFJEcLDZ 0CeyekmCVPJx5EyW0i51+kvG1vUq6SWtokKrASr0u19Evr/QuNTtmU65N s=; X-IronPort-AV: E=Sophos;i="5.07,582,1413270000"; d="scan'208";a="164726191" Received: from ESV4-MB02.linkedin.biz ([fe80::8093:3d15:3c8e:a479]) by ESV4-HT01.linkedin.biz ([::1]) with mapi id 14.03.0195.001; Mon, 15 Dec 2014 15:36:47 -0800 From: Zhen Zhang To: "user@helix.apache.org" Subject: RE: Upgrade to 0.7.1 Thread-Topic: Upgrade to 0.7.1 Thread-Index: AQHQF1gAG5sPSV6MREWffm+V7cHXpZyRmKEAgAAIiYD//6+ZQA== Date: Mon, 15 Dec 2014 23:36:47 +0000 Message-ID: <23CA11DC8830BA44A37C6B44B14D013C9559A20C@ESV4-MB02.linkedin.biz> References: <548D13EC.3030904@gmail.com> ,<548F430F.4050905@gmail.com> In-Reply-To: <548F430F.4050905@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.46.254] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Vinayak, =0A= =0A= I created a simple test case using you code snippet, but couldn't repo the = problem:=0A= https://issues.apache.org/jira/browse/HELIX-561=0A= =0A= Let's use this jira for further discussion.=0A= =0A= Thanks,=0A= Zhen=0A= =0A= ________________________________________=0A= From: Vinayak Borkar [vinayakb@gmail.com]=0A= Sent: Monday, December 15, 2014 12:22 PM=0A= To: user@helix.apache.org=0A= Subject: Re: Upgrade to 0.7.1=0A= =0A= Hi Zhen,=0A= =0A= Thanks for your response.=0A= =0A= Here is a snippet of code that creates HelixManager and registers the=0A= state model factory. As I indicated in my previous email, this code used=0A= to work with 0.6.2-incubating. All I did was to do whatever I had to do=0A= to fix the compilation issues.=0A= =0A= =0A= hManager =3D HelixManagerFactory.getZKHelixManager(clusterName, id,=0A= InstanceType.PARTICIPANT, zkAddr);=0A= hManager.getStateMachineEngine().registerStateModelFactory(StateMachineType= .MASTER_SLAVE.getStateModelDefId(),=0A= new MasterSlaveStateModelFactory(this));=0A= hManager.connect();=0A= hManager.addExternalViewChangeListener(router);=0A= hManager.addInstanceConfigChangeListener(router);=0A= hManager.addLiveInstanceChangeListener(router);=0A= =0A= =0A= The state model class looks like this:=0A= =0A= =0A= public class MasterSlaveStateModel extends TransitionHandler {=0A= @Transition(to =3D "SLAVE", from =3D "OFFLINE")=0A= public void onBecomeSlaveFromOffline(Message message,=0A= NotificationContext context) throws Exception {=0A= ...=0A= }=0A= =0A= @Transition(to =3D "MASTER", from =3D "SLAVE")=0A= public void onBecomeMasterFromSlave(Message message,=0A= NotificationContext context) throws Exception {=0A= ...=0A= }=0A= =0A= @Transition(to =3D "SLAVE", from =3D "MASTER")=0A= public void onBecomeSlaveFromMaster(Message message,=0A= NotificationContext context) throws Exception {=0A= ...=0A= }=0A= =0A= @Transition(to =3D "OFFLINE", from =3D "SLAVE")=0A= public void onBecomeOfflineFromSlave(Message message,=0A= NotificationContext context) throws Exception {=0A= ...=0A= }=0A= =0A= @Transition(to =3D "DROPPED", from =3D "OFFLINE")=0A= public void onBecomeDroppedFromOffline(Message message,=0A= NotificationContext context) throws Exception {=0A= ...=0A= }=0A= =0A= @Transition(to =3D "OFFLINE", from =3D "ERROR")=0A= public void onBecomeOfflineFromError(Message message,=0A= NotificationContext context) throws Exception {=0A= ...=0A= }=0A= =0A= ...=0A= }=0A= =0A= =0A= Thanks,=0A= Vinayak=0A= =0A= =0A= On 12/15/14, 11:52 AM, Zhen Zhang wrote:=0A= > Hi Vinayak,=0A= >=0A= > We need to add documentation for upgrading 0.6.x to 0.7.1:=0A= > https://issues.apache.org/jira/browse/HELIX-560=0A= >=0A= > 0.7.1 provides a new set of API. it's not backward compatible in the=0A= > sense that all errors should be exposed in compile time. Regarding the=0A= > state machine receiving two OFFLINE->SLAVE transitions, could you please= =0A= > share how you create helix-manager and register state model. Also what's= =0A= > your state model look like?=0A= >=0A= > Thanks,=0A= > Jason=0A= >=0A= >=0A= > On Sat, Dec 13, 2014 at 8:37 PM, Vinayak Borkar > wrote:=0A= >=0A= > Hi Guys,=0A= >=0A= >=0A= > Is there a document/checklist to help upgrade and application from=0A= > 0.6.x to 0.7.1?=0A= >=0A= > Here are a few things I had to do to get my code to compile:=0A= >=0A= > 1. Change StateModelFactory -> StateTransitionHandlerFactory=0A= > 2. Change StateModel -> TransitionHandler=0A= > 3. Use PartitionId and StateModelDefId instead of String.=0A= >=0A= > Although the code compiles, it does not work as it used to in 0.6.x.= =0A= >=0A= > For example, I am seeing my state machine (Master Slave) receive an= =0A= > OFFLINE->SLAVE transition twice.=0A= >=0A= > Thanks,=0A= > Vinayak=0A= >=0A= =0A=