blob: 7cea957b6b05f82b6e868ba18a63d5d294867b5e [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1" />
<title>Compute APIs | Apache Ignite</title>
<link rel="stylesheet" href="/js/vendor/hystmodal/hystmodal.min.css" />
<link rel="stylesheet" href="/js/vendor/swiper/swiper-bundle.min.css" />
<link rel="stylesheet" href="/css/utils.css" />
<link rel="stylesheet" href="/css/site.css" />
<link rel="stylesheet" href="/css/media.css" media="only screen and (max-width:1199px)" />
<link rel="icon" type="image/png" href="/img/favicon.png" />
<link rel="stylesheet" href="../css/native-persistence.css" />
<link rel="stylesheet" href="../css/compute-apis.css" />
<link rel="stylesheet" href="../js/vendor/highlight/night-owl.css" />
<script src="../js/vendor/highlight/highlight.min.js"></script>
<script src="../js/vendor/highlight/java.min.js"></script>
<script src="../js/vendor/highlight/xml.min.js"></script>
<script src="../js/vendor/highlight/csharp.min.js"></script>
</head>
<body>
<!-- MOBILE MENU START -->
<div class="hystmodal" id="jsMenuModal" aria-hidden="true">
<div class="hystmodal__wrap">
<div class="hystmodal__window mobmenu" role="dialog" aria-modal="true">
<button data-hystclose class="hystmodal__close">Close</button>
<div class="mobmenu__wrap">
<a href="/" class="mobmenu__logo"><img src="/img/logo.svg" alt="Логотип" /></a>
<div class="mobmenu__menu">
<div class="mobmenu__h1 berlin">Navigation</div>
<ul>
<li>
<a href="/">Get started</a>
</li>
<li>
<a href="/features/">Features</a>
</li>
<li>
<a href="/community.html">Community</a>
</li>
<li>
<a href="/use-cases/provenusecases.html">Powered by</a>
</li>
<li>
<a href="https://ignite.apache.org/docs/latest/">Docs</a>
</li>
</ul>
</div>
<!-- //mobmenu__menu -->
</div>
<!-- //mobmenu__wrap -->
</div>
<!-- //mobmenu -->
</div>
</div>
<!-- MOBILE MENU END -->
<header class="hdr hdr__blue">
<div class="cmtyhero__wrap flexi">
<button class="hdr__burger" data-menumodal="#jsMenuModal"><img src="/img/menu.svg" alt="" /></button><a class="hdr__logo" href="/"><img class="hdr__logoimg" src="/img/logo-white.svg" alt="" /></a
><a class="button hdr__button" href="/download.html">Download Ignite 2.11 </a>
<nav class="hdrmenu">
<ul class="flexi">
<li><a href="/">Get started</a></li>
<li><a class="hdrmenu__current" href="/features">Features</a></li>
<li><a href="/community.html">Community</a></li>
<li><a href="/use-cases/provenusecases.html">Powered by</a></li>
<li><a href="///ignite.apache.org/docs/latest/">Docs</a></li>
</ul>
</nav>
</div>
</header>
<header class="hdrfloat">
<div class="cmtyhero__wrap flexi">
<button class="hdr__burger" data-menumodal="#jsMenuModal"><img src="/img/menu.svg" alt="" /></button><a class="hdr__logo" href="/"><img class="hdr__logoimg" src="/img/logo.svg" alt="" /></a
><a class="button hdr__button" href="/download.html">Download Ignite 2.11 </a>
<nav class="hdrmenu">
<ul class="flexi">
<li><a href="/">Get started</a></li>
<li><a class="hdrmenu__current" href="/features">Features</a></li>
<li><a href="/community.html">Community</a></li>
<li><a href="/use-cases/provenusecases.html">Powered by</a></li>
<li><a href="/docs.html">Docs</a></li>
</ul>
</nav>
</div>
</header>
<section class="innerhero">
<div class="container innerhero__cont">
<div class="innerhero__main">
<div class="innerhero__pre pb-3">Apache Ignite</div>
<h1 class="h1 innerhero__h1">Compute APIs</h1>
<div class="innerhero__descr pt-2 h5">
Develop custom tasks in contemporary languages<br />
and get the logic executed over a distributed cluster
</div>
<div class="innerhero__action"><a class="button innerhero__button" href="https://ignite.apache.org/docs/latest/index">Start Coding</a></div>
</div>
<img class="innerhero__pic innerhero__pic--computeapis" src="/img/features/compute-apis/compute-hero.svg" alt="Distributed In-Memory Cache" />
</div>
</section>
<!-- /.innerhero-->
<section class="compute1 container">
<h2 class="compute1__h2 h4">Execute Data-Intensive And Compute-Intensive Tasks At High Speeds</h2>
<div class="compute1__deskr">Get an order-of-magnitude performance increase for custom complex logic:</div>
<div class="compute1__block flexi">
<div class="compute1__item">
<img class="compute1__icon" src="/img/features/compute-apis/icon-one.svg" alt="" />
<p class="compute1__text">
By minimizing or avoiding network<br />
utilization
</p>
</div>
<div class="compute1__item">
<img class="compute1__icon" src="/img/features/compute-apis/icon-two.svg" alt="" />
<p class="compute1__text">By executing the logic straight on the <br />cluster nodes</p>
</div>
</div>
</section>
<!-- /.compute1-->
<section class="compute2">
<div class="container">
<h2 class="compute2__h2">Benefits Of Apache Ignite Compute APIs</h2>
<div class="compute2__grid">
<div class="compute2item">
<div class="compute2-points__item fz20"></div>
<div class="compute2item__block">
<h3 class="fz20 compute2item__title">
Broadcast or execute<br />
on specific nodes
</h3>
<p class="compute2__text">
– Broadcast your tasks to use all<br />
the CPUs of your distributed cluster.
</p>
<p class="compute2__text">
– Or schedule the tasks for execution on a subset of the nodes based<br />
on custom criteria
</p>
</div>
</div>
<div class="compute2item">
<div class="compute2-points__item fz20"></div>
<div class="compute2item__block">
<h3 class="fz20 compute2item__title">Load balance your querie</h3>
<p class="compute2__text">If some of the nodes are overutilized, Ignite can automatically load-balance your computations to other nodes.</p>
<p class="compute2__text">
There are three ways to enable that:<br />
– Round-robin load balancing <br />– Random and weighted load balancing<br />
– Job stealing.
</p>
</div>
</div>
<div class="compute2item">
<div class="compute2-points__item fz20"></div>
<div class="compute2item__block">
<h3 class="fz20 compute2item__title">
Execute computations<br />
in a fault-tolerant fashion
</h3>
<p class="compute2__text">Some computations might take minutes or hours to complete, e.g. <em> drugs discovery or logistics simulations.</em></p>
<p class="compute2__text">
You don't need to begin from scratch if the execution fails in the middle. Restart a calculation from the point<br />
of failure.
</p>
</div>
</div>
</div>
</div>
</section>
<!-- /.compute2-->
<section class="nativecode container jsTabWrap">
<header class="blockheader blockheader--spl flexi">
<h2 class="h4 blockheader__left">
Forget about PLSQL, use<br />
the language you code with daily
</h2>
<div class="blockheader__right fz20">
<p>
Create tasks in the language of your choice. You don’t need<br />
to learn PLSQL any more.
</p>
</div>
</header>
<div class="nativecode__tabctrls flexi">
<a class="nativecode__link active" href="#" data-tablink="nativeTabJava">Java</a><a class="nativecode__link" href="#" data-tablink="nativeTabNET">C#/.NET</a><a class="nativecode__link" href="#" data-tablink="nativeTabCpp">C++</a>
</div>
<div class="nativecode__tabs">
<div class="nativecode__tab active" data-tab="nativeTabJava">
<pre class="nativecode__codebox"> <code class="java">// Broadcast the task to server nodes only.
IgniteCompute compute = ignite.compute(ignite.cluster().forServers());
// Each remote server node will execute the logic of the task/lambda below.
compute.broadcast(() -> System.out.println(
"Hello Node: " + ignite.cluster().localNode().id()));
</code></pre>
</div>
<div class="nativecode__tab" data-tab="nativeTabNET">
<pre class="nativecode__codebox"> <code class="csharp">// Broadcast the task to server nodes only.
var compute = ignite.GetCluster().ForServers().GetCompute();
// Each remote server node will execute the custom PrintNodeIdAction task.
compute.Broadcast(new PrintNodeIdAction());</code></pre>
</div>
<div class="nativecode__tab" data-tab="nativeTabCpp">
<pre class="nativecode__codebox"> <code class="java"> // Broadcast the task to server nodes only.
IgniteCompute compute = ignite.compute(ignite.cluster().forServers());
// Each remote server node will execute the logic of the task/lambda below.
compute.broadcast(() -> System.out.println(
"Hello Node: " + ignite.cluster().localNode().id()));</code></pre>
</div>
</div>
</section>
<!-- /.nativecode-->
<section class="compute3 container">
<h3 class="compute2__h2">Example Of Logic Building</h3>
<h2 class="compute3__h2 h4">Execute the logic in place and eliminate network impact on the performance of the calculation</h2>
<p class="compute3__text">Imagine that a winter storm is about to hit a highly-populated city. As a telecommunication company, you have to send a text message to 20 million residents notifying about the blizzard.</p>
<div class="compute4 flexi">
<div class="compute4__block compute4__block--bad">
<img class="compute4__icon" src="/img/features/icon-check-err.svg" alt="" />
<p class="pt-3">With the client-server approach, the company would read all 20 million records from a database to an application that needs to execute some logic and send a message to the residents eventually.</p>
</div>
<div class="compute4__block">
<img class="compute4__icon" src="/img/features/icon-check-ok.svg" alt="" />
<p class="pt-3">A much more efficient approach would be to broadcast this logic to the cluster nodes that keep data about the city's residents. The logic gets executed on those nodes only and text messages are sent from there.</p>
<p class="pt-3">With this technique, instead of pulling 20 million records via the network, you execute the logic in place and eliminate the network impact on the performance of the calculation.</p>
</div>
</div>
<div class="jsTabWrap">
<header class="blockheader blockheader--spl flexi"></header>
<div class="nativecode__tabs">
<div class="nativecode__tab active" data-tab="nativeTabJava">
<pre class="nativecode__codebox"> <code class="java">Ignite ignite = ...
// NewYork ID.
long newYorkId = 2;
// Send the logic to the cluster node that stores NewYork and all its inhabitants.
ignite.compute().affinityRun("City", newYorkId, new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
// Get access to the Person cache.
IgniteCache&#60;BinaryObject, BinaryObject&#62; people = ignite.cache("Person").withKeepBinary();
ScanQuery&#60;BinaryObject, BinaryObject&#62; query = new ScanQuery &#60;BinaryObject, BinaryObject&#62;();
try (QueryCursor&#60;Cache.Entry&#60;BinaryObject, BinaryObject&#62;&#62; cursor = people.query(query)) {
// Iteration over the local cluster node data using the scan query.
for (Cache.Entry&#60;BinaryObject, BinaryObject&#62; entry : cursor) {
BinaryObject personKey = entry.getKey();
// Pick NewYorkers only.
if (personKey.&#60;Long&#62;field("CITY_ID") == newYorkId) {
person = entry.getValue();
// Send the warning message to the person.
}
}
}
}
}</code></pre>
</div>
</div>
</div>
</section>
<!-- /.compute4 -->
<section class="native-bottom container">
<div class="native-bottom__grid">
<article class="nativebotblock">
<h3 class="h4 nativebotblock__title"><img class="nativebotblock__icon" src="/img/features/native-rocket.svg" alt="" /><span>Ready to Start?</span></h3>
<p class="nativebotblock__text">Start coding distributed computing APIs</p>
<a class="nativebotblock__link arrowlink" href="https://ignite.apache.org/docs/latest/key-value-api/transactions" target="_blank">Performing Distributed Computing </a>
</article>
<article class="nativebotblock nativebotblock--learn">
<h3 class="h4 nativebotblock__title"><img class="nativebotblock__icon" src="/img/features/native-docs.svg" alt="" /><span>Want to Learn More?</span></h3>
<p class="nativebotblock__text">Learn more about high-performance computing use cases and see how it works in practice</p>
<a class="nativebotblock__link arrowlink" href="https://ignite.apache.org/use-cases/high-performance-computing.html" target="_blank">High-Performance Computing Use-Cases</a>
</article>
</div>
</section>
<a class="scrollTop" href="#"
><svg class="feather feather-chevron-up" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="18 15 12 9 6 15"></polyline></svg
></a>
<script src="/js/vendor/hystmodal/hystmodal.min.js"></script>
<script src="/js/vendor/swiper/swiper-bundle.min.js"></script>
<script src="/js/vendor/waypoints.min.js"></script>
<script src="/js/main.js"></script>
</body>
</html>