blob: 3bcc96002cb6bac07239fc271c1ae38a2214bdac [file] [log] [blame]
<!--
▄▄▄ ██▓███ ▄▄▄ ▄████▄ ██░ ██ ▓█████ ██▓ ▄████ ███▄ █ ██▓▄▄▄█████▓▓█████
▒████▄ ▓██░ ██▒▒████▄ ▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▓██▒ ██▒ ▀█▒ ██ ▀█ █ ▓██▒▓ ██▒ ▓▒▓█ ▀
▒██ ▀█▄ ▓██░ ██▓▒▒██ ▀█▄ ▒▓█ ▄ ▒██▀▀██░▒███ ▒██▒▒██░▄▄▄░▓██ ▀█ ██▒▒██▒▒ ▓██░ ▒░▒███
░██▄▄▄▄██ ▒██▄█▓▒ ▒░██▄▄▄▄██ ▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ░██░░▓█ ██▓▓██▒ ▐▌██▒░██░░ ▓██▓ ░ ▒▓█ ▄
▓█ ▓██▒▒██▒ ░ ░ ▓█ ▓██▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒ ░██░░▒▓███▀▒▒██░ ▓██░░██░ ▒██▒ ░ ░▒████▒
▒▒ ▓▒█░▒▓▒░ ░ ░ ▒▒ ▓▒█░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░ ░▓ ░▒ ▒ ░ ▒░ ▒ ▒ ░▓ ▒ ░░ ░░ ▒░ ░
▒ ▒▒ ░░▒ ░ ▒ ▒▒ ░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒░ ▒ ░ ░ ░ ░ ░
░ ▒ ░░ ░ ▒ ░ ░ ░░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
-->
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="https://ignite.apache.org/features/java.html" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>Java Powered - Apache Ignite</title>
<link media="all" rel="stylesheet" href="/css/all.css?v=1514336027">
<link href="https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
<!--#include virtual="/includes/sh.html" -->
</head>
<body>
<div id="wrapper">
<!--#include virtual="/includes/header.html" -->
<main id="main" role="main" class="container">
<section id="java" class="page-section">
<h1 class="first">Powered by Java</h1>
<div class="col-sm-12 col-md-12 col-xs-12" style="padding:0 0 20px 0;">
<div class="col-sm-6 col-md-8 col-xs-12" style="padding-left:0; padding-right:0">
<p>
Ignite In-Memory Data Fabric is developed predominantly in Java, and provides native support for other languages.
It is designed to deliver uncompromised performance for a wide set of in-memory computing use cases -
from high performance computing, to the industry most advanced data grid, CEP, and data streaming.
</p>
<p>
Ignite data grid is an <b>in-memory key-value store</b> which enables caching data in-memory within distributed clusters. It supports
<span style="white-space: nowrap"><a href="https://apacheignite.readme.io/docs/transactions" target="_blank">ACID Transactions</a></span>,
<a href="https://apacheignite-sql.readme.io/docs/overview" target="_blank">SQL Queries</a>,
<a href="https://apacheignite-sql.readme.io/docs/distributed-joins" target="_blank">Distributed SQL Joins</a>,
<a href="https://apacheignite.readme.io/docs/messaging" target="_blank">Messaging</a> and <a href="https://apacheignite.readme.io/docs/events" target="_blank">Events</a>,
<a href="https://apacheignite.readme.io/docs/streaming--cep" target="_blank">Data Streaming</a>, and more.
</p>
<p>
Ignite also supports <a href="https://apacheignite.readme.io/docs/binary-marshaller" target="_blank">Cross-platform Interoperability</a>
by writing objects to cache in a common binary format allowing application to seamlessly interoperate between <b>Java</b>, <b>.NET</b> and <b>C++</b>.
</p>
</div>
<div class="col-sm-6 col-md-4 col-xs-12" style="padding-right:0">
<img class="img-responsive" src="/images/java.png" width="300" style="float:right;"/>
</div>
</div>
<div class="code-examples">
<div class="page-heading">Code Examples:</div>
<!-- Nav tabs -->
<ul id="messaging-examples" class="nav nav-tabs">
<li class="active"><a href="#put-get" aria-controls="home" data-toggle="tab">Put and Get</a></li>
<li><a href="#transactions" aria-controls="profile" data-toggle="tab">Transactions</a></li>
<li><a href="#sql-query" aria-controls="profile" data-toggle="tab">SQL Query</a></li>
<li><a href="#sql-join" aria-controls="profile" data-toggle="tab">SQL Join</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="put-get">
<pre class="brush:java">
Ignite ignite = Ignition.ignite();
IgniteCache&lt;Integer, String&gt; cache = ignite.cache(CACHE_NAME);
// Store keys in cache (values will end up on different cache nodes).
for (int i = 0; i &lt; 10; i++)
cache.put(i, Integer.toString(i));
for (int i = 0; i &lt; 10; i++)
System.out.println("Got [key=" + i + ", val=" + cache.get(i) + ']');
</pre>
</div>
<div class="tab-pane" id="transactions">
<pre class="brush:java">
try (Transaction tx = transactions.txStart()) {
Integer hello = cache.get("Hello");
if (hello == 1)
cache.put("Hello", 11);
cache.put("World", 22);
tx.commit();
}
</pre>
</div>
<div class="tab-pane" id="sql-query">
<pre class="brush:java">
IgniteCache&lt;Long, Person&gt; cache = ignite.cache("personCache");
SqlQuery sql = new SqlQuery(Person.class, "salary > ?");
// Find persons earning more than 1,000.
try (QueryCursor&lt;Entry&lt;Long, Person&gt;&gt; cursor = cache.query(sql.setArgs(1000))) {
for (Entry&lt;Long, Person&gt; e : cursor)
System.out.println(e.getValue().toString());
}
</pre>
</div>
<div class="tab-pane" id="sql-join">
<pre class="brush:java">
IgniteCache&lt;Long, Person&gt; cache = ignite.cache("personCache");
// SQL join on Person and Organization.
SqlQuery sql = new SqlQuery(Person.class,
"from Person as p, \"orgCache\".Organization as org "
+ "where p.orgId = org.id "
+ "and lower(org.name) = lower(?)");
// Find all persons working for Ignite organization.
try (QueryCursor&lt;Entry&lt;Long, Person&gt;&gt; cursor = cache.query(sql.setArgs("Ignite"))) {
for (Entry&lt;Long, Person&gt; e : cursor)
System.out.println(e.getValue().toString());
}
</pre>
</div>
</div>
</div>
<div class="page-heading">GitHub Examples:</div>
<p>
Also see <a href="https://github.com/apache/ignite/tree/master/examples" target="github">Ignite Java examples</a>
available on GitHub.
</p>
<p>
<a href="https://apacheignite.readme.io/docs/getting-started" target="_blank">
<b>Get started with Ignite Java <i class="fa fa-angle-double-right"></i></b>
</a>
</p>
</section>
</main>
<!--#include virtual="/includes/footer.html" -->
</div>
<!--#include virtual="/includes/scripts.html" -->
</body>
</html>