DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Multi-Node Distributed Execution Using Ignite and Dexecutor

A good introduction for Java Developers using Dexecutor — a fast, light, distributed independent task engine for running a cluster of Apache Ignite in-memory nodes on a single machine for massive parallelism.

Mohammad Nadeem user avatar by
Mohammad Nadeem
·
Oct. 11, 16 · Tutorial
Like (5)
Save
Tweet
Share
27.61K Views

Join the DZone community and get the full member experience.

Join For Free

Today, we will try to execute Dexecutor in a distributed mode using Apache Ignite. For the demo, we would be setting up multiple Ignite nodes on a single machine.

Refer to Introducing Dexecutor, to get an introduction on Dexecutor and to understand the problem we would solve in a distributed fashion. In short:

We would be distributing the execution of dexecutor tasks on Apache Ignite nodes in a single machine.

To do that, one of the nodes would act as the master and submit the tasks to Ignite to be executed by other Ignite compute nodes using Dexecutor.

Here are the steps to do that.

Step 1: Add Dexecutor-Ignite Dependency

<dependency>
     <groupId>com.github.dexecutor<groupId>
     <artifactId>dexecutor-ignite<artifactId>
     <version>LATEST_RELEASE<version>
<dependency>

Step 2: Start Ignite

IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setGridName(nodeName);

Ignite ignite = Ignition.start(cfg);

Step 3 : Create Dexecutor Using Ignite

if (isMaster) {
    DefaultDependentTasksExecutor<Integer, Integer> dexecutor = newTaskExecutor(ignite.compute());

    buildGraph(dexecutor);
    dexecutor.execute(ExecutionConfig.TERMINATING);
}
private DefaultDependentTasksExecutor<Integer, Integer> newTaskExecutor(final IgniteCompute igniteCompute) {
        DependentTasksExecutorConfig<Integer, Integer> config = new DependentTasksExecutorConfig<Integer, Integer>(
                new IgniteExecutionEngine<Integer, Integer>(igniteCompute), new SleepyTaskProvider());
        return new DefaultDependentTasksExecutor<Integer, Integer>(config);
}

Step 4: Execution

Open three terminals and execute the following :

Terminal #1

mvn test-compile exec:java -Djava.net.preferIPv4Stack=true -Dexec.mainClass="com.github.dexecutor.ignite.Node" -Dexec.classpathScope="test" -Dexec.args="s node-A"

Terminal #2

mvn test-compile exec:java -Djava.net.preferIPv4Stack=true -Dexec.mainClass="com.github.dexecutor.ignite.Node" -Dexec.classpathScope="test" -Dexec.args="s node-B"

Terminal #3

mvn test-compile exec:java  -Dexec.classpathScope="test" -Djava.net.preferIPv4Stack=true -Dexec.mainClass="com.github.dexecutor.ignite.Node" -Dexec.args="m node-C"

dexecutor-ignite-execution

Here is the Node Implementation.

References

  • Dexecutor
  • Dexecutor Website
  • Dexecutor Ignite
Execution (computing)

Published at DZone with permission of Mohammad Nadeem, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Using JSON Web Encryption (JWE)
  • Why Every Fintech Company Needs DevOps
  • Choosing the Best Cloud Provider for Hosting DevOps Tools
  • The Role of Data Governance in Data Strategy: Part II

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: