Re: affinityRun() and affinityCall() (JIRA ticket)

2016-01-29 Thread Dood

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!








Re: affinityRun() and affinityCall() (JIRA ticket)

2016-01-29 Thread Valentin Kulichenko
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!
>>>
>>>
>>>
>>>
>>>
>


Re: affinityRun() and affinityCall() (JIRA ticket)

2016-01-27 Thread Dmitriy Setrakyan
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  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!
>
>
>
>


affinityRun() and affinityCall() (JIRA ticket)

2016-01-27 Thread Dood

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!





Re: affinityRun() and affinityCall() (JIRA ticket)

2016-01-27 Thread Valentin Kulichenko
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!
>
>
>
>


Re: affinityRun() and affinityCall() (JIRA ticket)

2016-01-27 Thread Dmitriy Setrakyan
On Wed, Jan 27, 2016 at 5:48 PM, Dmitriy Setrakyan 
wrote:

>
>
> On Wed, Jan 27, 2016 at 4:36 PM, Dood@ODDO  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.