Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0154918E46 for ; Tue, 7 Jul 2015 14:17:15 +0000 (UTC) Received: (qmail 38415 invoked by uid 500); 7 Jul 2015 14:17:14 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 38385 invoked by uid 500); 7 Jul 2015 14:17:14 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 38373 invoked by uid 99); 7 Jul 2015 14:17:14 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jul 2015 14:17:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 71F63182839 for ; Tue, 7 Jul 2015 14:17:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.79 X-Spam-Level: * X-Spam-Status: No, score=1.79 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id elOdG8B5511A for ; Tue, 7 Jul 2015 14:16:59 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id B690F4E20A for ; Tue, 7 Jul 2015 14:16:49 +0000 (UTC) Received: (qmail 36544 invoked by uid 99); 7 Jul 2015 14:16:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jul 2015 14:16:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 34F82E17FA; Tue, 7 Jul 2015 14:16:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ivasilinets@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 07 Jul 2015 14:17:00 -0000 Message-Id: <48819de23375470a90b377ce0863e0c0@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [13/37] incubator-ignite git commit: Added README.md file. Added README.md file. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/afd26f21 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/afd26f21 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/afd26f21 Branch: refs/heads/ignite-964-1 Commit: afd26f21bccc7f0c8b7b544ae6da54e93181c68b Parents: 91cb00f Author: nikolay_tikhonov Authored: Fri Feb 20 16:52:04 2015 +0300 Committer: nikolay_tikhonov Committed: Fri Feb 20 16:52:04 2015 +0300 ---------------------------------------------------------------------- README.md | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afd26f21/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md new file mode 100644 index 0000000..f1b9b05 --- /dev/null +++ b/README.md @@ -0,0 +1,179 @@ +
+![Ignite Logo](https://ignite.incubator.apache.org/images/logo3.png "Ignite Logo") +
+ +Apache Ignite In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with traditional disk-based or flash technologies. +![Ignite Features](https://ignite.incubator.apache.org/images/apache-ignite.png "Ignite Features") + +##Features +You can view Ignite as a collection of independent, well-integrated, in-memory components geared to improve performance and scalability of you application. Some of these components include: + + * Advanced Clustering + * Compute Grid + * Data Grid (JCache) + * Service Grid + * Ignite File System + * Distributed Data Structures + * Distributed Messaging + * Distributed Events + * Streaming & CEP + * In-Memory Hadoop Accelerator + +## Installation +Here is the quick summary on installation of Apache Ignite: + * Download Apache Ignite as ZIP archive from https://ignite.incubator.apache.org/ + * Unzip ZIP archive into the installation folder in your system + * Set `IGNITE_HOME` environment variable to point to the installation folder and make sure there is no trailing `/` in the path (this step is optional) + +## Start From Command Line +An Ignite node can be started from command line either with default configuration or by passing a configuration file. You can start as many nodes as you like and they will all automatically discover each other. + +### With Default Configuration +To start a grid node with default configuration, open the command shell and, assuming you are in `IGNITE_HOME` (Ignite installation folder), just type this: + + $ bin/ignite.sh + +and you will see the output similar to this: + + [02:49:12] Ignite node started OK (id=ab5d18a6) + [02:49:12] Topology snapshot [ver=1, nodes=1, CPUs=8, heap=1.0GB] + +By default `ignite.sh` starts Ignite node with the default configuration: `config/default-config.xml`. + +### Passing Configuration File +To pass configuration file explicitly, from command line, you can type ggstart.sh from within your Ignite installation folder. For example: + + $ bin/ignite.sh examples/config/example-cache.xml + +Path to configuration file can be absolute, or relative to either `IGNITE_HOME` (Ignite installation folder) or `META-INF` folder in your classpath. + +### Interactive Mode +To pick a configuration file in interactive mode just pass `-i` flag, like so: `ignite.sh -i`. + +## Get It With Maven +Another easy way to get started with Apache Ignite in your project is to use Maven 2 dependency management. + +Ignite requires only one `ignite-core` mandatory dependency. Usually you will also need to add `ignite-spring` for spring-based XML configuration and `ignite-indexing` for SQL querying. + +Replace `${ignite-version}` with actual Ignite version. + + + org.apache.ignite + ignite-core + ${ignite.version} + + + org.apache.ignite + ignite-spring + ${ignite.version} + + + org.apache.ignite + ignite-indexing + ${ignite.version} + + +## First Ignite Compute Application +Let's write our first grid application which will count a number of non-white-space characters in a sentence. As an example, we will take a sentence, split it into multiple words, and have every compute job count number of characters in each individual word. At the end we simply add up results received from individual jobs to get our total count. + + try (Ignite ignite = Ignition.start()) { + Collection> calls = new ArrayList<>(); + + // Iterate through all the words in the sentence and create Callable jobs. + for (final String word : "Count characters using callable".split(" ")) { + calls.add(new GridCallable() { + @Override public Integer call() throws Exception { + return word.length(); + } + }); + } + + // Execute collection of Callables on the grid. + Collection res = ignite.compute().call(calls).get(); + + int sum = 0; + + // Add up individual word lengths received from remote nodes. + for (int len : res) + sum += len; + + System.out.println(">>> Total number of characters in the phrase is '" + sum + "'."); + } + +### Zero Deployment +Note that when running above application from your IDE, remote nodes will execute received jobs without having your code on the class path. This is called Zero Deployment. Ignite automatically detects missing classes and loads class definitions from the nodes that have them. + +## First Ignite Data Grid Application +Now let's write a simple set of mini-examples which will put and get values to/from distributed cache, and perform basic transactions. + +Since we are using cache in this example, we should make sure that it is configured. Let's use example configuration shipped with Ignite that already has several caches configured: + + $ bin/ignite.sh examples/config/example-cache.xml + +### Put and Get + + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { + IgniteCache cache = ignite.cache(CACHE_NAME); + + // Store keys in cache (values will end up on different cache nodes). + for (int i = 0; i < 10; i++) + cache.put(i, Integer.toString(i)); + + for (int i = 0; i < 10; i++) + System.out.println("Got [key=" + i + ", val=" + cache.get(i) + ']'); + } + +### Atomic Operations + + // Put-if-absent which returns previous value. + Integer oldVal = cache.getAndPutIfAbsent("Hello", 11); + + // Put-if-absent which returns boolean success flag. + boolean success = cache.putIfAbsent("World", 22); + + // Replace-if-exists operation (opposite of getAndPutIfAbsent), returns previous value. + oldVal = cache.getAndReplace("Hello", 11); + + // Replace-if-exists operation (opposite of putIfAbsent), returns boolean success flag. + success = cache.getAndReplace("World", 22); + + // Replace-if-matches operation. + success = cache.replace("World", 2, 22); + + // Remove-if-matches operation. + success = cache.remove("Hello", 1); + +### Transactions + + try (Transaction tx = ignite.transactions().txStart()) { + Integer hello = cache.get("Hello"); + + if (hello == 1) + cache.put("Hello", 11); + + cache.put("World", 22); + + tx.commit(); + } + +### Distributed Locks + + // Lock cache key "Hello". + Lock lock = cache.lock("Hello"); + + lock.lock(); + + try { + cache.put("Hello", 11); + cache.put("World", 22); + } + finally { + lock.unlock(); + } + +## Ignite Visor Admin Console +The easiest way to examine the content of the data grid as well as perform a long list of other management and monitoring operations is to use Ignite Visor Command Line Utility. + +To start Visor simply run: + + $ bin/ignitevisorcmd.sh \ No newline at end of file