| <!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>Apache Ignite Compute APIs - Data-Intensive Computing</title> |
| <meta name="description" content="Apache Ignite compute APIs allow you to perform computations at high speeds. Achieve high performance, low latency, and linear scalability in data-intensive computing." /> |
| <link rel="canonical" href="https://ignite.apache.org/features/compute-apis.html" /> |
| <meta property="og:title" content="Apache Ignite Compute APIs - Data-Intensive Computing" /> |
| <meta property="og:type" content="article" /> |
| <meta property="og:url" content="https://ignite.apache.org/features/compute-apis.html" /> |
| <meta property="og:image" content="/img/og-pic.png" /> |
| <meta property="og:description" content="Apache Ignite compute APIs allow you to perform computations at high speeds. Achieve high performance, low latency, and linear scalability in data-intensive computing." /> |
| <link rel="stylesheet" href="/js/vendor/hystmodal/hystmodal.min.css?ver=0.9" /> |
| <link rel="stylesheet" href="/css/utils.css?ver=0.9" /> |
| <link rel="stylesheet" href="/css/site.css?ver=0.9" /> |
| <link rel="stylesheet" href="../css/native-persistence.css?ver=0.9" /> |
| <link rel="stylesheet" href="../css/compute-apis.css?ver=0.9" /> |
| <link rel="stylesheet" href="../js/vendor/highlight/night-owl.css?ver=0.9" /> |
| <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> |
| <link rel="stylesheet" href="/css/media.css?ver=0.9" media="only screen and (max-width:1199px)" /> |
| <link rel="icon" type="image/png" href="/img/favicon.png" /> |
| <!-- Global site tag (gtag.js) - Google Analytics --> |
| <script async src="https://www.googletagmanager.com/gtag/js?id=UA-61232409-1"></script> |
| <script> |
| window.dataLayer = window.dataLayer || []; |
| function gtag() { |
| dataLayer.push(arguments); |
| } |
| gtag('js', new Date()); |
| gtag('config', 'UA-61232409-1'); |
| </script> |
| |
| <!-- Yandex.Metrika counter --> |
| <script type="text/javascript"> |
| (function (m, e, t, r, i, k, a) { |
| m[i] = |
| m[i] || |
| function () { |
| (m[i].a = m[i].a || []).push(arguments); |
| }; |
| m[i].l = 1 * new Date(); |
| (k = e.createElement(t)), (a = e.getElementsByTagName(t)[0]), (k.async = 1), (k.src = r), a.parentNode.insertBefore(k, a); |
| })(window, document, 'script', 'https://mc.yandex.ru/metrika/tag.js', 'ym'); |
| |
| ym(72949126, 'init', { |
| clickmap: true, |
| trackLinks: true, |
| accurateTrackBounce: true, |
| webvisor: true, |
| }); |
| </script> |
| <noscript |
| ><div><img src="https://mc.yandex.ru/watch/72949126" style="position: absolute; left: -9999px" alt="" /></div |
| ></noscript> |
| |
| <!-- /Yandex.Metrika counter --> |
| </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"> |
| <ul> |
| <li> |
| <a href="/docs/latest/">Quick Start</a> |
| </li> |
| <li> |
| <a href="/resources.html">Resources</a> |
| </li> |
| <li> |
| <a href="/faq.html">FAQ</a> |
| </li> |
| <li> |
| <span class="mobmenu__parent"> <a href="/use-cases.html">Use Cases</a><button class="mobmenu__opener"></button> </span> |
| <ul> |
| <li> |
| <a href="/use-cases/in-memory-cache.html">In-Memory Cache</a> |
| </li> |
| <li> |
| <a href="/use-cases/in-memory-data-grid.html">In-Memory Data Grid</a> |
| </li> |
| <li> |
| <a href="/use-cases/in-memory-database.html">In-Memory Database</a> |
| </li> |
| <li> |
| <a href="/use-cases/key-value-store.html">Key-Value Store</a> |
| </li> |
| <li> |
| <a href="/use-cases/high-performance-computing.html">High Performance Computing</a> |
| </li> |
| <li> |
| <a href="/use-cases/digital-integration-hub.html">Digital Integration Hub</a> |
| </li> |
| <li> |
| <a href="/use-cases/spark-acceleration.html">Spark Acceleration</a> |
| </li> |
| <li> |
| <a href="/use-cases/hadoop-acceleration.html">Hadoop Acceleration</a> |
| </li> |
| <li> |
| <a href="/use-cases.html">View All</a> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <span class="mobmenu__parent"> <a href="/features/">Features</a><button class="mobmenu__opener"></button> </span> |
| <ul> |
| <li> |
| <a href="/arch/multi-tier-storage.html">Multi-Tier Storage</a> |
| </li> |
| <li> |
| <a href="/arch/native-persistence.html">Native Persistence</a> |
| </li> |
| <li> |
| <a href="/features/sql.html">Distributed SQL</a> |
| </li> |
| <li> |
| <a href="/features/key-value-apis.html">Key-Value APIs</a> |
| </li> |
| <li> |
| <a href="/features/acid-transactions.html">ACID Transactions</a> |
| </li> |
| <li> |
| <a href="/features/compute-apis.html">Compute APIs</a> |
| </li> |
| <li> |
| <a href="/features/service-apis.html">Services</a> |
| </li> |
| <li> |
| <a href="/features/machinelearning.html">Machine Learning</a> |
| </li> |
| <li> |
| <a href="/features/streaming.html">Real-Time Streaming APIs</a> |
| </li> |
| <li> |
| <a href="/docs/latest/messaging">Messaging</a> |
| </li> |
| <li> |
| <a href="/docs/latest/key-value-api/continuous-queries">Continuous Queries</a> |
| </li> |
| <li> |
| <a href="/features/index.html">View All</a> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <a href="/community.html">Community</a> |
| <ul class="isdefault"> |
| <li><a href="/community.html">Project Info</a></li> |
| <li><a href="/events.html">Events</a></li> |
| </ul> |
| </li> |
| <li> |
| <a href="/use-cases/provenusecases.html">Powered by</a> |
| </li> |
| <li> |
| <a href="/docs/latest/">Docs</a> |
| </li> |
| </ul> |
| <a href="/download.cgi" class="button mobmenu__button">Download Ignite 2.11</a> |
| </div> |
| <!-- //mobmenu__menu --> |
| </div> |
| <!-- //mobmenu__wrap --> |
| </div> |
| <!-- //mobmenu --> |
| </div> |
| </div> |
| <!-- MOBILE MENU END --> |
| <header class="hdr hdr__blue jsHdrBase"> |
| <div class="hdr__wrap flexi jsHdrLine"> |
| <button class="hdr__burger" data-menumodal="#jsMenuModal"><img src="/img/menu.svg" alt="" /></button |
| ><a class="hdr__logo" href="/"><img class="hdr__logoimg hdr__logo--white" src="/img/logo-white.svg" alt="" /><img class="hdr__logoimg hdr__logo--black" src="/img/logo.svg" alt="" /></a |
| ><a class="button hdr__button" href="/download.cgi">Download Ignite 2.11.1</a> |
| <nav class="hdrmenu"> |
| <ul class="flexi"> |
| <li class="js-hasdrop"><a class="hdrmenu--expanded" href="/" data-panel="getStarted">Get Started</a></li> |
| <li class="js-hasdrop"><a class="hdrmenu__current hdrmenu--expanded" href="/features" data-panel="features">Features</a></li> |
| <li class="js-hasdrop"><a class="hdrmenu--expanded" href="/community.html" data-panel="community">Community</a></li> |
| <li><a href="/use-cases/provenusecases.html" data-panel="">Powered By</a></li> |
| <li><a href="///ignite.apache.org/docs/latest/" data-panel="">Docs</a></li> |
| </ul> |
| </nav> |
| <div class="dropmenu"> |
| <div class="dropmenu__panel" data-menupanel="getStarted"> |
| <div class="container dropmenu1__grid"> |
| <div class="dropmenu1__buttonwrap"> </div> |
| <div class="dropmenu__box dropmenu__box--buttonin"> |
| <a class="dropmenu__redbutton" href="https://ignite.apache.org/docs/latest/"> <img src="/img/menu/icon-red-rocket.svg" alt="" /><span>Quick Start Guide</span></a> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/resources.html"><img src="/img/menu/icon-resources.svg" alt="" /><span>Resources</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/faq.html"><img src="/img/menu/icon-question.svg" alt="" /><span>FAQ</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box"> |
| <p class="capstext"><a class="dropmenu__capslink" href="/use-cases.html">USE CASES</a></p> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/in-memory-cache.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>In-Memory Cache</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/in-memory-data-grid.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>In-Memory Data Grid</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/in-memory-database.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>In-Memory Database</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/key-value-store.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>Key-Value Store</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box no-border"> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/high-performance-computing.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>High-Performance Computing</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/digital-integration-hub.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>Digital Integration Hub</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/spark-acceleration.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>Spark Acceleration</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/use-cases/hadoop-acceleration.html"><img src="/img/menu/icon-folder.svg" alt="" /><span>Hadoop Acceleration</span></a> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- /.dropmenu1__grid--> |
| <div class="panelmorelinkwrap panelmorelinkwrap--end container"><a class="panellink" href="/use-cases.html">View all</a></div> |
| </div> |
| <!-- /.dropmenu__panel--> |
| <div class="dropmenu__panel" data-menupanel="features"> |
| <div class="container dropmenu2__grid"> |
| <div class="dropmenu__box"> |
| <div class="capstext">MULTI-TIER STORAGE</div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/arch/multi-tier-storage.html"><img src="/img/menu/icon-db.svg" alt="" /><span>Multi-Tier Storage</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/arch/native-persistence.html"><img src="/img/menu/icon-db.svg" alt="" /><span>Native Persistence</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box"> |
| <div class="capstext">ESSENTIAL Developer APIs</div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/features/sql.html"><img src="/img/menu/icon-cube.svg" alt="" /><span>Distributed SQL</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/features/key-value-apis.html"><img src="/img/menu/icon-cube.svg" alt="" /><span>Key-Value APIs</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/features/acid-transactions.html"><img src="/img/menu/icon-cube.svg" alt="" /><span>ACID Transactions</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box"> |
| <div class="capstext">High-Performance <br />Computing APIs</div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/features/compute-apis.html"><img src="/img/menu/icon-cube.svg" alt="" /><span>Compute APIs</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/features/service-apis.html"><img src="/img/menu/icon-cube.svg" alt="" /><span>Services</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/features/machinelearning.html"><img src="/img/menu/icon-cube.svg" alt="" /><span>Machine Learning</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box"> |
| <div class="capstext">Real-Streaming APIs</div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/features/streaming.html"><img src="/img/menu/icon-cube.svg" alt="" /><span>Real-Time Streaming APIs</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="https://ignite.apache.org/docs/latest/messaging"><img src="/img/menu/icon-cube.svg" alt="" /><span>Messaging</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="https://ignite.apache.org/docs/latest/key-value-api/continuous-queries"><img src="/img/menu/icon-cube.svg" alt="" /><span>Continuous Queries</span></a> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- /.dropmenu2__grid--> |
| <div class="panelmorelinkwrap"><a class="panellink" href="/features/">View all</a></div> |
| </div> |
| <!-- /.dropmenu__panel-2--> |
| <div class="dropmenu__panel" data-menupanel="community"> |
| <div class="container dropmenu3__grid"> |
| <div class="dropmenu__box"> |
| <div class="capstext"><a class="dropmenu__capslink" href="/community.html">Project Info</a></div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/community.html#story"><img src="/img/menu/icon-clip.svg" alt="" /><span>Apache Ignite Story</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/community.html#community"><img src="/img/menu/icon-comment.svg" alt="" /><span>Meet The Community</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box no-border"> |
| <div class="capstext"> </div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/community.html#contributing"><img src="/img/menu/icon-puzzle.svg" alt="" /><span>Start Contributing</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/community.html#faq"><img src="/img/menu/icon-question.svg" alt="" /><span>Ask Questions</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box"> |
| <div class="capstext"><a class="dropmenu__capslink" href="/events.html">Events</a></div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/events.html#summit"><img src="/img/menu/icon-calendar.svg" alt="" /><span>Apache Ignite Summit</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/events.html#meetups"><img src="/img/menu/icon-calendar.svg" alt="" /><span>Meetups</span></a> |
| </li> |
| </ul> |
| </div> |
| <div class="dropmenu__box no-border"> |
| <div class="capstext"> </div> |
| <ul class="dropmenu__menu"> |
| <li> |
| <a class="dropmenu__iconitem" href="/events.html#upcoming"><img src="/img/menu/icon-calendar.svg" alt="" /><span>Upcoming Events</span></a> |
| </li> |
| <li> |
| <a class="dropmenu__iconitem" href="/events.html#past"><img src="/img/menu/icon-calendar.svg" alt="" /><span>Past Events</span></a> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- /.dropmenu3__grid--> |
| </div> |
| <!-- /.dropmenu__panel--> |
| </div> |
| <!-- /.dropmeu--> |
| </div> |
| </header> |
| <div class="dropmenu__back"></div> |
| <header class="hdrfloat hdr__white jsHdrFloatBase"></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 Speed</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 logic</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 way |
| </h3> |
| <p class="compute2__text">Some computations might take minutes or hours to complete, e.g. <em> drug discovery or logistics simulations.</em></p> |
| <p class="compute2__text"> |
| You don't need to start 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"> |
| <h2 class="compute2__h2">Example Of Logic Building</h2> |
| <h3 class="compute3__h2 h4">Execute the logic in place and eliminate network impact on the performance of the calculation</h3> |
| <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 warning them 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 20 million records from a database to an application that executes some logic before finally sending a message to the residents.</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 the client-server approach, the company would read 20 million records from a database to an application that executes some logic before finally sending a message to the residents.</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<BinaryObject, BinaryObject> people = ignite.cache("Person").withKeepBinary(); |
| |
| |
| ScanQuery<BinaryObject, BinaryObject> query = new ScanQuery <BinaryObject, BinaryObject>(); |
| |
| try (QueryCursor<Cache.Entry<BinaryObject, BinaryObject>> cursor = people.query(query)) { |
| // Iteration over the local cluster node data using the scan query. |
| for (Cache.Entry<BinaryObject, BinaryObject> entry : cursor) { |
| BinaryObject personKey = entry.getKey(); |
| |
| // Pick NewYorkers only. |
| if (personKey.<Long>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"> |
| <div class="h4 nativebotblock__title"><img class="nativebotblock__icon" src="/img/features/native-rocket.svg" alt="" /><span>Ready to Start?</span></div> |
| <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"> |
| <div class="h4 nativebotblock__title"><img class="nativebotblock__icon" src="/img/features/native-docs.svg" alt="" /><span>Want to Learn More?</span></div> |
| <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="/use-cases/high-performance-computing.html" target="_blank">High-Performance Computing Use-Cases</a> |
| </article> |
| </div> |
| </section> |
| <footer class="footer"> |
| <div class="container footer__top"> |
| <section class="footer1"> |
| <a class="footer__title" href="/features/">Features</a> |
| <ul class="footer__menu"> |
| <li><a href="/arch/multi-tier-storage.html">Multi-Tier Storage</a></li> |
| <li><a href="/arch/native-persistence.html">Native Persistence</a></li> |
| <li><a href="/features/sql.html">Distributed SQL</a></li> |
| <li><a href="/features/acid-transactions.html">ACID Transactions</a></li> |
| <li><a href="/features/key-value-apis.html">Key Value APIs</a></li> |
| <li><a href="/features/compute-apis.html">Compute APIs</a></li> |
| <li><a href="/features/machinelearning.html">Machine Learning</a></li> |
| <li><a href="/features/service-apis.html">Services</a></li> |
| <li><a href="/features/streaming.html">Real-Streaming APIs</a></li> |
| <li><a href="https://ignite.apache.org/docs/latest/key-value-api/continuous-queries">Continuous Queries</a></li> |
| <li><a href="https://ignite.apache.org/docs/latest/messaging">Messaging</a></li> |
| </ul> |
| </section> |
| <section class="footer2"> |
| <a class="footer__title" href="/use-cases/">Use Cases</a> |
| <ul class="footer__menu"> |
| <li><a href="/use-cases/in-memory-cache.html">In-Memory Cache</a></li> |
| <li><a href="/use-cases/in-memory-data-grid.html">In-Memory Data Grid</a></li> |
| <li><a href="/use-cases/in-memory-database.html">In-Memory Database</a></li> |
| <li><a href="/use-cases/high-performance-computing.html">High-Performance Computing</a></li> |
| <li><a href="/use-cases/digital-integration-hub.html">Digital Integration Hub</a></li> |
| <li><a href="/use-cases/key-value-store.html">Key-Value Store</a></li> |
| <li><a href="/use-cases/spark-acceleration.html">Apache Spark Acceleration</a></li> |
| <li><a href="/use-cases/hadoop-acceleration.html">Apache Hadoop Acceleration</a></li> |
| </ul> |
| </section> |
| <section class="footer3"><a class="footer__title" href="/our-community.html">Community</a><a class="footer__title" href="/resources.html">Resources</a><a class="footer__title" href="/events.html">Events</a></section> |
| <section class="footer4"> |
| <div class="footer4__item">Join Our <a href="mailto:dev@ignite.apache.org">Dev Mailing List</a></div> |
| <div class="footer4__item pt-2">Or write your question</div> |
| <div class="footer4__item pt-1">user@ignite.apache.org</div> |
| <div class="footer4__item pt-5">Follow Us:</div> |
| <div class="footer4__socwrap flexi pt-2"> |
| <a class="footer4__soc" href="https://github.com/apache/ignite" target="_blank"><img src="/img/icon-github.svg" alt="" /></a |
| ><a class="footer4__soc" href="https://www.linkedin.com/showcase/apache-ignite/" target="_blank"><img src="/img/icon-linkedin.svg" alt="" /></a |
| ><a class="footer4__soc" href="https://twitter.com/apacheignite" target="_blank"><img src="/img/icon-twitter.svg" alt="" /></a |
| ><a class="footer4__soc" href="https://www.meetup.com/Apache-Ignite-Virtual-Meetup/" target="_blank"><img src="/img/icon-meetup-black.png" alt="" /></a> |
| </div> |
| <a class="footer4__button button" href="https://ignite.apache.org/docs/latest/index">Start Using Apache Ignite </a> |
| </section> |
| </div> |
| <div class="container footer__bot"> |
| <p>© 2015 - 2021 <a href="http://www.apache.org/">The Apache Software Foundation.</a></p> |
| <p class="pt-1x">Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation</p> |
| <p class="pt-1x"><a href="http://apache.org/foundation/policies/privacy.html">Privacy Policy</a></p> |
| </div> |
| </footer> |
| <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/smoothscroll.js"></script> |
| <script src="/js/main.js?ver=0.9"></script> |
| </body> |
| </html> |