Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-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 81459189D0 for ; Tue, 1 Mar 2016 16:27:39 +0000 (UTC) Received: (qmail 9638 invoked by uid 500); 1 Mar 2016 16:27:17 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 9590 invoked by uid 500); 1 Mar 2016 16:27:17 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 9580 invoked by uid 99); 1 Mar 2016 16:27:17 -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; Tue, 01 Mar 2016 16:27:17 +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 3EC2518055A for ; Tue, 1 Mar 2016 16:27:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.948 X-Spam-Level: * X-Spam-Status: No, score=1.948 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id bbUAhD8iUUb1 for ; Tue, 1 Mar 2016 16:27:15 +0000 (UTC) Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id B18105FBC4 for ; Tue, 1 Mar 2016 16:27:14 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id ts10so171178714obc.1 for ; Tue, 01 Mar 2016 08:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=6teXaIvSIN2BppmsPIWpVWZRwSD1GWdEeLb0HkGvZv4=; b=DFDi3rc8Nc0qx0kJzDgLNhF4XEcMPaL+4SAeR1Yq1vo5+Y0ghVXV2OeQbkYw+1C/+K hud4oRPflL/dUHtyStDYlToEUnOpa9m9GEy9f+R3grrboc6/HfDNSdXyp6rXpVj4PEbW iJw73oYsFG0cSZggZH5Pv7hFv8IPorhPX7DqK3DItHHMvjG09w2jvRV8+iubIo6Vwq5F qAL1hU+0DgoHU8NCMqABNaTq2bxrDaIre4iQuv1PJgIzDeYNggjCve3fdwwEGZqig7bB OTNTTNQWte7rg68gChcx4dJ+VpKEb8LicGplLrQMQr/uh4KMZYmjZuaNreq24i+35hV8 j42A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=6teXaIvSIN2BppmsPIWpVWZRwSD1GWdEeLb0HkGvZv4=; b=h1g09mOFjYMrnaoQs89a2Vii4taZuxg7ZlvtT+l6oTvn0ighwG+q5ZbvitGtL1tad1 X3GsZpydaURiRDCM52b/CZEFk03+UsWckVWRvfNtHQCwFc1VjQB7wDb3TiP5p0K8C7Yi g+ZuLu7xm/CYRa4M66f9BfCbTdLBV98KydhZ5I3rFoChSISOIuM6u3LDg/PwGtvUzTOQ OyWV9auuLZVAGNeyemkC+lY4/pofYEgZ/i5UIBVF6skdbZaTiFGTdv8X1l1o24yJVogo N41U/9cg/N0c0J5tyVZSkvD3IZ4bzFLXnIvRNzQauH+JiPClpUxo+nfhQOHB2ZN+p8qg SRXg== X-Gm-Message-State: AD7BkJJLNrT/FcptISIu46Ad+yGW8On4cvsOR3eXfKBZOctvF63+Zx1J1/5H/cDZl6rRMIkujmg4NY+CO0TLUQ== MIME-Version: 1.0 X-Received: by 10.182.38.199 with SMTP id i7mr17880656obk.86.1456849633537; Tue, 01 Mar 2016 08:27:13 -0800 (PST) Received: by 10.202.220.86 with HTTP; Tue, 1 Mar 2016 08:27:13 -0800 (PST) In-Reply-To: References: Date: Tue, 1 Mar 2016 21:57:13 +0530 Message-ID: Subject: Re: IgniteCache: How to receive Load Re-balance notifications? From: Kamal C To: user@ignite.apache.org Content-Type: multipart/alternative; boundary=001a11c32ddce5f613052cff3cb6 --001a11c32ddce5f613052cff3cb6 Content-Type: text/plain; charset=UTF-8 Pavel, I'd like to receive notifications when a node left / joined the cluster. Gone through discovery notifications. But, In my application it would be more appropriate to receive notification after re-balance / a backup partition in a node becomes primary. On Tue, Mar 1, 2016 at 9:36 PM, Pavel Tupitsyn wrote: > Kamal, > > In replicated mode all data is already on every node, so there is no need > to rebalance. > http://apacheignite.gridgain.org/docs/cache-modes > > On Tue, Mar 1, 2016 at 6:58 PM, Kamal C wrote: > >> Vladimir, >> >> I had included the re-balance event types in *example-default.xml. *I'm >> able to receive REBALANCE notifications when cache mode is set to >> partitioned. >> >> Does re-balancing won't trigger when cache mode is replicated ? >> >> -- >> Kamal >> On 29-Feb-2016 7:07 PM, "Vladimir Ozerov" wrote: >> >>> Kamal, >>> >>> You should enable these event type in configuration. See IgniteConfiguration.setIncludeEventTypes(int >>> ...) method. >>> >>> Vladimir. >>> >>> On Mon, Feb 29, 2016 at 12:00 PM, Kamal C wrote: >>> >>>> Hi, >>>> >>>> I have a replicated ignite cache with 3 nodes. I want to listen for >>>> data rebalance notifications in all the nodes whenever a new node joined / >>>> left the cluster. >>>> >>>> Using Ignite Events, I'd tried to register for cache re-balance >>>> notifications. But, I'm unable to receive any notifications. >>>> >>>> CacheConfiguration cacheCfg = new >>>> CacheConfiguration<>("cache_name"); >>>> cacheCfg.setCacheMode(CacheMode.REPLICATED); >>>> >>>> >>>> IgniteCache cache = ignite.getOrCreateCache(cacheCfg); >>>> >>>> ignite.events(ignite.cluster().forCacheNodes("cache_name")).localListen( >>>> new IgnitePredicate() { >>>> >>>> private static final long serialVersionUID = 1L; >>>> >>>> @Override >>>> public boolean apply(CacheRebalanacingEvent e) >>>> { >>>> if(e.cacheName.equals("cache_name")) { >>>> logger.info("Received rebalancing Event : >>>> {}", e); >>>> } >>>> return true; >>>> } >>>> }, EventType.EVTS_CACHE_REBALANCE); >>>> >>>> >>>> >>>> >>>> *In logs,* WARN [2016-02-29 13:01:31,661] [main] >>>> (Log4JLogger.java:480) - Added listener for disabled event type: >>>> CACHE_REBALANCE_STARTED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_STOPPED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_PART_LOADED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_PART_UNLOADED >>>> WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_OBJECT_LOADED >>>> WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_OBJECT_UNLOADED >>>> WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added >>>> listener for disabled event type: CACHE_REBALANCE_PART_DATA_LOST >>>> >>>> >>>> How to receive REBALANCE_STOPPED notification ? >>>> >>>> -- >>>> Kamal >>>> >>>> >>> > --001a11c32ddce5f613052cff3cb6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Pavel,

I'd like to receive notifications w= hen a node left / joined the cluster.=C2=A0

Gone through discovery = notifications. But, In my application it would be more appropriate to recei= ve notification after re-balance / a backup partition in a node becomes pri= mary.

On Tue, Mar 1, 2016 at 9:36 PM, Pavel Tupitsyn <ptupitsyn@gridgai= n.com> wrote:
Kamal,

In replicated mode all data is already on eve= ry node, so there is no need to rebalance.
<= div class=3D"h5">

= On Tue, Mar 1, 2016 at 6:58 PM, Kamal C <kamaltarget@gmail.com>= wrote:

Vladim= ir,

I had included the re-balance event types in example-default.x= ml. I'm able to receive REBALANCE notifications when cache mode is = set to partitioned.

Does re-balancing won't trigger when cache mo= de is replicated ?

--
Kamal

On 29-Feb-2016 7:07 PM, "Vladimir Ozerov&qu= ot; <vozerov@g= ridgain.com> wrote:
Kamal,

You should enable these e= vent type in configuration. See IgniteC= onfiguration.setIncludeEventTypes(int ...) method.

Vladimir.

On Mon, Feb 29, 2016 at 12:00 PM, Kamal C <= ;kamaltarget@gma= il.com> wrote:
Hi,

=C2=A0 =C2=A0 I have a replicated ignit= e cache with 3 nodes. I want to=20 listen for data rebalance notifications in all the nodes whenever a new node joined / left the cluster.

Using Ignite Events,= I'd tried to register for cache re-balance notifications. But, I'm= unable to receive any notifications.

CacheConfiguration<String, Intege= r> cacheCfg =3D new CacheConfiguration<>("cache_name");<= br>cacheCfg.setCacheMode(CacheMode.REPLICATED);
=C2=A0=C2=A0=C2=A0
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0
IgniteCache<String, Boolean>= ; cache =3D ignite.getOrCreateCache(cacheCfg);
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0
ignite.events(ignite.cluster().forCacheNodes("cache_n= ame")).localListen(
=C2=A0=C2=A0=C2=A0 new IgnitePredicate<Cache= RebalanacingEvent>() {

=C2=A0=C2=A0=C2=A0 private static final lo= ng serialVersionUID =3D 1L;

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 @Override
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 public boolean apply(CacheRebalanacingEvent e)
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if(e.cacheN= ame.equals("cache_name")) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 = logger.info("Received rebalancing Event : {}", e);
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 return true;
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }, EventType.EVTS_CACHE_= REBALANCE);


In logs,

=C2=A0WARN [2016-02-29 13= :01:31,661] [main] (Log4JLogger.java:480) - Added listener for disabled eve= nt type: CACHE_REBALANCE_STARTED
=C2=A0WARN [2016-02-29 13:01:31,662] [m= ain] (Log4JLogger.java:480) - Added listener for disabled event type: CACHE= _REBALANCE_STOPPED
=C2=A0WARN [2016-02-29 13:01:31,662] [main] (Log4JLog= ger.java:480) - Added listener for disabled event type: CACHE_REBALANCE_PAR= T_LOADED
=C2=A0WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:4= 80) - Added listener for disabled event type: CACHE_REBALANCE_PART_UNLOADED=
=C2=A0WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Ad= ded listener for disabled event type: CACHE_REBALANCE_OBJECT_LOADED
=C2= =A0WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added lis= tener for disabled event type: CACHE_REBALANCE_OBJECT_UNLOADED
=C2=A0WAR= N [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added listener = for disabled event type: CACHE_REBALANCE_PART_DATA_LOST


<= /span>
How to receive REBALANCE_STOPPED notification = ?

--
Kamal
=




--001a11c32ddce5f613052cff3cb6--