Skip to content

Repository files navigation

cluster-boost library examples

Version 1.1

Overview

Every example is a spring-boot application that starts Ignite cluster with one node. Every example shows one (or more) of the cluster-boost library features.

Structure

.
├--domain
├--TestAccessor.java
├--TestKey.java
├--TestRepository.java
├--TestValue.java ├--Application.java
├--ApplicationConfig.java
├--ClusterReadyConsumer.java

Features

  • Self-registered repositories
  • Cluster ready event

Code snippet

@RepositorypublicclassTestRepositoryextendsCommonRepository<TestKey, TestValue> {
}

Features

  • Run bean as a cluster task
  • Cluster ready event

Code snippet

if (cluster.isFirstNode()) {
Collection<Integer> results = cluster.runBean(RunnableBean.class, "<Test Argument>");
log.info("Cluster run result: {}", results);
}

Features

  • Chain running
  • Cluster ready event

Code snippet

Collection<ChainResult<String>> results = Chain.of(cluster)
.map(ChainBean1.class, "Chain argument") // Start chain with string argument
.filter(r -> r.getResult() == 1) // Continue chain only for odd nodes
.map(ChainBean2.class) // On even nodes create a string result
.run(); // Run chain steps

Features

  • Chain running with audit
  • Self-registered repositories
  • Cluster ready event

Code snippet

if (cluster.isFirstNode()) {
Collection<ChainResult<String>> results = Chain.of(cluster)
.track(trackingId) // Track all chain steps with trackingId
.map(ChainBean1.class, "Chain argument") // Start chain with string argument
.filter(r -> r.getResult() == 1) // Continue chain only for odd nodes
.map(ChainBean2.class) // On even nodes create a string result
.run(); // Run chain stepslog.info("Chain result: {}", results);
// Get audit items for tracking idList<AuditItem> auditItems = auditService.getItems(trackingId);
log.info("Audit items: {}", auditItems);
}

About

Examples for cluster-boost library

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages