-
1. Re: Distributed Execution - monitoring/tracking tasks in the various nodes
vblagojevic Mar 29, 2013 9:43 AM (in response to jignaasa)J,
There are plans for these features. Summarize your requirements and we'll see to include them in.
Regards,
Vladimir
-
2. Re: Distributed Execution - monitoring/tracking tasks in the various nodes
jignaasa Apr 11, 2013 3:08 PM (in response to vblagojevic)Sorry for the delay in responding.
Currently we are interested in a MBean in each of the Mapper/Worker nodes,
that can have an interface like the one below.
(We may also need similar instrumentation in the Master node: Basically get a list of Callables that have been submitted
via the DistributedExecutorService.submitXXX methods, but have not yet completed / completed with failures)
/**
1. We would also like a configurable enableStatistics to turn these ON/OFF
(Similar to the feature in for example Statistics: http://docs.jboss.org/infinispan/5.1/apidocs/jmxComponents.html#Statistics
2. Note: All Callables below correspond to the DistributedExecuteCommand
*/
public interface DistExecM/MXBean {
//Get a list of Callables that have been submitted to the Mapper but not started (since server restart)
Collection<Callable<?>> getTasksThatHaveNotStarted();
//Get a list of Callables that are currently running in the node
Collection<Callable<?>> getInProgressTasks();
//Get a list of failed Callables/DistributedCallables since server restart
Collection<Callable<?>> getFailedTasks();
void resetInProgressStatistics();
void resetFailedStatistics();
}
Please let me know if you need any more details.
FYI, I tried to do this on my own, by writing a custom interceptor MBean (similar to the Statistics MBean above)
import org.infinispan.interceptors.base.JmxStatsCommandInterceptor;
import org.infinispan.jmx.annotations.MBean;
...
...
MBean(objectName = "DistExec", description = "Distributed Execute Command details")
public class JMXDistributedCommandInterceptor extends
JmxStatsCommandInterceptor {
...
...
@Override
public Object visitDistributedExecuteCommand(InvocationContext ctx,
DistributedExecuteCommand<?> command) throws Throwable {
System.out.println("Started dist command " + command);
inProgress.put(command, Boolean.TRUE);
Object o = super.visitDistributedExecuteCommand(ctx, command);
System.out.println("completed dist command " + command);
inProgress.remove(command);
return o;
}
The interceptor got activated but it was not showing up as MBean in jconsole.
Upon looking into the source code, I found this is because infinispan scans for MBean annotations only at build time (and captures the information in: infinispan-core-component-metadata.dat, which is then used by at runtime by ComponentMetadataRepo
to actually determine which MBeans are manageable and should be registered with the MBean Server)
So the question is: Is there any way to build my own custom interceptor MBeans, that will automatically be picked up by infinispan and registered with the MBean Server, so it is visible with jconsole etc.
(I cannot use JmxUtil.registerMBean since the custom interceptor is actually instantiated by infinispan)
-
3. Re: Distributed Execution - monitoring/tracking tasks in the various nodes
jignaasa Apr 13, 2013 5:04 PM (in response to jignaasa)For the custom interceptor MBean, I was initially trying to mimic the built-in interceptor MBeans packaged with infinispan which did not work.
It works when my custom interceptor:
- extends org.infinispan.interceptors.base.BaseCustomInterceptor (as documented in the user guide.)
- Does not use the infinispan JMX annotations (Mbean etc.)
- implements an interface XXMXBean (follows the JMX MXBeans approach)
- Overrides the start and stop methods from BaseCustomInterceptor and manually registers and unregisters itself from the Mbean server in these methods
Minor caveats
- I cannot extend (and reuse) JmxStatsCommandInterceptor, but would instead have to implement: JmxStatisticsExposer. This is not such a big deal since JmxStatsCommandInterceptor does not have much code anyway.
- This interceptor MBean will be in a separate JMX domain from org.infinispan (where all the Cache Manager stuff is), which is probably how it should be, since it is custom interceptor and not part of org.infinispan
Thanks,
J