JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   On Github   Forums 
June 13, 2021, 04:55:15 AM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  

Recent Posts

Pages: [1] 2 3 ... 10
1
Troubleshooting / Re: [TOPOLOGY MANAGER DID NOT WROK]
« Last post by hoho23 on May 21, 2021, 05:31:22 PM »
Thank you, it works now,
 just a clarification, the code below did not put the execution runtime on sleep mode
Code: [Select]
Thread.sleep(5000L);Instead, I've used this code for the delay of 5 seconds
Code: [Select]
TimeUnit.SECONDS.sleep(5);
2
Troubleshooting / Re: [TOPOLOGY MANAGER DID NOT WROK]
« Last post by lolo on May 21, 2021, 08:56:48 AM »
Hello,

I believe that your code is not waiting long enough for the TopologyManager to collect the information about the topology.
As an experiment, could you insert a Thread.sleep(5000L); statement just before manager.getNodes()?
I'm hoping that it will show more than 0 node this way, because it will give the JPPFClient enough time to connect and the TopologyManager enough time to fetch the information.

You may also consider using asynchronous notifications of changes in the topology.

Sincerely,
-Laurent
3
Troubleshooting / [TOPOLOGY MANAGER DID NOT WROK]
« Last post by hoho23 on May 19, 2021, 03:35:13 PM »
Hello JPPF Community,

I am working on a project that needs to know every node's IP address before executing a specific job. For that, I've used the TopologyManager class then I tried to get the nodes information but it didn't work, I've even tried to get the number of nodes present on the network, but the result is always zero although I have two nodes running on the network.
Here is the code example to get a clear idea about the problem :
Code: [Select]
JPPFClient jppfClient = getConfiguredJPPFClient(null,"");
// Get connected Nodes begin
System.err.println("############ BEGIN NODE DISCOVERY ############");
TopologyManager manager = new TopologyManager(jppfClient);
List<TopologyNode> nodeList = manager.getNodes();
for (TopologyNode node : nodeList) {
System.err.println(node.getManagementInfo().toDisplayString());
}
System.err.println(manager.getNodeCount());
manager.close();
System.err.println("############ END NODE DISCOVERY ############");
// Get connected Nodes end
P.S: the method getConfiguredJPPFClient(null,"") returns a JPPFClient object, and this jppfClient is used to create the TopologyManager.
Actually I try to get informations, precisely ip address, of every node present on the network containing this jppfClient.
Below the result of the execution although I have two connected nodes.
Code: [Select]
############ BEGIN NODE DISCOVERY ############
0
############ END NODE DISCOVERY ############
4
Developers help / Re: METADATA PARAMETER OBJECT
« Last post by hoho23 on April 08, 2021, 09:47:33 AM »
The problem is solved  :)
Actually, it was a dependency issue and now it works well.
Thank you for your help and explanation Mr. Laurent !
5
Developers help / Re: METADATA PARAMETER OBJECT
« Last post by hoho23 on April 01, 2021, 11:50:24 AM »
I tried to replace my code snippet with the code you sent below, but it still not working.
Code: [Select]
Runnable runnable = (Serializable & Runnable) () -> System.err.println(" I am the runnable! ");I have always the same problem!
I also tried to copy the jar file of the external lib I am using (the one that contains the SerializableRunnable) in the lib directory of the driver and the problem always exists.
tell me if you need any additional information that can help to solve this problem, and I am really grateful for your help!

regards,
hoho23
6
Developers help / Re: METADATA PARAMETER OBJECT
« Last post by lolo on April 01, 2021, 06:15:38 AM »
Hello,

Thank you for the vital information you provided. I believe this is a class loading issue with regards to your NodeLifeCycleListener. By design, in the jobHeaderLoaded() method, the class loader used does not have access to the classes in the classpath of the JPPF client. It can only access classes in the driver's or node's classpath. Here, you're using a SerializableRunnable, which is not part of the JPPF API, and thus is probably only in tour client classpath. In the log of the node where it happens, you should see a ClassNotFoundException, can you check this?

Also, as an experiment, could you try not using SerializableRunnable and instead use the following lambda construct, which only refers to JDK interfaces:
Code: [Select]
Runnable runnable = (Serializable & Runnable) () -> System.err.println(" I am the runnable! ");
Could you please try that and let us know if this works?

Sincerely,
-Laurent
7
Developers help / Re: METADATA PARAMETER OBJECT
« Last post by hoho23 on March 31, 2021, 12:00:34 PM »
Yes, it's serializable. I'am using a SerializableRunnable object, Here is the code:
Code: [Select]
JPPFJob jppfJob = new JPPFJob();
JobMetadata metadata = jppfJob.getMetadata();
metadata.setParameter(1, "hey");
SerializableRunnable runnable =()-> {
System.err.println(" I am the runnable! ");
};
metadata.setParameter(2, runnable);
8
Developers help / Re: METADATA PARAMETER OBJECT
« Last post by lolo on March 31, 2021, 05:15:07 AM »
Hello,

Did you ensure that your Runnable object is also Serializable? If not, this could explain the disconnection problem when you submit the job.

I hope this helps,
-Laurent
9
Developers help / METADATA PARAMETER OBJECT
« Last post by hoho23 on March 29, 2021, 12:04:24 PM »
Hello JPPF Community,

I am working on a project that needs to execute specific code snippet before executing some jobs, the code snippet to execute depends on the job metadata. For that, I am using a NodeLifeCycleListenerAdapater, then overriding the jobHeadLoaded(final NodeLifeCycleEvent event) method, on which I try to get the metadata parameter which is a Runnable object that contains the code to execute. Unfortunately, the connection I lose the connection to the class server and the task server. I think the problem is caused by passing a runnable object as a parameter through the job metadata, since it works with other types of object such as String object. I need your help to know if there is a method to pass a runnable as a parameter on the job metadata, or if there is another option to do it using some jppf tools.
Below the error code I get, it would be helpful.
Code: [Select]
2021-03-26 11:43:51,425 - [ForkJoinPool.commonPool-worker-3] - INFO  - org.my.package.Main - Do JPPF distributed task
[client: jppf_discovery-1-1 - ClassServer] Attempting connection to the class server at address:port
[client: jppf_discovery-1-1 - ClassServer] Reconnected to the class server
[client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at address:port
[client: jppf_discovery-1-1 - TasksServer] Reconnected to the JPPF task server
[client: jppf_discovery-1-1 - ClassServer] Attempting connection to the class server at address:port
[client: jppf_discovery-1-1 - ClassServer] Reconnected to the class server
[client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at address:port
[client: jppf_discovery-1-1 - TasksServer] Reconnected to the JPPF task server

Thank you,
hoho23
10
Developers help / Re: [HELP-JPPF EXECUTION ORDER]
« Last post by hoho23 on March 26, 2021, 10:27:28 AM »
Thank you for your help!
I think the best method is to use NodeLifeCycleListenerAdapter and override the method jobHeaderLoaded() in which I will retrieve a runnable object passed into metadata, then all I need to do is to run that runnable object.
THE PROBLEM HERE IS  that I could not pass a runnable object as metadata parameter, with the method :
Code: [Select]
metadata.setParameter("code1", runnable);I didn't get any error message neither from the client console nor from the node console. I tried to pass other objects into the metadata parameter and it worked, but for the runnable object I didn't get anything and the program blocked. After that, the connection to the class server and task server is lost.
Here is the only thing I get from the client console:
Code: [Select]
2021-03-26 11:43:51,425 - [ForkJoinPool.commonPool-worker-3] - INFO  - org.my.package.Main - Do JPPF distributed task
[client: jppf_discovery-1-1 - ClassServer] Attempting connection to the class server at address:port
[client: jppf_discovery-1-1 - ClassServer] Reconnected to the class server
[client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at address:port
[client: jppf_discovery-1-1 - TasksServer] Reconnected to the JPPF task server
[client: jppf_discovery-1-1 - ClassServer] Attempting connection to the class server at address:port
[client: jppf_discovery-1-1 - ClassServer] Reconnected to the class server
[client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at address:port
[client: jppf_discovery-1-1 - TasksServer] Reconnected to the JPPF task server

Help!
hoho23
Pages: [1] 2 3 ... 10
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads