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! |
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 <[hidden email]> 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! > > > > |
In reply to this post by Dood@ODDO
Hi,
We should assign the ticket to you. Can you please send your Jira username here (you can create one)? This way I will add you to a list of Ignite contributors in Jira and assign the ticket to you. D. On Wed, Jan 27, 2016 at 9:13 AM, Dood@ODDO <[hidden email]> 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! > > > > |
On 1/27/2016 5:33 PM, Dmitriy Setrakyan wrote:
> Hi, > > We should assign the ticket to you. Can you please send your Jira username > here (you can create one)? This way I will add you to a list of Ignite > contributors in Jira and assign the ticket to you. > > D. Dmitriy, username is "maketo". Thanks! |
On Wed, Jan 27, 2016 at 4:36 PM, Dood@ODDO <[hidden email]> wrote:
> On 1/27/2016 5:33 PM, Dmitriy Setrakyan wrote: > >> Hi, >> >> We should assign the ticket to you. Can you please send your Jira username >> here (you can create one)? This way I will add you to a list of Ignite >> contributors in Jira and assign the ticket to you. >> >> D. >> > > Dmitriy, username is "maketo". Thanks! > Apache Jira is telling me that there is no such user. Did you create an account? |
On Wed, Jan 27, 2016 at 5:48 PM, Dmitriy Setrakyan <[hidden email]>
wrote: > > > On Wed, Jan 27, 2016 at 4:36 PM, Dood@ODDO <[hidden email]> wrote: > >> On 1/27/2016 5:33 PM, Dmitriy Setrakyan wrote: >> >>> Hi, >>> >>> We should assign the ticket to you. Can you please send your Jira >>> username >>> here (you can create one)? This way I will add you to a list of Ignite >>> contributors in Jira and assign the ticket to you. >>> >>> D. >>> >> >> Dmitriy, username is "maketo". Thanks! >> > > Apache Jira is telling me that there is no such user. Did you create an > account? > Worked now. The ticket is assigned to you. |
In reply to this post by Valentin Kulichenko
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> R affinityCall(IgniteCallable<R> 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> R affinityCall(IgniteCallable<R> 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 <[hidden email]> 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! >> >> >> >> |
Responded in the ticket.
-Val On Fri, Jan 29, 2016 at 7:05 AM, Dood@ODDO <[hidden email]> 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> R affinityCall(IgniteCallable<R> 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> R affinityCall(IgniteCallable<R> 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 <[hidden email]> 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! >>> >>> >>> >>> >>> > |
Hi!
I looked through your latest pull request and left several comments on the ticket. -Val On Fri, Jan 29, 2016 at 8:56 PM, Valentin Kulichenko < [hidden email]> wrote: > Responded in the ticket. > > -Val > > On Fri, Jan 29, 2016 at 7:05 AM, Dood@ODDO <[hidden email]> 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> R affinityCall(IgniteCallable<R> 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> R affinityCall(IgniteCallable<R> 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 <[hidden email]> 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! >>>> >>>> >>>> >>>> >>>> >> > |
Free forum by Nabble | Edit this page |