Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 610031880C for ; Sat, 30 Jan 2016 04:56:30 +0000 (UTC) Received: (qmail 84077 invoked by uid 500); 30 Jan 2016 04:56:30 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 84009 invoked by uid 500); 30 Jan 2016 04:56:29 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 83997 invoked by uid 99); 30 Jan 2016 04:56:29 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jan 2016 04:56:29 +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 1E21B180546 for ; Sat, 30 Jan 2016 04:56:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.899 X-Spam-Level: ** X-Spam-Status: No, score=2.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id TdFL9WVSc6Gu for ; Sat, 30 Jan 2016 04:56:22 +0000 (UTC) Received: from mail-qk0-f176.google.com (mail-qk0-f176.google.com [209.85.220.176]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 6E33A429EE for ; Sat, 30 Jan 2016 04:56:22 +0000 (UTC) Received: by mail-qk0-f176.google.com with SMTP id s5so32619542qkd.0 for ; Fri, 29 Jan 2016 20:56:22 -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 :content-type; bh=DpiLyzBXrFpOVmxZ1v+Em+85JyhduazdkGA9s+J2nDo=; b=SBYr9rHdzuHGT3Z98wjrQNXO0pVdCxJ4XcgFc0mv4bL/Hg81MQUHnVz3XXL2erwnKB ORT4dTsjxK+xuL42EqUl4EO6UEfZ4v4QfHVPfOgQpKHLqs/aHtrLcB6i8rGKqH8bwL+O nz3ZOSnOmZ5ILx7bMe6TbWd2eLc//LgPJwVdrJjZ5voRCn85C4vLHwWTErYp2Rpf/p+j vs+7DxYxbM+c2gXkmFu6UXHJQcU+1ujw6d+eWap37V0qF44eY0hr8krT2UBe/lpPcV8N RUhmhvLD8VFqPld85i610vJXqHetjdZbIq6o5QRlYijWp/ebyapGnqygJgQqEbBpWUwr /bOQ== 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:content-type; bh=DpiLyzBXrFpOVmxZ1v+Em+85JyhduazdkGA9s+J2nDo=; b=Ry+cVoXyZjPAtwnyGKNZz4pOR1BS3AMjDIEtn9CvJnQ7SZemr1WIgHFlpClP8FENLP 1YO7VKTbCP9DCuOtCXzhPro7uqmHEnMC7DokWU5n5F+Qa9ZumV+KDqXDRM3ALqT7116C nf63mcOc0QoMTrXIzVGVfVIvFdR4LdnK/DnQxmB1fRAVTs38GRyzAL61XO9io5WhVJNc tx0T+2/EWEPR7mijxmmWGc3WDusfYnvK0tynv5GsxCWBEZ6hYUGwYaTpxwLY7QcmL8OS 0FlSs5VEfVthQSwDpiave9wHyhV79DNOunwyDAGz7/T2gdupfsV8p9ktpR+eSMIF8eD+ /KLA== X-Gm-Message-State: AG10YOTf79spmodgi+m3Gx2SAW5HdJJx13wl0R5NKynIXLe6Fziy7IPHtt4ehhJ15Ihs6fKc3mNo1szRD6dNKQ== MIME-Version: 1.0 X-Received: by 10.55.74.86 with SMTP id x83mr15184680qka.89.1454129782081; Fri, 29 Jan 2016 20:56:22 -0800 (PST) Received: by 10.140.25.195 with HTTP; Fri, 29 Jan 2016 20:56:22 -0800 (PST) In-Reply-To: <56AB7FB9.1020407@gmail.com> References: <56A8FAD2.6060402@gmail.com> <56AB7FB9.1020407@gmail.com> Date: Fri, 29 Jan 2016 20:56:22 -0800 Message-ID: Subject: Re: affinityRun() and affinityCall() (JIRA ticket) From: Valentin Kulichenko To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=001a114aa19c1e6f1c052a85f963 --001a114aa19c1e6f1c052a85f963 Content-Type: text/plain; charset=UTF-8 Responded in the ticket. -Val On Fri, Jan 29, 2016 at 7:05 AM, Dood@ODDO wrote: > Val, > > Before I go on and submit pull requests etc. - would you comment on the > path I am taking with this? As I said I am not a JAVA developer but I am > trying to teach myself the language and contribute at the same time ;) > > Here are my thoughts on implementing this for the queue > (GridCacheQueueAdapter.java). I have also declared the following in > IgniteQueue.java: > > @IgniteAsyncSupported > public void affinityRun(IgniteRunnable job) throws IgniteException; > > @IgniteAsyncSupported > public R affinityCall(IgniteCallable job) throws IgniteException; > > Here is what is in GridCacheQueueAdapter.java > > /** {@inheritDoc} */ > public void affinityRun(IgniteRunnable job) { > if (!collocated) > throw new IgniteException("Illegal operation requested on non-collocated > queue:affinityRun()."); > > try { > compute.affinityRun(cache.name(),queueKey,job); > } > catch (IgniteException e) { > throw e; > } > } > > /** {@inheritDoc} */ > public R affinityCall(IgniteCallable job) { > if (!collocated) > throw new IgniteException("Illegal operation requested on non-collocated > queue:affinityCall()."); > > try { > return compute.affinityCall(cache.name(),queueKey,job); > } > catch (IgniteException e) { > throw e; > } > } > > I have included the following at the top of the class > GridCacheQueueAdapter: > private final IgniteCompute compute; > > this.compute = cctx.kernalContext().grid().compute(); > > Let me know what you think! > > > On 1/27/2016 3:55 PM, Valentin Kulichenko wrote: > >> Hi, >> >> Both GridCacheQueueAdapter and GridCacheSetImpl have a reference to >> GridCacheContext which represents the underlying cache for the data >> structure. GridCacheContext.name() will give you the correct cache name >> that you can use when calling affinityRun method. >> >> -Val >> >> On Wed, Jan 27, 2016 at 9:13 AM, Dood@ODDO wrote: >> >> Hello, >>> >>> I am playing with https://issues.apache.org/jira/browse/IGNITE-1144 as >>> introduction to hacking on Ignite. I am not a Java developer by day but >>> have experience writing code in various languages. This is my first >>> in-depth exposure to Ignite internals (have lightly used it as a user in >>> a >>> POC project). >>> >>> Looking at this ticket, I am guessing that what it needs to do is get the >>> cache name from the kernel context. After that it can just pass on the >>> call >>> (such as affinityRun()) to the regular affinityRun() call with the cache >>> name filled in as the first parameter. This is because an internal >>> (un-exposed) cache is used to track the queue/set data structures. Is >>> this >>> all correct? >>> >>> My question is: how do I get the cache name from within the queue >>> implementation. >>> >>> Thanks! >>> >>> >>> >>> >>> > --001a114aa19c1e6f1c052a85f963--