| <!-- |
| ▄▄▄ ██▓███ ▄▄▄ ▄████▄ ██░ ██ ▓█████ ██▓ ▄████ ███▄ █ ██▓▄▄▄█████▓▓█████ |
| ▒████▄ ▓██░ ██▒▒████▄ ▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▓██▒ ██▒ ▀█▒ ██ ▀█ █ ▓██▒▓ ██▒ ▓▒▓█ ▀ |
| ▒██ ▀█▄ ▓██░ ██▓▒▒██ ▀█▄ ▒▓█ ▄ ▒██▀▀██░▒███ ▒██▒▒██░▄▄▄░▓██ ▀█ ██▒▒██▒▒ ▓██░ ▒░▒███ |
| ░██▄▄▄▄██ ▒██▄█▓▒ ▒░██▄▄▄▄██ ▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ░██░░▓█ ██▓▓██▒ ▐▌██▒░██░░ ▓██▓ ░ ▒▓█ ▄ |
| ▓█ ▓██▒▒██▒ ░ ░ ▓█ ▓██▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒ ░██░░▒▓███▀▒▒██░ ▓██░░██░ ▒██▒ ░ ░▒████▒ |
| ▒▒ ▓▒█░▒▓▒░ ░ ░ ▒▒ ▓▒█░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░ ░▓ ░▒ ▒ ░ ▒░ ▒ ▒ ░▓ ▒ ░░ ░░ ▒░ ░ |
| ▒ ▒▒ ░░▒ ░ ▒ ▒▒ ░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒░ ▒ ░ ░ ░ ░ ░ |
| ░ ▒ ░░ ░ ▒ ░ ░ ░░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ |
| ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ |
| --> |
| |
| <!-- |
| 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/servicegrid.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>Distributed Service Grid - Apache Ignite</title> |
| <link media="all" rel="stylesheet" href="/css/all.css?v=1514336028"> |
| <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="servicegrid" class="page-section"> |
| <h1 class="first">Deploy User-Defined Services</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-6 col-xs-12" style="padding-left:0; padding-right:0"> |
| <p> |
| Ignite Service Grid allows for deployments of arbitrary user-defined services on the cluster. |
| You can implement and deploy any service, such as custom counters, ID generators, |
| hierarchical maps, etc. |
| </p> |
| <p> |
| The main use case of the service grid is ability to deploy various types of |
| <b>singleton services in the cluster</b>. However, in case if you need multiple instances |
| of a service, Ignite will also ensure proper deployment and fault tolerance of all |
| service instances. |
| </p> |
| </div> |
| |
| <div class="col-sm-6 col-md-6 col-xs-12" style="padding-right:0"> |
| <img class="img-responsive" src="/images/ignite_service_grid_v1.png" width="380px" style="float:right;"/> |
| </div> |
| </div> |
| <div class="code-examples"> |
| <div class="page-heading">Code Examples:</div> |
| <!-- Nav tabs --> |
| <ul id="service-examples" class="nav nav-tabs"> |
| <li class="active"><a href="#service-define" aria-controls="home" data-toggle="tab">Service Definition</a></li> |
| <li><a href="#service-deploy" aria-controls="home" data-toggle="tab">Service Deployment</a></li> |
| </ul> |
| |
| <!-- Tab panes --> |
| <div class="tab-content"> |
| <div class="tab-pane active" id="service-define"> |
| <pre class="brush:java"> |
| // Simple service implementation. |
| public class MyIgniteService implements Service { |
| // Example of ignite resource injection. All resources are optional. |
| // You should inject resources only as needed. |
| @IgniteInstanceResource |
| private Ignite ignite; |
| ... |
| |
| @Override public void cancel(ServiceContext ctx) { |
| // No-op. |
| } |
| |
| @Override public void execute(ServiceContext ctx) { |
| // Loop until service is cancelled. |
| while (!ctx.isCancelled()) { |
| // Do something. |
| ... |
| } |
| } |
| } |
| </pre> |
| </div> |
| <div class="tab-pane" id="service-deploy"> |
| <pre class="brush:java"> |
| Ignite ignite = Ignition.ignite(); |
| |
| IgniteServices svcs = ignite.services(); |
| |
| // Deploy cluster-singleton service. |
| svcs.deployClusterSingleton("myClusterSingleton", new MyIgniteService()); |
| </pre> |
| </div> |
| </div> |
| </div> |
| <div class="page-heading">GitHub Examples:</div> |
| <p> |
| Also see <a href="https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/servicegrid" target="github">service grid examples</a> |
| available on GitHub. |
| </p> |
| </section> |
| <section id="key-features" class="page-section"> |
| <h2>Service Grid Features</h2> |
| <table class="formatted" name="Service Grid Features"> |
| <thead> |
| <tr> |
| <th width="35%" class="left">Feature</th> |
| <th>Description</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="left">User-Defined Services</td> |
| <td> |
| <p> |
| Users can define their own services and Ignite will automatically distribute |
| these services over the cluster. For example, you can create your own specialized |
| distributed counters, or a custom data loading service, or any other logic, and |
| deploy it onto the cluster. |
| </p> |
| <div class="page-links"> |
| <a href="http://apacheignite.readme.io/docs/service-grid" target="docs">Docs for this Feature <i class="fa fa-angle-double-right"></i></a> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td class="left">Cluster Singletons</td> |
| <td> |
| <p> |
| Ignite allows to deploy any number of services on any of the grid nodes. However, |
| the most commonly used feature is to deploy singleton services on the cluster. |
| Ignite will manage the singleton contract regardless of topology changes and |
| node crashes. |
| </p> |
| <div class="page-links"> |
| <a href="http://apacheignite.readme.io/docs/cluster-singletons" target="docs">Docs for this Feature <i class="fa fa-angle-double-right"></i></a> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td class="left">Fault Tolerance</td> |
| <td> |
| <p> |
| Ignite always guarantees that services are continuously available, and are deployed |
| according to the specified configuration, regardless of any topology changes or |
| node crashes. |
| </p> |
| <div class="page-links"> |
| <a href="http://apacheignite.readme.io/docs/service-grid#load-balancing" target="docs">Docs for this Feature <i class="fa fa-angle-double-right"></i></a> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td class="left">Load Balancing</td> |
| <td> |
| <p> |
| In all cases, other than singleton service deployment, Ignite will automatically make |
| sure that about an equal number of services are deployed on each node within the |
| cluster. Whenever cluster topology changes, Ignite will re-evaluate service |
| deployments and may re-deploy an already deployed service on another node for better |
| load balancing. |
| </p> |
| <div class="page-links"> |
| <a href="http://apacheignite.readme.io/docs/service-grid#load-balancing" target="docs">Docs for this Feature <i class="fa fa-angle-double-right"></i></a> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </section> |
| </main> |
| |
| <!--#include virtual="/includes/footer.html" --> |
| </div> |
| <!--#include virtual="/includes/scripts.html" --> |
| </body> |
| </html> |