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 <oddodao...@gmail.com> 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!





Reply via email to