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 16D6F200BAF for ; Mon, 17 Oct 2016 05:29:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 156E0160AF8; Mon, 17 Oct 2016 03:29:35 +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 5CC0E160AD0 for ; Mon, 17 Oct 2016 05:29:34 +0200 (CEST) Received: (qmail 34245 invoked by uid 500); 17 Oct 2016 03:29:33 -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 34235 invoked by uid 99); 17 Oct 2016 03:29:33 -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; Mon, 17 Oct 2016 03:29:33 +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 A45A91A052B for ; Mon, 17 Oct 2016 03:29:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.159 X-Spam-Level: ** X-Spam-Status: No, score=2.159 tagged_above=-999 required=6.31 tests=[FORGED_HOTMAIL_RCVD2=1.187, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972] 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 kRPucZvVyx_z for ; Mon, 17 Oct 2016 03:29:30 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id EB37F5FB90 for ; Mon, 17 Oct 2016 03:29:29 +0000 (UTC) Received: from static.162.255.23.37.macminivault.com (unknown [162.255.23.37]) by mbob.nabble.com (Postfix) with ESMTP id 4CE3033CE286 for ; Sun, 16 Oct 2016 20:23:02 -0700 (PDT) Date: Sun, 16 Oct 2016 20:29:22 -0700 (MST) From: minisoft_rm To: user@ignite.apache.org Message-ID: <1476674962370-8317.post@n6.nabble.com> In-Reply-To: <1476399477291-8277.post@n6.nabble.com> References: <1476371839396-8270.post@n6.nabble.com> <1476399477291-8277.post@n6.nabble.com> Subject: Re: sample code for customised Partition logic MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Mon, 17 Oct 2016 03:29:35 -0000 Hi Val, the reason is that "assignPartitions()" returns same "List>" usually even I start two ignite nodes. last Friday, I refactor it as below:[ @Override public List> assignPartitions(final AffinityFunctionContext affCtx) { final List nodes = affCtx.currentTopologySnapshot(); int tmpi = 0; final List> assignments = new ArrayList<>(2); for (int i = 0; i < 2; i++) { final List partAssignment = new ArrayList(); partAssignment.add(nodes.get(tmpi)); if (tmpi < nodes.size() - 1) { tmpi++; } assignments.add(partAssignment); } return assignments; } ] and it return result like: list[0] -> node1; list[1] -> node2. it is what I want. I don't think the original "assignPartitions()" has bug. (there are lots of people use it without error, right?) but why "assignPartitions()" returns to me the same node# List ? -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/sample-code-for-customised-Partition-logic-tp8270p8317.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.