adequate
adequate
adequate
adequate
 

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   Forums 
July 27, 2017, 10:42:54 PM *
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  
Pages: [1]   Go Down

Author Topic: Embedded client, driver and node  (Read 83 times)

arefaydi

  • JPPF Padawan
  • *
  • Posts: 14
Embedded client, driver and node
« on: June 14, 2017, 09:42:25 AM »

Hi,
Is it possible to create and use drivers and nodes programatically without starting external jars. It can be done for the client (
Code: [Select]
JPPFClient jppfClient = new JPPFClient();), i want to know if same usage is possible for drivers and nodes now or for future. In fact, my main objective is embedding client, driver and node in my applicaton and setup a topology which rebust againts driver and node failover (probably with p2p topology)
« Last Edit: June 14, 2017, 12:58:59 PM by arefaydi »
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Embedded client, driver and node
« Reply #1 on: June 15, 2017, 07:51:05 AM »

Hello,

You can start a driver programmatically like this:

Code: [Select]
JPPFDriver.main("noLauncher");
You will find a more complete code sample in this forum post (see the attched Java file).
Keep in mind that the JPPFClient will still connect to the driver via a network connection, just as if the client and driver were in separate processes. Also, since the driver is a singleton, you are limited to one driver per JVM.

The only way to also have an embedded node is to configure a local node in the configuration (i.e. "jppf.local.node.enabled = true"). Please don't forget to apply the patch 01 for JPPF 5.2.7. As for an embedded driver, you are limited to one local node per JVM. However, you can always start additional nodes (in separate processes on the same machine) using the node provisioning facility.

I hope this clairifies,
-Laurent
Logged

arefaydi

  • JPPF Padawan
  • *
  • Posts: 14
Re: Embedded client, driver and node
« Reply #2 on: June 16, 2017, 01:23:30 PM »

One driver and one node per jvm exactly what I want, and after applying  patch, it worked. Although driver generaly choose his local node while distributing tasks, I think i can fix with algorithm settings, thanks.
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Embedded client, driver and node
« Reply #3 on: June 17, 2017, 09:12:19 PM »

Hello,

The server code has an explicit bias towards serving the local node first if it is eligble, as can be seen in this part of the code. This bias applies no matter what the load-balancer settings are. What I can propose is to make it optional, using a driver configuration property like "jppf.local.node.bias = false" (with a default of 'true' so as not to break backward compatibility). Would this work for you? I could add this change to the existing patch and you would just have to re-apply it.

-Laurent
Logged

arefaydi

  • JPPF Padawan
  • *
  • Posts: 14
Re: Embedded client, driver and node
« Reply #4 on: June 19, 2017, 10:39:33 AM »

Hello,
Yes, please add this to the patch.
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Embedded client, driver and node
« Reply #5 on: June 20, 2017, 07:17:46 AM »

Hello,

I have added the enhancement JPPF-505 Ability to disable the bias towards local node in the driver to the patch 01 for JPPF 5.2.7. Please feel free to download it and let us know if it works for you.

Sincerely,
-Laurent
Logged

arefaydi

  • JPPF Padawan
  • *
  • Posts: 14
Re: Embedded client, driver and node
« Reply #6 on: June 20, 2017, 01:58:42 PM »

It worked! Thanks again for quick response and quick solution.
Logged
Pages: [1]   Go Up
 
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