[3/3] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread vkulichenko
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/305f8a2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/305f8a2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/305f8a2e

Branch: refs/heads/ignite-45
Commit: 305f8a2e336c6386cfd26a1634cad8b8db311f75
Parents: cbf64c9 3d209d7
Author: Valentin Kulichenko 
Authored: Sat Mar 21 00:48:48 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 00:48:48 2015 -0700

--
 .../org/apache/ignite/cache/query/ContinuousQuery.java| 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--




[2/3] incubator-ignite git commit: IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cbf64c92
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cbf64c92
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cbf64c92

Branch: refs/heads/ignite-45
Commit: cbf64c92ef81b5ea1d3bb99f1ec9fedeee005ecb
Parents: 41d6c97
Author: Valentin Kulichenko 
Authored: Sat Mar 21 00:48:39 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 00:48:39 2015 -0700

--
 .../store/CacheNodeWithStoreStartup.java|   4 -
 .../java7/datagrid/store/CacheStoreExample.java |   1 -
 .../store/dummy/CacheDummyPersonStore.java  |   1 -
 .../hibernate/CacheHibernatePersonStore.java|   1 -
 .../store/jdbc/CacheJdbcPersonStore.java|   1 -
 .../store/jdbc/CacheJdbcPojoPersonStore.java|   1 -
 .../computegrid/ComputeBroadcastExample.java| 101 ++
 .../computegrid/ComputeCallableExample.java |  70 +++
 .../computegrid/ComputeClosureExample.java  |  69 +++
 .../ComputeClusterGroupsExample.java|  82 
 .../ComputeContinuousMapperExample.java | 158 
 .../ComputeExecutorServiceExample.java  |  67 +++
 .../ComputeFibonacciContinuationExample.java| 189 +++
 .../computegrid/ComputeReducerExample.java  |  87 +
 .../computegrid/ComputeRunnableExample.java |  67 +++
 .../computegrid/ComputeScheduleExample.java |  64 +++
 .../computegrid/ComputeTaskMapExample.java  | 106 +++
 .../computegrid/ComputeTaskSplitExample.java|  93 +
 .../failover/ComputeFailoverExample.java| 137 ++
 .../failover/ComputeFailoverNodeStartup.java|  77 
 .../computegrid/failover/package-info.java  |  22 +++
 .../java8/computegrid/montecarlo/Credit.java| 110 +++
 .../montecarlo/CreditRiskExample.java   | 153 +++
 .../montecarlo/CreditRiskManager.java   | 143 ++
 .../computegrid/montecarlo/package-info.java|  22 +++
 .../java8/computegrid/package-info.java |  22 +++
 .../ignite/examples/BasicExamplesSelfTest.java  |   1 -
 .../ignite/examples/CacheExamplesSelfTest.java  |   4 -
 ...heStoreLoadDataExampleMultiNodeSelfTest.java |   1 -
 .../examples/CheckpointExamplesSelfTest.java|   1 -
 .../ComputeClusterGroupsExampleSelfTest.java|   1 -
 .../examples/ContinuationExamplesSelfTest.java  |   1 -
 .../ContinuousMapperExamplesSelfTest.java   |   1 -
 .../examples/DeploymentExamplesSelfTest.java|   1 -
 .../ignite/examples/EventsExamplesSelfTest.java |   1 -
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |   1 -
 .../HibernateL2CacheExampleSelfTest.java|   1 -
 .../ignite/examples/IgfsExamplesSelfTest.java   |   1 -
 .../examples/LifecycleExamplesSelfTest.java |   1 -
 .../MemcacheRestExamplesMultiNodeSelfTest.java  |   1 -
 .../examples/MemcacheRestExamplesSelfTest.java  |   1 -
 .../examples/MessagingExamplesSelfTest.java |   1 -
 .../examples/MonteCarloExamplesSelfTest.java|   1 -
 .../examples/SpringBeanExamplesSelfTest.java|   1 -
 .../ignite/examples/TaskExamplesSelfTest.java   |   1 -
 pom.xml |  40 ++--
 46 files changed, 1859 insertions(+), 51 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbf64c92/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
index 3191611..979e9f7 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
@@ -21,10 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
-import org.apache.ignite.examples.datagrid.store.dummy.*;
-import org.apache.ignite.examples.datagrid.store.hibernate.*;
-import org.apache.ignite.examples.datagrid.store.jdbc.*;
-import org.apache.ignite.examples.datagrid.store.model.*;
 import org.apache.ignite.examples.java7.datagrid.store.dummy.*;
 import org.apache.ignite.examples.java7.datagrid.store.hibernate.*;
 import org.apache.ignite.examples.java7.datagrid.store.jdbc.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbf64c92/examples/src/main/java/org/apache/ignite/examples/java

[1/3] incubator-ignite git commit: IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 3d209d7b5 -> 305f8a2e3


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbf64c92/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/montecarlo/CreditRiskManager.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/montecarlo/CreditRiskManager.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/montecarlo/CreditRiskManager.java
new file mode 100644
index 000..2ee8e23
--- /dev/null
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/montecarlo/CreditRiskManager.java
@@ -0,0 +1,143 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.java8.computegrid.montecarlo;
+
+import java.util.*;
+
+/**
+ * This class abstracts out the calculation of risk for a credit portfolio.
+ */
+@SuppressWarnings({"FloatingPointEquality"})
+public class CreditRiskManager {
+/**
+ * Default randomizer with normal distribution.
+ * Note that since every JVM on the cluster will have its own random
+ * generator (independently initialized) the Monte-Carlo simulation
+ * will be slightly skewed when performed on the ignite cluster due to 
skewed
+ * normal distribution of the sub-jobs comparing to execution on the
+ * local node only with single random generator. Real-life applications
+ * may want to provide its own implementation of distributed random
+ * generator.
+ */
+private static Random rndGen = new Random();
+
+/**
+ * Calculates credit risk for a given credit portfolio. This calculation 
uses
+ * Monte-Carlo Simulation to produce risk value.
+ *
+ * @param portfolio Credit portfolio.
+ * @param horizon Forecast horizon (in days).
+ * @param num Number of Monte-Carlo iterations.
+ * @param percentile Cutoff level.
+ * @return Credit risk value, i.e. the minimal amount that creditor has to
+ *  have available to cover possible defaults.
+ */
+public double calculateCreditRiskMonteCarlo(Credit[] portfolio, int 
horizon, int num, double percentile) {
+System.out.println(">>> Calculating credit risk for portfolio [size=" 
+ portfolio.length + ", horizon=" +
+horizon + ", percentile=" + percentile + ", iterations=" + num + 
"] <<<");
+
+long start = System.currentTimeMillis();
+
+double[] losses = calculateLosses(portfolio, horizon, num);
+
+Arrays.sort(losses);
+
+double[] lossProbs = new double[losses.length];
+
+// Count variational numbers.
+// Every next one either has the same value or previous one plus 
probability of loss.
+for (int i = 0; i < losses.length; i++)
+if (i == 0)
+// First time it's just a probability of first value.
+lossProbs[i] = getLossProbability(losses, 0);
+else if (losses[i] != losses[i - 1])
+// Probability of this loss plus previous one.
+lossProbs[i] = getLossProbability(losses, i) + lossProbs[i - 
1];
+else
+// The same loss the same probability.
+lossProbs[i] = lossProbs[i - 1];
+
+// Count percentile.
+double crdRisk = 0;
+
+for (int i = 0; i < lossProbs.length; i++)
+if (lossProbs[i] > percentile) {
+crdRisk = losses[i - 1];
+
+break;
+}
+
+System.out.println(">>> Finished calculating portfolio risk [risk=" + 
crdRisk +
+", time=" + (System.currentTimeMillis() - start) + "ms]");
+
+return crdRisk;
+}
+
+/**
+ * Calculates losses for the given credit portfolio using Monte-Carlo 
Simulation.
+ * Simulates probability of default only.
+ *
+ * @param portfolio Credit portfolio.
+ * @param horizon Forecast horizon.
+ * @param num Number of Monte-Carlo iterations.
+ * @return Losses array simulated by Monte Carlo method.
+ */
+private double[] calculateLosses(Credit[] portfolio, int horizon, int num) 
{
+ 

incubator-ignite git commit: # ignite-45 - fixing streaming.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 305f8a2e3 -> 093a2fc94


# ignite-45 - fixing streaming.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/093a2fc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/093a2fc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/093a2fc9

Branch: refs/heads/ignite-45
Commit: 093a2fc94248b4d67cf4c2179f450e40c41b8408
Parents: 305f8a2
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 01:33:24 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 01:33:24 2015 -0700

--
 .../ignite/examples/java8/ExamplesUtils.java|   7 +-
 .../java8/streaming/marketdata/CacheConfig.java |  45 
 .../java8/streaming/marketdata/Instrument.java  |  66 ---
 .../marketdata/QueryTopInstruments.java |  70 
 .../streaming/marketdata/StreamMarketData.java  | 111 +++
 .../streaming/numbers/QueryPopularNumbers.java  |   6 +-
 .../streaming/numbers/StreamRandomNumbers.java  |   6 +-
 .../org/apache/ignite/IgniteDataStreamer.java   |   4 +-
 .../configuration/CacheConfiguration.java   |   5 +
 .../org/apache/ignite/stream/StreamVisitor.java |  53 +
 10 files changed, 316 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/093a2fc9/examples/src/main/java8/org/apache/ignite/examples/java8/ExamplesUtils.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/ExamplesUtils.java 
b/examples/src/main/java8/org/apache/ignite/examples/java8/ExamplesUtils.java
index 5b431bc..0fc7506 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/ExamplesUtils.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/ExamplesUtils.java
@@ -111,7 +111,12 @@ public class ExamplesUtils {
 List l = (List)row;
 
 for (int i = 0; i < l.size(); i++) {
-System.out.print(l.get(i));
+Object o = l.get(i);
+
+if (o instanceof Double || o instanceof Float)
+System.out.printf("%.2f", o);
+else
+System.out.print(l.get(i));
 
 if (i + 1 != l.size())
 System.out.print(',');

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/093a2fc9/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
new file mode 100644
index 000..90bdcf1
--- /dev/null
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
@@ -0,0 +1,45 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.java8.streaming.marketdata;
+
+import org.apache.ignite.configuration.*;
+
+/**
+ * Configuration for the streaming cache to store the stream of random numbers.
+ * This cache is configured with sliding window of 1 second, which means that
+ * data older than 1 second will be automatically removed from the cache.
+ */
+public class CacheConfig {
+/** Cache name. */
+public static final String STREAM_NAME = "marketTicks";
+
+/**
+ * Configure streaming cache.
+ */
+public static CacheConfiguration marketTicksCache() {
+return new CacheConfiguration<>("marketTicks");
+}
+
+public static CacheConfiguration instrumentCache() {
+CacheConfiguration instCache = new 
CacheConfiguration<>("instCache");
+
+instCache.setIndexedTypes(String.class, Instrument.class);
+
+return instCache;
+}
+}

http://git-

[1/2] incubator-ignite git commit: # ignite-45 - fixing streaming.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 093a2fc94 -> dfc1a49c6


# ignite-45 - fixing streaming.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a034ed02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a034ed02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a034ed02

Branch: refs/heads/ignite-45
Commit: a034ed02d70f45c841401c99a962c077aa27f9fd
Parents: 093a2fc
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 01:43:40 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 01:43:40 2015 -0700

--
 .../java8/streaming/marketdata/StreamMarketData.java | 3 ---
 .../ignite/examples/java8/streaming/numbers/CacheConfig.java | 8 ++--
 .../java8/streaming/numbers/QueryPopularNumbers.java | 2 +-
 .../java8/streaming/numbers/StreamRandomNumbers.java | 2 +-
 .../src/main/java/org/apache/ignite/compute/ComputeJob.java  | 3 +--
 .../java/org/apache/ignite/compute/ComputeJobAdapter.java| 2 +-
 6 files changed, 6 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a034ed02/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
index c2c1c2a..10c9caa 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
@@ -60,9 +60,6 @@ public class StreamMarketData {
 IgniteCache instCache = 
ignite.getOrCreateCache(CacheConfig.instrumentCache());
 
 try (IgniteDataStreamer stmr = 
ignite.dataStreamer(mktCache.getName())) {
-// Allow data updates.
-stmr.allowOverwrite(true);
-
 // Note that we receive market data, but do not populate 
'mktCache' (it remains empty).
 // Instead we update the instruments in the 'instCache'.
 stmr.receiver(new StreamVisitor<>((cache, e) -> {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a034ed02/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/CacheConfig.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/CacheConfig.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/CacheConfig.java
index bd6513a..4de5fb6 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/CacheConfig.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/CacheConfig.java
@@ -30,16 +30,12 @@ import static java.util.concurrent.TimeUnit.*;
  * data older than 1 second will be automatically removed from the cache.
  */
 public class CacheConfig {
-/** Cache name. */
-public static final String STREAM_NAME = "randomNumbers";
-
 /**
  * Configure streaming cache.
  */
-public static CacheConfiguration configure() {
-CacheConfiguration cfg = new CacheConfiguration<>();
+public static CacheConfiguration randomNumbersCache() {
+CacheConfiguration cfg = new 
CacheConfiguration<>("randomNumbers");
 
-cfg.setName(STREAM_NAME);
 cfg.setIndexedTypes(Integer.class, Long.class);
 
 // Sliding window of 1 seconds.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a034ed02/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/QueryPopularNumbers.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/QueryPopularNumbers.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/QueryPopularNumbers.java
index f862553..06aa508 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/QueryPopularNumbers.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/QueryPopularNumbers.java
@@ -44,7 +44,7 @@ public class QueryPopularNumbers {
 return;
 
 // The cache is configured with sliding window holding 1 second of 
the streaming data.
-IgniteCache stmCache = 
ignite.getOrCreateCache(CacheConfig.configure());
+IgniteCache stmCache = 
ignite.getOrCreateCache(CacheConfig.randomNumbersCache());
 
   

[2/2] incubator-ignite git commit: # ignite-45 - fixing streaming.

2015-03-21 Thread dsetrakyan
# ignite-45 - fixing streaming.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dfc1a49c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dfc1a49c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dfc1a49c

Branch: refs/heads/ignite-45
Commit: dfc1a49c69c259126c25dda15c37025dc16b50de
Parents: a034ed0
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 01:44:45 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 01:44:45 2015 -0700

--
 .../examples/java8/computegrid/ComputeTaskMapExample.java   | 5 ++---
 .../examples/java8/computegrid/ComputeTaskSplitExample.java | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfc1a49c/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskMapExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskMapExample.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskMapExample.java
index bc8f305..44af4af 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskMapExample.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskMapExample.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.examples.java7.*;
-import org.jetbrains.annotations.*;
 
 import java.util.*;
 
@@ -85,7 +84,7 @@ public class ComputeTaskMapExample {
 ClusterNode node = it.next();
 
 map.put(new ComputeJobAdapter() {
-@Nullable @Override public Object execute() {
+@Override public Object execute() {
 System.out.println();
 System.out.println(">>> Printing '" + word + "' on 
this node from ignite job.");
 
@@ -99,7 +98,7 @@ public class ComputeTaskMapExample {
 }
 
 /** {@inheritDoc} */
-@Nullable @Override public Integer reduce(List 
results) {
+@Override public Integer reduce(List results) {
 return results.stream().mapToInt(ComputeJobResult::getData).sum();
 }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfc1a49c/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
index 0b53ab9..76fb380 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
@@ -20,7 +20,6 @@ package org.apache.ignite.examples.java8.computegrid;
 import org.apache.ignite.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.examples.java7.*;
-import org.jetbrains.annotations.*;
 
 import java.util.*;
 import java.util.stream.*;
@@ -75,7 +74,7 @@ public class ComputeTaskSplitExample {
 @Override protected Collection split(int 
clusterSize, String arg) {
 return Stream.of(arg.split(" ")).map(word ->
 new ComputeJobAdapter() {
-@Nullable @Override public Object execute() {
+@Override public Object execute() {
 System.out.println();
 System.out.println(">>> Printing '" + word + "' on 
this node from ignite job.");
 
@@ -86,7 +85,7 @@ public class ComputeTaskSplitExample {
 }
 
 /** {@inheritDoc} */
-@Nullable @Override public Integer reduce(List 
results) {
+@Override public Integer reduce(List results) {
 return results.stream().mapToInt(ComputeJobResult::getData).sum();
 }
 }



incubator-ignite git commit: # ignite-45 - fixing configs.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 dfc1a49c6 -> dea117528


# ignite-45 - fixing configs.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dea11752
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dea11752
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dea11752

Branch: refs/heads/ignite-45
Commit: dea117528a8524caec5f1b7dffb09d04c904a8de
Parents: dfc1a49
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 01:57:45 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 01:57:45 2015 -0700

--
 config/fabric/default-config.xml| 50 +---
 .../computegrid/ComputeRunnableExample.java |  2 +-
 2 files changed, 3 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dea11752/config/fabric/default-config.xml
--
diff --git a/config/fabric/default-config.xml b/config/fabric/default-config.xml
index e623dff..5da95ba 100644
--- a/config/fabric/default-config.xml
+++ b/config/fabric/default-config.xml
@@ -23,53 +23,7 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd";>
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dea11752/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeRunnableExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeRunnableExample.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeRunnableExample.java
index a78c863..d5f3675 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeRunnableExample.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeRunnableExample.java
@@ -26,7 +26,7 @@ import java.util.stream.*;
 /**
  * Demonstrates a simple use of {@link IgniteRunnable}.
  * 
- * Remote nodes should always be started with special configuration file which
+ * Remote nodes should always be 0started with special configuration file which
  * enables P2P class loading: {@code 'ignite.{sh|bat} 
examples/config/example-ignite.xml'}.
  * 
  * Alternatively you can run {@link ExampleNodeStartup} in another JVM which 
will start node



[1/2] incubator-ignite git commit: # ignite-45 added test for Ignition.start()

2015-03-21 Thread sboikov
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 dea117528 -> 19350779a


# ignite-45 added test for Ignition.start()


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/db974fba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/db974fba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/db974fba

Branch: refs/heads/ignite-45
Commit: db974fbace0d893f21771ab3a24e28b8919946a6
Parents: dfc1a49
Author: sboikov 
Authored: Sat Mar 21 11:57:10 2015 +0300
Committer: sboikov 
Committed: Sat Mar 21 12:00:07 2015 +0300

--
 .../ignite/internal/GridFactorySelfTest.java| 22 
 1 file changed, 22 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/db974fba/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
--
diff --git 
a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
 
b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
index ab3d699..6bd50de 100644
--- 
a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
+++ 
b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
@@ -82,6 +82,28 @@ public class GridFactorySelfTest extends 
GridCommonAbstractTest {
 /**
  * @throws Exception If failed.
  */
+public void testStartDefault() throws Exception {
+try (Ignite ignite = Ignition.start()) {
+log.info("Started1: " + ignite.name());
+
+try {
+Ignition.start();
+
+fail();
+}
+catch (IgniteException expected) {
+// No-op.
+}
+}
+
+try (Ignite ignite = Ignition.start()) {
+log.info("Started2: " + ignite.name());
+}
+}
+
+/**
+ * @throws Exception If failed.
+ */
 public void testStartGridWithConfigUrlString() throws Exception {
 GridEmbeddedHttpServer srv = null;
 String gridName = "grid_with_url_config";



[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread sboikov
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/19350779
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/19350779
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/19350779

Branch: refs/heads/ignite-45
Commit: 19350779ab90a64d4e707f84ef8669130acde2ab
Parents: db974fb dea1175
Author: sboikov 
Authored: Sat Mar 21 12:00:42 2015 +0300
Committer: sboikov 
Committed: Sat Mar 21 12:00:42 2015 +0300

--
 config/fabric/default-config.xml| 50 +---
 .../computegrid/ComputeRunnableExample.java |  2 +-
 2 files changed, 3 insertions(+), 49 deletions(-)
--




[1/2] incubator-ignite git commit: # ignite-45 - fixing configs.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 19350779a -> 56ae536b7


# ignite-45 - fixing configs.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7535b142
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7535b142
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7535b142

Branch: refs/heads/ignite-45
Commit: 7535b142800ffe5de065b58389c80341008e6be6
Parents: dea1175
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 02:02:55 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 02:02:55 2015 -0700

--
 examples/config/example-streamer.xml | 293 --
 1 file changed, 293 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7535b142/examples/config/example-streamer.xml
--
diff --git a/examples/config/example-streamer.xml 
b/examples/config/example-streamer.xml
deleted file mode 100644
index 0d996a8..000
--- a/examples/config/example-streamer.xml
+++ /dev/null
@@ -1,293 +0,0 @@
-
-
-
-
-
-http://www.springframework.org/schema/beans";
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-xsi:schemaLocation="
-http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd";>
-
-
-Spring file for ignite configuration with benchmark.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-   

[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread dsetrakyan
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/56ae536b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/56ae536b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/56ae536b

Branch: refs/heads/ignite-45
Commit: 56ae536b750b6051681e087e0273d55358b4e416
Parents: 7535b14 1935077
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 02:03:07 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 02:03:07 2015 -0700

--
 .../ignite/internal/GridFactorySelfTest.java| 22 
 1 file changed, 22 insertions(+)
--




incubator-ignite git commit: # ignite-45 added tests for default xml configs

2015-03-21 Thread sboikov
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 56ae536b7 -> 1496f8081


# ignite-45 added tests for default xml configs


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1496f808
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1496f808
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1496f808

Branch: refs/heads/ignite-45
Commit: 1496f8081b2f95e526c9e4875b8f90dfb75d1f19
Parents: 56ae536
Author: sboikov 
Authored: Sat Mar 21 12:09:27 2015 +0300
Committer: sboikov 
Committed: Sat Mar 21 12:09:27 2015 +0300

--
 .../ignite/internal/GridFactorySelfTest.java| 20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1496f808/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
--
diff --git 
a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
 
b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
index 6bd50de..8f4c5dd 100644
--- 
a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
+++ 
b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
@@ -82,7 +82,7 @@ public class GridFactorySelfTest extends 
GridCommonAbstractTest {
 /**
  * @throws Exception If failed.
  */
-public void testStartDefault() throws Exception {
+public void testIgnitionStartDefault() throws Exception {
 try (Ignite ignite = Ignition.start()) {
 log.info("Started1: " + ignite.name());
 
@@ -104,6 +104,24 @@ public class GridFactorySelfTest extends 
GridCommonAbstractTest {
 /**
  * @throws Exception If failed.
  */
+public void testStartFabricDefault() throws Exception {
+try (Ignite ignite = 
Ignition.start("config/fabric/default-config.xml")) {
+log.info("Started: " + ignite.name());
+}
+}
+
+/**
+ * @throws Exception If failed.
+ */
+public void testStartDefault() throws Exception {
+try (Ignite ignite = Ignition.start("config/default-config.xml")) {
+log.info("Started: " + ignite.name());
+}
+}
+
+/**
+ * @throws Exception If failed.
+ */
 public void testStartGridWithConfigUrlString() throws Exception {
 GridEmbeddedHttpServer srv = null;
 String gridName = "grid_with_url_config";



[1/2] incubator-ignite git commit: IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 1496f8081 -> 24c6fed22


IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fbdfa726
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fbdfa726
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fbdfa726

Branch: refs/heads/ignite-45
Commit: fbdfa726e476553cf2aefc59f0060d7375ef2390
Parents: 093a2fc
Author: Valentin Kulichenko 
Authored: Sat Mar 21 02:14:39 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 02:14:39 2015 -0700

--
 .../computegrid/ComputeCallableExample.java | 11 ++---
 .../ComputeExecutorServiceExample.java  |  7 +++---
 .../computegrid/ComputeRunnableExample.java | 26 +++-
 .../computegrid/ComputeTaskSplitExample.java| 12 ++---
 .../montecarlo/CreditRiskExample.java   | 12 +++--
 5 files changed, 38 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fbdfa726/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeCallableExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeCallableExample.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeCallableExample.java
index cedab92..c24df5e 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeCallableExample.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeCallableExample.java
@@ -22,7 +22,6 @@ import org.apache.ignite.examples.java7.*;
 import org.apache.ignite.lang.*;
 
 import java.util.*;
-import java.util.stream.*;
 
 /**
  * Demonstrates using of {@link IgniteCallable} job execution on the cluster.
@@ -49,16 +48,20 @@ public class ComputeCallableExample {
 System.out.println();
 System.out.println(">>> Compute callable example started.");
 
-Stream> calls = Stream.of("Count 
characters using callable".split(" ")).map(word ->
-(IgniteCallable)() -> {
+Collection> calls = new ArrayList<>();
+
+// Iterate through all words in the sentence and create callable 
jobs.
+for (String word : "Count characters using callable".split(" ")) {
+calls.add(() -> {
 System.out.println();
 System.out.println(">>> Printing '" + word + "' on this 
node from ignite job.");
 
 return word.length();
 });
+}
 
 // Execute collection of callables on the ignite.
-Collection res = 
ignite.compute().call(calls.collect(Collectors.toList()));
+Collection res = ignite.compute().call(calls);
 
 int sum = res.stream().mapToInt(i -> i).sum();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fbdfa726/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
index 1208ce1..91ea66b 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.examples.java7.*;
 
 import java.util.concurrent.*;
-import java.util.stream.*;
 
 /**
  * Simple example to demonstrate usage of distributed executor service 
provided by Ignite.
@@ -48,12 +47,14 @@ public final class ComputeExecutorServiceExample {
 // Get ignite-enabled executor service.
 ExecutorService exec = ignite.executorService();
 
-Stream.of("Print words using runnable".split(" ")).forEach(word -> 
{
+// Iterate through all words in the sentence and create callable 
jobs.
+for (String word : "Print words using runnable".split(" ")) {
+// Execute runnable on some node.
 exec.submit(() -> {
 System.out.println();
 System.out.println(">>> Printing '" + word + "' on this 
node from ignite job.");
 });
-});
+}
 
 exec.shutdown();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fbdfa726/examples/src/main/java8/org

[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread vkulichenko
Merge remote-tracking branch 'origin/ignite-45' into ignite-45

Conflicts:

examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/24c6fed2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/24c6fed2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/24c6fed2

Branch: refs/heads/ignite-45
Commit: 24c6fed2283bc2e29174ee7bc1e3508164f20bc2
Parents: fbdfa72 1496f80
Author: Valentin Kulichenko 
Authored: Sat Mar 21 02:15:18 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 02:15:18 2015 -0700

--
 config/fabric/default-config.xml|  50 +---
 examples/config/example-streamer.xml| 293 ---
 .../computegrid/ComputeRunnableExample.java |   2 +-
 .../computegrid/ComputeTaskMapExample.java  |   5 +-
 .../computegrid/ComputeTaskSplitExample.java|   5 +-
 .../streaming/marketdata/StreamMarketData.java  |   3 -
 .../java8/streaming/numbers/CacheConfig.java|   8 +-
 .../streaming/numbers/QueryPopularNumbers.java  |   2 +-
 .../streaming/numbers/StreamRandomNumbers.java  |   2 +-
 .../org/apache/ignite/compute/ComputeJob.java   |   3 +-
 .../ignite/compute/ComputeJobAdapter.java   |   2 +-
 .../ignite/internal/GridFactorySelfTest.java|  40 +++
 12 files changed, 53 insertions(+), 362 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24c6fed2/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeRunnableExample.java
--

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24c6fed2/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
--
diff --cc 
examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
index 7805728,76fb380..ea9effb
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeTaskSplitExample.java
@@@ -20,9 -20,9 +20,8 @@@ package org.apache.ignite.examples.java
  import org.apache.ignite.*;
  import org.apache.ignite.compute.*;
  import org.apache.ignite.examples.java7.*;
- import org.jetbrains.annotations.*;
  
  import java.util.*;
 -import java.util.stream.*;
  
  /**
   * Demonstrates a simple use of Ignite with {@link ComputeTaskSplitAdapter}.
@@@ -72,11 -72,9 +71,11 @@@ public class ComputeTaskSplitExample 
   * @return The list of child jobs.
   */
  @Override protected Collection split(int 
clusterSize, String arg) {
 -return Stream.of(arg.split(" ")).map(word ->
 -new ComputeJobAdapter() {
 +Collection jobs = new LinkedList<>();
 +
 +for (final String word : arg.split(" ")) {
 +jobs.add(new ComputeJobAdapter() {
- @Nullable @Override public Object execute() {
+ @Override public Object execute() {
  System.out.println();
  System.out.println(">>> Printing '" + word + "' on 
this node from ignite job.");
  



[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread agoncharuk
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/df5e6d36
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/df5e6d36
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/df5e6d36

Branch: refs/heads/ignite-45
Commit: df5e6d36c748c59fc31561ebbdc6b6ae17089ac9
Parents: 4c5e43b 24c6fed
Author: Alexey Goncharuk 
Authored: Sat Mar 21 03:01:16 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 03:01:16 2015 -0700

--
 config/fabric/default-config.xml|  50 +---
 examples/config/example-streamer.xml| 293 ---
 .../ignite/examples/java8/ExamplesUtils.java|   7 +-
 .../computegrid/ComputeBroadcastExample.java| 101 +++
 .../computegrid/ComputeCallableExample.java |  73 +
 .../computegrid/ComputeClosureExample.java  |  69 +
 .../ComputeClusterGroupsExample.java|  82 ++
 .../ComputeContinuousMapperExample.java | 158 ++
 .../ComputeExecutorServiceExample.java  |  68 +
 .../ComputeFibonacciContinuationExample.java| 189 
 .../computegrid/ComputeReducerExample.java  |  87 ++
 .../computegrid/ComputeRunnableExample.java |  71 +
 .../computegrid/ComputeScheduleExample.java |  64 
 .../computegrid/ComputeTaskMapExample.java  | 105 +++
 .../computegrid/ComputeTaskSplitExample.java|  96 ++
 .../failover/ComputeFailoverExample.java| 137 +
 .../failover/ComputeFailoverNodeStartup.java|  77 +
 .../computegrid/failover/package-info.java  |  22 ++
 .../java8/computegrid/montecarlo/Credit.java| 110 +++
 .../montecarlo/CreditRiskExample.java   | 149 ++
 .../montecarlo/CreditRiskManager.java   | 143 +
 .../computegrid/montecarlo/package-info.java|  22 ++
 .../java8/computegrid/package-info.java |  22 ++
 .../java8/streaming/marketdata/CacheConfig.java |  45 +++
 .../java8/streaming/marketdata/Instrument.java  |  66 ++---
 .../marketdata/QueryTopInstruments.java |  70 +
 .../streaming/marketdata/StreamMarketData.java  | 108 +++
 .../java8/streaming/numbers/CacheConfig.java|   8 +-
 .../streaming/numbers/QueryPopularNumbers.java  |   8 +-
 .../streaming/numbers/StreamRandomNumbers.java  |   8 +-
 .../org/apache/ignite/IgniteDataStreamer.java   |   4 +-
 .../org/apache/ignite/compute/ComputeJob.java   |   3 +-
 .../ignite/compute/ComputeJobAdapter.java   |   2 +-
 .../configuration/CacheConfiguration.java   |   5 +
 .../org/apache/ignite/stream/StreamVisitor.java |  53 
 .../ignite/internal/GridFactorySelfTest.java|  40 +++
 pom.xml |  40 +--
 37 files changed, 2226 insertions(+), 429 deletions(-)
--




[1/2] incubator-ignite git commit: IGNITE-45 - Fixes from example runs. Added tests.

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 24c6fed22 -> df5e6d36c


IGNITE-45 - Fixes from example runs. Added tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4c5e43b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4c5e43b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4c5e43b2

Branch: refs/heads/ignite-45
Commit: 4c5e43b238097d62f61911bb37a5f95f1a07a5eb
Parents: 3d209d7
Author: Alexey Goncharuk 
Authored: Sat Mar 21 03:01:02 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 03:01:02 2015 -0700

--
 .../store/CacheNodeWithStoreStartup.java|   4 -
 .../java7/datagrid/store/CacheStoreExample.java |   1 -
 .../store/dummy/CacheDummyPersonStore.java  |   1 -
 .../hibernate/CacheHibernatePersonStore.java|   1 -
 .../store/jdbc/CacheJdbcPersonStore.java|   1 -
 .../store/jdbc/CacheJdbcPojoPersonStore.java|   1 -
 .../ignite/examples/BasicExamplesSelfTest.java  |   1 -
 .../ignite/examples/CacheExamplesSelfTest.java  |   4 -
 ...heStoreLoadDataExampleMultiNodeSelfTest.java |   1 -
 .../examples/CheckpointExamplesSelfTest.java|   1 -
 .../ComputeClusterGroupsExampleSelfTest.java|   1 -
 .../examples/ContinuationExamplesSelfTest.java  |   1 -
 .../ContinuousMapperExamplesSelfTest.java   |   1 -
 .../examples/DeploymentExamplesSelfTest.java|   1 -
 .../ignite/examples/EventsExamplesSelfTest.java |   1 -
 ...ibernateL2CacheExampleMultiNodeSelfTest.java |   1 -
 .../HibernateL2CacheExampleSelfTest.java|   1 -
 .../ignite/examples/IgfsExamplesSelfTest.java   |   1 -
 .../examples/LifecycleExamplesSelfTest.java |   1 -
 .../MemcacheRestExamplesMultiNodeSelfTest.java  |   1 -
 .../examples/MemcacheRestExamplesSelfTest.java  |   1 -
 .../examples/MessagingExamplesSelfTest.java |   1 -
 .../examples/MonteCarloExamplesSelfTest.java|   1 -
 .../examples/SpringBeanExamplesSelfTest.java|   1 -
 .../ignite/examples/TaskExamplesSelfTest.java   |   1 -
 .../cache/CacheServerNotFoundException.java |  46 +++
 .../apache/ignite/internal/IgniteKernal.java|  14 +-
 .../ClusterTopologyServerNotFoundException.java |  39 ++
 .../affinity/GridAffinityProcessor.java |  80 ++--
 .../processors/affinity/GridAffinityUtils.java  |   2 +
 .../cache/DynamicCacheChangeRequest.java|  17 +--
 .../processors/cache/GridCacheContext.java  |  34 +
 .../processors/cache/GridCacheGateway.java  |  11 ++
 .../GridCachePartitionExchangeManager.java  |   2 +-
 .../processors/cache/GridCacheProcessor.java|  28 ++--
 .../processors/cache/GridCacheUtils.java|   3 +
 .../processors/cache/IgniteCacheProxy.java  |  19 +--
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |   3 +-
 .../colocated/GridDhtColocatedLockFuture.java   |   3 +-
 .../distributed/near/GridNearAtomicCache.java   |   2 +
 .../distributed/near/GridNearLockFuture.java|   2 +-
 .../local/atomic/GridLocalAtomicCache.java  |   5 -
 .../datastreamer/DataStreamerImpl.java  |  77 +++
 .../datastreamer/DataStreamerUpdateJob.java |   1 +
 .../dr/IgniteDrDataStreamerCacheUpdater.java|   5 +-
 .../GridAffinityProcessorAbstractSelfTest.java  |   2 +-
 .../cache/IgniteCacheDynamicStopSelfTest.java   | 130 +++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 +
 48 files changed, 409 insertions(+), 148 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4c5e43b2/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
index 3191611..979e9f7 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/store/CacheNodeWithStoreStartup.java
@@ -21,10 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
-import org.apache.ignite.examples.datagrid.store.dummy.*;
-import org.apache.ignite.examples.datagrid.store.hibernate.*;
-import org.apache.ignite.examples.datagrid.store.jdbc.*;
-import org.apache.ignite.examples.datagrid.store.model.*;
 import org.apache.ignite.examples.java7.datagrid.store.dummy.*;
 import org.apache.ignite.examples.java7.datagrid.store.hibernate.*;
 import org.apache.ignite.examples.java7.datagrid.store.jdb

Git Push Summary

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45-debug [deleted] c9c4f6398


incubator-ignite git commit: IGNITE-45 - Added serialVersionUID

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 df5e6d36c -> 496a65c65


IGNITE-45 - Added serialVersionUID


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/496a65c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/496a65c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/496a65c6

Branch: refs/heads/ignite-45
Commit: 496a65c6509c83bc9aa642cc558130baf9d712af
Parents: df5e6d3
Author: Alexey Goncharuk 
Authored: Sat Mar 21 03:09:32 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 03:09:32 2015 -0700

--
 .../org/apache/ignite/cache/CacheServerNotFoundException.java   | 3 +++
 .../cluster/ClusterTopologyServerNotFoundException.java | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/496a65c6/modules/core/src/main/java/org/apache/ignite/cache/CacheServerNotFoundException.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/CacheServerNotFoundException.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/CacheServerNotFoundException.java
index d1e2f06..693a5eb 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/CacheServerNotFoundException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/CacheServerNotFoundException.java
@@ -22,6 +22,9 @@ import javax.cache.CacheException;
  * Exception thrown when all data nodes left the grid.
  */
 public class CacheServerNotFoundException extends CacheException {
+/** */
+private static final long serialVersionUID = 0L;
+
 /**
  * @param message Error message.
  */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/496a65c6/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyServerNotFoundException.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyServerNotFoundException.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyServerNotFoundException.java
index 5f55911..22bcad0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyServerNotFoundException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyServerNotFoundException.java
@@ -16,12 +16,13 @@
  */
 package org.apache.ignite.internal.cluster;
 
-import org.apache.ignite.cluster.*;
-
 /**
  * Internal exception that is used to indicate that all server nodes have left 
the grid.
  */
 public class ClusterTopologyServerNotFoundException extends 
ClusterTopologyCheckedException {
+/** */
+private static final long serialVersionUID = 0L;
+
 /**
  * @param message Error message.
  */



incubator-ignite git commit: IGNITE-45 - Fixed cache stop.

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 496a65c65 -> e05b21871


IGNITE-45 - Fixed cache stop.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e05b2187
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e05b2187
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e05b2187

Branch: refs/heads/ignite-45
Commit: e05b21871f279e85ae03176ee79f9d1b7a6dd8f0
Parents: 496a65c
Author: Alexey Goncharuk 
Authored: Sat Mar 21 04:04:58 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 04:04:58 2015 -0700

--
 .../src/main/java/org/apache/ignite/cache/CacheManager.java | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e05b2187/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java 
b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index 35658fe..4a41dd5 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -257,19 +257,22 @@ public class CacheManager implements 
javax.cache.CacheManager {
 @Override public void destroyCache(String cacheName) {
 kernalGateway.readLock();
 
+IgniteCache cache;
+
 try {
-IgniteCache cache = getCache0(cacheName);
+cache = getCache0(cacheName);
 
 if (cache != null) {
 unregisterCacheObject(cacheName, CACHE_CONFIGURATION);
 unregisterCacheObject(cacheName, CACHE_STATISTICS);
-
-cache.close();
 }
 }
 finally {
 kernalGateway.readUnlock();
 }
+
+if (cache != null)
+cache.close();
 }
 
 /**



[2/2] incubator-ignite git commit: IGNITE-45 - Release version.

2015-03-21 Thread agoncharuk
IGNITE-45 - Release version.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3691cede
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3691cede
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3691cede

Branch: refs/heads/ignite-45
Commit: 3691cede2c027a12f5b8097231b98dda0de17dea
Parents: d94641e
Author: Alexey Goncharuk 
Authored: Sat Mar 21 04:36:09 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 04:36:09 2015 -0700

--
 examples/pom-standalone.xml   | 2 +-
 modules/core/src/main/resources/ignite.properties | 2 +-
 pom.xml   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3691cede/examples/pom-standalone.xml
--
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index 2147d0f..573961a 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -28,7 +28,7 @@
 
 
 UTF-8
-1.0.0-SNAPSHOT
+1.0.0
 
 
 org.apache.ignite

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3691cede/modules/core/src/main/resources/ignite.properties
--
diff --git a/modules/core/src/main/resources/ignite.properties 
b/modules/core/src/main/resources/ignite.properties
index 3c8a51c..549bde3 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 
-ignite.version=1.0.0-SNAPSHOT
+ignite.version=1.0.0
 ignite.build=0
 ignite.revision=DEV
 ignite.rel.date=01011970

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3691cede/pom.xml
--
diff --git a/pom.xml b/pom.xml
index e7428d8..7460072 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
 
 
 
-1.0.0-SNAPSHOT
+1.0.0
 fabric
 2.4.1
 4.1.0.RELEASE



[1/2] incubator-ignite git commit: IGNITE-45 - Removed assertion.

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 e05b21871 -> 3691cede2


IGNITE-45 - Removed assertion.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d94641e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d94641e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d94641e1

Branch: refs/heads/ignite-45
Commit: d94641e10a8f27ef44dba54ffd17f10f54fa815a
Parents: e05b218
Author: Alexey Goncharuk 
Authored: Sat Mar 21 04:31:50 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 04:31:50 2015 -0700

--
 .../ignite/internal/processors/cache/GridCacheProcessor.java   | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d94641e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 3a4cf6a..469228f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -2086,8 +2086,6 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 }
 }
 
-assert caches.isEmpty() || max > 0;
-
 return max;
 }
 



incubator-ignite git commit: minor fix to test

2015-03-21 Thread yzhdanov
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 3691cede2 -> f279b44da


minor fix to test


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f279b44d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f279b44d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f279b44d

Branch: refs/heads/ignite-45
Commit: f279b44da837969abca431b0474e4d58bc6bff7b
Parents: 3691ced
Author: Yakov Zhdanov 
Authored: Sat Mar 21 16:09:32 2015 +0300
Committer: Yakov Zhdanov 
Committed: Sat Mar 21 16:09:32 2015 +0300

--
 .../processors/rest/JettyRestProcessorAbstractSelfTest.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f279b44d/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
--
diff --git 
a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
 
b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index efabea4..d5a3cc1 100644
--- 
a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ 
b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -232,7 +232,9 @@ abstract class JettyRestProcessorAbstractSelfTest extends 
AbstractRestProcessorS
 
 info("Get all command result: " + ret);
 
-jsonEquals(ret, 
cacheBulkPattern("\\{\\\"getKey1\\\":\\\"getVal1\\\"\\,\\\"getKey2\\\":\\\"getVal2\\\"\\}",
+jsonEquals(ret,
+// getKey[12] is used since the order is not determined.
+
cacheBulkPattern("\\{\\\"getKey[12]\\\":\\\"getVal[12]\\\"\\,\\\"getKey[12]\\\":\\\"getVal[12]\\\"\\}",
 true));
 }
 



incubator-ignite git commit: fixed hibernate examples

2015-03-21 Thread yzhdanov
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 f279b44da -> 13b2736f8


fixed hibernate examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/13b2736f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/13b2736f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/13b2736f

Branch: refs/heads/ignite-45
Commit: 13b2736f83b6a6e7d7c9a2f3a328fa97ae4ec02c
Parents: f279b44
Author: Yakov Zhdanov 
Authored: Sat Mar 21 16:23:53 2015 +0300
Committer: Yakov Zhdanov 
Committed: Sat Mar 21 16:23:53 2015 +0300

--
 examples/config/hibernate/example-hibernate-L2-cache.xml  | 10 +-
 .../hibernate/HibernateL2CacheExampleNodeStartup.java |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13b2736f/examples/config/hibernate/example-hibernate-L2-cache.xml
--
diff --git a/examples/config/hibernate/example-hibernate-L2-cache.xml 
b/examples/config/hibernate/example-hibernate-L2-cache.xml
index 324c040..8966236 100644
--- a/examples/config/hibernate/example-hibernate-L2-cache.xml
+++ b/examples/config/hibernate/example-hibernate-L2-cache.xml
@@ -56,12 +56,12 @@
 READ_ONLY
 
 
-
-
+
+
 
 
-
-
-
+
+
+
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13b2736f/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
index cf9b67c..49734ba 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
@@ -69,9 +69,9 @@ public class HibernateL2CacheExampleNodeStartup {
 cfg.setCacheConfiguration(
 
cacheConfiguration("org.hibernate.cache.spi.UpdateTimestampsCache", ATOMIC),
 
cacheConfiguration("org.hibernate.cache.internal.StandardQueryCache", ATOMIC),
-
cacheConfiguration("org.apache.ignite.examples.datagrid.hibernate.User", 
TRANSACTIONAL),
-
cacheConfiguration("org.apache.ignite.examples.datagrid.hibernate.User.posts", 
TRANSACTIONAL),
-
cacheConfiguration("org.apache.ignite.examples.datagrid.hibernate.Post", 
TRANSACTIONAL)
+
cacheConfiguration("org.apache.ignite.examples.java7.datagrid.hibernate.User", 
TRANSACTIONAL),
+
cacheConfiguration("org.apache.ignite.examples.java7.datagrid.hibernate.User.posts",
 TRANSACTIONAL),
+
cacheConfiguration("org.apache.ignite.examples.java7.datagrid.hibernate.Post", 
TRANSACTIONAL)
 );
 
 return cfg;



[2/3] incubator-ignite git commit: # IGNITE-330 Reworked snippet generation and create demo sources.

2015-03-21 Thread akuznetsov
# IGNITE-330 Reworked snippet generation and create demo sources.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e2920698
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e2920698
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e2920698

Branch: refs/heads/ignite-45
Commit: e292069832dcf220ca356c8f46516d187f8be45d
Parents: 533c0e4
Author: AKuznetsov 
Authored: Sat Mar 21 23:28:19 2015 +0700
Committer: AKuznetsov 
Committed: Sat Mar 21 23:28:19 2015 +0700

--
 examples/schema-import/pom.xml  | 91 
 .../org/apache/ignite/ConfigurationSnippet.java | 38 
 .../src/main/java/org/apache/ignite/Demo.java   | 56 
 .../src/main/java/org/apache/ignite/Person.java | 33 +++
 .../main/java/org/apache/ignite/PersonKey.java  | 31 +++
 .../ignite/schema/generator/CodeGenerator.java  | 59 -
 .../ignite/schema/ui/SchemaImportApp.java   |  2 +-
 7 files changed, 267 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2920698/examples/schema-import/pom.xml
--
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
new file mode 100644
index 000..5f335c3
--- /dev/null
+++ b/examples/schema-import/pom.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+http://maven.apache.org/POM/4.0.0";
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+4.0.0
+
+
+UTF-8
+1.0.0
+
+
+org.apache.ignite
+ignite-schema-import-demo
+${ignite.version}
+
+
+
+javax.cache
+cache-api
+1.0.0
+
+
+
+org.apache.ignite
+ignite-core
+${ignite.version}
+
+
+
+org.apache.ignite
+ignite-spring
+${ignite.version}
+
+
+
+org.apache.ignite
+ignite-log4j
+${ignite.version}
+
+
+
+org.apache.ignite
+ignite-indexing
+${ignite.version}
+
+
+
+
+
+
+src/main/java
+
+**/*.java
+
+
+
+
+
+
+maven-compiler-plugin
+3.1
+
+1.7
+1.7
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2920698/examples/schema-import/src/main/java/org/apache/ignite/ConfigurationSnippet.java
--
diff --git 
a/examples/schema-import/src/main/java/org/apache/ignite/ConfigurationSnippet.java
 
b/examples/schema-import/src/main/java/org/apache/ignite/ConfigurationSnippet.java
new file mode 100644
index 000..640beb1
--- /dev/null
+++ 
b/examples/schema-import/src/main/java/org/apache/ignite/ConfigurationSnippet.java
@@ -0,0 +1,38 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
+
+import java.util.*;
+
+/**
+ * ConfigurationSnippet stub. Will be generated by Ignite Schema Import 
Utility.
+ */
+public class ConfigurationSnippet {
+/** Configure cache store. */
+public static CacheStore store() {
+throw new IllegalStateException("ConfigurationSnippet should be 
generated by Ignite Schema Import Utility");
+}
+
+/** Configure cache types metadata. */
+public static Collection typeMetadata() {
+throw new IllegalStateException("ConfigurationSnippet should be 
generated by Ignite Schema Import Utility");
+}
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2920698/ex

[3/3] incubator-ignite git commit: # IGNITE-330 Adjusted out folder and package.

2015-03-21 Thread akuznetsov
# IGNITE-330 Adjusted out folder and package.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/51f75909
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/51f75909
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/51f75909

Branch: refs/heads/ignite-45
Commit: 51f75909b751f765947a96adbe49658aa20e4806
Parents: e292069
Author: AKuznetsov 
Authored: Sat Mar 21 23:30:05 2015 +0700
Committer: AKuznetsov 
Committed: Sat Mar 21 23:30:05 2015 +0700

--
 examples/schema-import/bin/schema-import.bat | 4 ++--
 examples/schema-import/bin/schema-import.sh  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51f75909/examples/schema-import/bin/schema-import.bat
--
diff --git a/examples/schema-import/bin/schema-import.bat 
b/examples/schema-import/bin/schema-import.bat
index 11cd688..1ac78af 100644
--- a/examples/schema-import/bin/schema-import.bat
+++ b/examples/schema-import/bin/schema-import.bat
@@ -81,8 +81,8 @@ if exist "%IGNITE_HOME%\config" goto run
  jdbc.driver.class=org.h2.Driver ^
  jdbc.url="jdbc:h2:tcp://localhost/%IGNITE_HOME%\examples\schema-import\demo" ^
  jdbc.user=sa ^
- out.folder="%IGNITE_HOME%\examples\src\main\java" ^
- pojo.package=org.apache.ignite.examples.schema ^
+ out.folder="%IGNITE_HOME%\examples\schema-import\src\main\java" ^
+ pojo.package=org.apache.ignite ^
  pojo.constructor=true
 
 :error_finish

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51f75909/examples/schema-import/bin/schema-import.sh
--
diff --git a/examples/schema-import/bin/schema-import.sh 
b/examples/schema-import/bin/schema-import.sh
index 9747929..e3cd9bd 100644
--- a/examples/schema-import/bin/schema-import.sh
+++ b/examples/schema-import/bin/schema-import.sh
@@ -52,6 +52,6 @@ setIgniteHome
  jdbc.driver.class=org.h2.Driver \
  jdbc.url="jdbc:h2:tcp://localhost/${IGNITE_HOME}/examples/schema-import/demo" 
\
  jdbc.user=sa \
- out.folder="${IGNITE_HOME}/examples/src/main/java" \
- pojo.package=org.apache.ignite.examples.schema \
+ out.folder="${IGNITE_HOME}/examples/schema-import/src/main/java" \
+ pojo.package=org.apache.ignite \
  pojo.constructor=true



[1/3] incubator-ignite git commit: # IGNITE-330 Moved cmd files to bin folder.

2015-03-21 Thread akuznetsov
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 13b2736f8 -> 51f75909b


# IGNITE-330 Moved cmd files to bin folder.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/533c0e45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/533c0e45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/533c0e45

Branch: refs/heads/ignite-45
Commit: 533c0e457fa9d9f4d7a3427fda6af587ab09ff94
Parents: 13b2736
Author: AKuznetsov 
Authored: Sat Mar 21 22:22:10 2015 +0700
Committer: AKuznetsov 
Committed: Sat Mar 21 22:22:10 2015 +0700

--
 examples/schema-import/bin/h2-server.bat | 80 +
 examples/schema-import/bin/h2-server.sh  | 63 
 examples/schema-import/bin/schema-import.bat | 88 +++
 examples/schema-import/bin/schema-import.sh  | 57 +++
 examples/schema-import/h2-server.bat | 80 -
 examples/schema-import/h2-server.sh  | 63 
 examples/schema-import/schema-import.bat | 88 ---
 examples/schema-import/schema-import.sh  | 57 ---
 8 files changed, 288 insertions(+), 288 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/533c0e45/examples/schema-import/bin/h2-server.bat
--
diff --git a/examples/schema-import/bin/h2-server.bat 
b/examples/schema-import/bin/h2-server.bat
new file mode 100644
index 000..3f220d1
--- /dev/null
+++ b/examples/schema-import/bin/h2-server.bat
@@ -0,0 +1,80 @@
+::
+:: 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 KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+
+::
+:: Starts H2 database server and console for Ignite Schema Import demo.
+::
+
+@echo off
+
+if "%OS%" == "Windows_NT"  setlocal
+
+:: Check JAVA_HOME.
+if not "%JAVA_HOME%" == "" goto checkJdk
+echo %0, ERROR: JAVA_HOME environment variable is not found.
+echo %0, ERROR: Please create JAVA_HOME variable pointing to location of 
JDK 1.7 or JDK 1.8.
+echo %0, ERROR: You can also download latest JDK at: 
http://java.sun.com/getjava
+goto error_finish
+
+:checkJdk
+:: Check that JDK is where it should be.
+if exist "%JAVA_HOME%\bin\java.exe" goto checkJdkVersion
+echo %0, ERROR: The JDK is not found in %JAVA_HOME%.
+echo %0, ERROR: Please modify your script so that JAVA_HOME would point to 
valid location of JDK.
+goto error_finish
+
+:checkJdkVersion
+"%JAVA_HOME%\bin\java.exe" -version 2>&1 | findstr "1\.[78]\." > nul
+if %ERRORLEVEL% equ 0 goto checkIgniteHome1
+echo %0, ERROR: The version of JAVA installed in %JAVA_HOME% is incorrect.
+echo %0, ERROR: Please install JDK 1.7 or 1.8.
+echo %0, ERROR: You can also download latest JDK at: 
http://java.sun.com/getjava
+goto error_finish
+
+:: Check IGNITE_HOME.
+:checkIgniteHome1
+if not "%IGNITE_HOME%" == "" goto checkIgniteHome2
+pushd "%~dp0"/../../..
+set IGNITE_HOME=%CD%
+popd
+
+:checkIgniteHome2
+:: Strip double quotes from IGNITE_HOME
+set IGNITE_HOME=%IGNITE_HOME:"=%
+
+:: remove all trailing slashes from IGNITE_HOME.
+if %IGNITE_HOME:~-1,1% == \ goto removeTrailingSlash
+if %IGNITE_HOME:~-1,1% == / goto removeTrailingSlash
+goto checkIgniteHome3
+
+:removeTrailingSlash
+set IGNITE_HOME=%IGNITE_HOME:~0,-1%
+goto checkIgniteHome2
+
+:checkIgniteHome3
+if exist "%IGNITE_HOME%\config" goto run
+echo %0, ERROR: Ignite installation folder is not found or IGNITE_HOME 
environment variable is not valid.
+echo Please create IGNITE_HOME environment variable pointing to location of
+echo Ignite installation folder.
+goto error_finish
+
+:run
+
+:: Starts H2 server and console.
+"%JAVA_HOME%\bin\java.exe" -cp 
"%IGNITE_HOME%\libs\ignite-indexing\h2-1.3.175.jar" org.h2.tools.Console %*
+
+:error_finish
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/533c0e45/examples/schema-import/bin/h2-server.sh
--

incubator-ignite git commit: # ignite-45 - copied streaming to java7.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 51f75909b -> b97bc6690


# ignite-45 - copied streaming to java7.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b97bc669
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b97bc669
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b97bc669

Branch: refs/heads/ignite-45
Commit: b97bc6690f60cf8d723c2c656ca21dc3f247965c
Parents: 51f7590
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 11:42:32 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 11:42:32 2015 -0700

--
 .../java7/streaming/marketdata/CacheConfig.java |  45 
 .../java7/streaming/marketdata/Instrument.java  | 106 +++
 .../java7/streaming/marketdata/MarketTick.java  |  59 +++
 .../marketdata/QueryTopInstruments.java |  73 +
 .../streaming/marketdata/StreamMarketData.java  | 105 ++
 .../java7/streaming/numbers/CacheConfig.java|  46 
 .../streaming/numbers/QueryPopularNumbers.java  |  74 +
 .../streaming/numbers/StreamRandomNumbers.java  |  79 ++
 .../java8/streaming/marketdata/Instrument.java  |  14 +--
 .../marketdata/QueryTopInstruments.java |   9 +-
 .../streaming/marketdata/StreamMarketData.java  |  11 +-
 11 files changed, 604 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b97bc669/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
new file mode 100644
index 000..9b1c096
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
@@ -0,0 +1,45 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.java7.streaming.marketdata;
+
+import org.apache.ignite.configuration.*;
+
+/**
+ * Configuration for the streaming cache to store the stream of random numbers.
+ * This cache is configured with sliding window of 1 second, which means that
+ * data older than 1 second will be automatically removed from the cache.
+ */
+public class CacheConfig {
+/** Cache name. */
+public static final String STREAM_NAME = "marketTicks";
+
+/**
+ * Configure streaming cache.
+ */
+public static CacheConfiguration marketTicksCache() {
+return new CacheConfiguration<>("marketTicks");
+}
+
+public static CacheConfiguration instrumentCache() {
+CacheConfiguration instCache = new 
CacheConfiguration<>("instCache");
+
+instCache.setIndexedTypes(String.class, Instrument.class);
+
+return instCache;
+}
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b97bc669/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/Instrument.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/Instrument.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/Instrument.java
new file mode 100644
index 000..e51e4b9
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/Instrument.java
@@ -0,0 +1,106 @@
+/*
+ * 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://

incubator-ignite git commit: # ignite-45 - copied streaming to java7.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 b97bc6690 -> 7a68a0678


# ignite-45 - copied streaming to java7.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7a68a067
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7a68a067
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7a68a067

Branch: refs/heads/ignite-45
Commit: 7a68a06787d398089ff5a44f86112a967b8b7ab0
Parents: b97bc66
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 11:47:09 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 11:47:09 2015 -0700

--
 .../java7/streaming/marketdata/CacheConfig.java| 13 ++---
 .../java8/streaming/marketdata/CacheConfig.java| 13 ++---
 2 files changed, 12 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a68a067/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
index 9b1c096..3c00dcd 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/CacheConfig.java
@@ -20,24 +20,23 @@ package 
org.apache.ignite.examples.java7.streaming.marketdata;
 import org.apache.ignite.configuration.*;
 
 /**
- * Configuration for the streaming cache to store the stream of random numbers.
- * This cache is configured with sliding window of 1 second, which means that
- * data older than 1 second will be automatically removed from the cache.
+ * Configuration for the streaming caches for market data and financial 
instruments.
  */
 public class CacheConfig {
-/** Cache name. */
-public static final String STREAM_NAME = "marketTicks";
-
 /**
- * Configure streaming cache.
+ * Configure streaming cache for market ticks.
  */
 public static CacheConfiguration marketTicksCache() {
 return new CacheConfiguration<>("marketTicks");
 }
 
+/**
+ * Configure cache for financial instruments.
+ */
 public static CacheConfiguration instrumentCache() {
 CacheConfiguration instCache = new 
CacheConfiguration<>("instCache");
 
+// Index some fields for querying portfolio positions.
 instCache.setIndexedTypes(String.class, Instrument.class);
 
 return instCache;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a68a067/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
index 90bdcf1..592f5cc 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/CacheConfig.java
@@ -20,24 +20,23 @@ package 
org.apache.ignite.examples.java8.streaming.marketdata;
 import org.apache.ignite.configuration.*;
 
 /**
- * Configuration for the streaming cache to store the stream of random numbers.
- * This cache is configured with sliding window of 1 second, which means that
- * data older than 1 second will be automatically removed from the cache.
+ * Configuration for the streaming caches for market data and financial 
instruments.
  */
 public class CacheConfig {
-/** Cache name. */
-public static final String STREAM_NAME = "marketTicks";
-
 /**
- * Configure streaming cache.
+ * Configure streaming cache for market ticks.
  */
 public static CacheConfiguration marketTicksCache() {
 return new CacheConfiguration<>("marketTicks");
 }
 
+/**
+ * Configure cache for financial instruments.
+ */
 public static CacheConfiguration instrumentCache() {
 CacheConfiguration instCache = new 
CacheConfiguration<>("instCache");
 
+// Index some fields for querying portfolio positions.
 instCache.setIndexedTypes(String.class, Instrument.class);
 
 return instCache;



incubator-ignite git commit: # ignite-45 - copied streaming to java7.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 7a68a0678 -> 9b3b2bdb0


# ignite-45 - copied streaming to java7.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9b3b2bdb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9b3b2bdb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9b3b2bdb

Branch: refs/heads/ignite-45
Commit: 9b3b2bdb0f4e070083f75bb0d0ea0d8bffbd8e14
Parents: 7a68a06
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 12:13:00 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 12:13:00 2015 -0700

--
 .../streaming/marketdata/StreamMarketData.java  | 23 
 .../streaming/marketdata/StreamMarketData.java  |  1 +
 2 files changed, 15 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b3b2bdb/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
index 469f510..dd4c069 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
@@ -19,6 +19,7 @@ package org.apache.ignite.examples.java7.streaming.marketdata;
 
 import org.apache.ignite.*;
 import org.apache.ignite.examples.java8.*;
+import org.apache.ignite.lang.*;
 import org.apache.ignite.stream.*;
 
 import java.util.*;
@@ -62,19 +63,23 @@ public class StreamMarketData {
 try (IgniteDataStreamer stmr = 
ignite.dataStreamer(mktCache.getName())) {
 // Note that we receive market data, but do not populate 
'mktCache' (it remains empty).
 // Instead we update the instruments in the 'instCache'.
-stmr.receiver(new StreamVisitor<>((cache, e) -> {
-String symbol = e.getKey();
-MarketTick tick = e.getValue();
+stmr.receiver(new StreamVisitor<>(new 
IgniteBiInClosure, Map.Entry>() {
+@Override
+public void apply(IgniteCache 
mktCache, Map.Entry e) {
+String symbol = e.getKey();
+MarketTick tick = e.getValue();
 
-Instrument inst = instCache.get(symbol);
+Instrument inst = instCache.get(symbol);
 
-if (inst == null)
-inst = new Instrument(symbol);
+if (inst == null)
+inst = new Instrument(symbol);
 
-// Update cached instrument based on the latest market 
tick.
-inst.update(tick);
+// Don't populate market cache, as we don't use it for 
querying.
+// Update cached instrument based on the latest market 
tick.
+inst.update(tick);
 
-instCache.put(symbol, inst);
+instCache.put(symbol, inst);
+}
 }));
 
 // Stream market data into market data stream cache.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9b3b2bdb/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
index 104ed17..5b7f91f 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
@@ -71,6 +71,7 @@ public class StreamMarketData {
 if (inst == null)
 inst = new Instrument(symbol);
 
+// Don't populate market cache, as we don't use it for 
querying.
 // Update cached instrument based on the latest market 
tick.
 inst.update(tick);
 



incubator-ignite git commit: # ignite-45 - copied streaming to java7.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 9b3b2bdb0 -> 46431f8ed


# ignite-45 - copied streaming to java7.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/46431f8e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/46431f8e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/46431f8e

Branch: refs/heads/ignite-45
Commit: 46431f8ed2f77c34e237e270f459bd785b0fc8e5
Parents: 9b3b2bd
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 12:23:21 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 12:23:21 2015 -0700

--
 .../examples/java7/streaming/marketdata/StreamMarketData.java  | 6 +++---
 .../examples/java8/streaming/marketdata/StreamMarketData.java  | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/46431f8e/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
index dd4c069..772c59d 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
@@ -60,10 +60,10 @@ public class StreamMarketData {
 IgniteCache mktCache = 
ignite.getOrCreateCache(CacheConfig.marketTicksCache());
 IgniteCache instCache = 
ignite.getOrCreateCache(CacheConfig.instrumentCache());
 
-try (IgniteDataStreamer stmr = 
ignite.dataStreamer(mktCache.getName())) {
+try (IgniteDataStreamer mktStmr = 
ignite.dataStreamer(mktCache.getName())) {
 // Note that we receive market data, but do not populate 
'mktCache' (it remains empty).
 // Instead we update the instruments in the 'instCache'.
-stmr.receiver(new StreamVisitor<>(new 
IgniteBiInClosure, Map.Entry>() {
+mktStmr.receiver(new StreamVisitor<>(new 
IgniteBiInClosure, Map.Entry>() {
 @Override
 public void apply(IgniteCache 
mktCache, Map.Entry e) {
 String symbol = e.getKey();
@@ -91,7 +91,7 @@ public class StreamMarketData {
 
 MarketTick tick = new MarketTick(INSTRUMENTS[j], 
price);
 
-stmr.addData(tick.symbol(), tick);
+mktStmr.addData(tick.symbol(), tick);
 }
 }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/46431f8e/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
index 5b7f91f..ccec740 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
@@ -59,10 +59,10 @@ public class StreamMarketData {
 IgniteCache mktCache = 
ignite.getOrCreateCache(CacheConfig.marketTicksCache());
 IgniteCache instCache = 
ignite.getOrCreateCache(CacheConfig.instrumentCache());
 
-try (IgniteDataStreamer stmr = 
ignite.dataStreamer(mktCache.getName())) {
+try (IgniteDataStreamer mktStmr = 
ignite.dataStreamer(mktCache.getName())) {
 // Note that we receive market data, but do not populate 
'mktCache' (it remains empty).
 // Instead we update the instruments in the 'instCache'.
-stmr.receiver(new StreamVisitor<>((cache, e) -> {
+mktStmr.receiver(new StreamVisitor<>((cache, e) -> {
 String symbol = e.getKey();
 MarketTick tick = e.getValue();
 
@@ -87,7 +87,7 @@ public class StreamMarketData {
 
 MarketTick tick = new MarketTick(INSTRUMENTS[j], 
price);
 
-stmr.addData(tick.symbol(), tick);
+mktStmr.addData(tick.symbol(), tick);
 }
 }
 }



[3/3] incubator-ignite git commit: Merge branch 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-45

2015-03-21 Thread agoncharuk
Merge branch 'sprint-2' of 
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9dde6c14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9dde6c14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9dde6c14

Branch: refs/heads/ignite-45
Commit: 9dde6c14799e946092572bea540b213b19d614f8
Parents: 2df67c5 6837e12
Author: Alexey Goncharuk 
Authored: Sat Mar 21 12:44:37 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 12:44:37 2015 -0700

--

--




[1/3] incubator-ignite git commit: Remove square brackes from copyright year in NOTICE.txt. (cherry picked from commit 1b0b998)

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 46431f8ed -> 9dde6c147


Remove square brackes from copyright year in NOTICE.txt.
(cherry picked from commit 1b0b998)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6837e129
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6837e129
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6837e129

Branch: refs/heads/ignite-45
Commit: 6837e1294718dbf4337b8d35be06f36ae955bc4f
Parents: 6dbffbe
Author: Branko Čibej 
Authored: Fri Mar 20 03:03:28 2015 -0700
Committer: Valentin Kulichenko 
Committed: Fri Mar 20 21:22:36 2015 -0700

--
 NOTICE.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6837e129/NOTICE.txt
--
diff --git a/NOTICE.txt b/NOTICE.txt
index 7ca4e12..256cf7d 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
 Apache Ignite (incubating)
-Copyright [2015] The Apache Software Foundation
+Copyright 2015 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).



[2/3] incubator-ignite git commit: IGNITE-45 - Fixed java7 examples.

2015-03-21 Thread agoncharuk
IGNITE-45 - Fixed java7 examples.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2df67c56
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2df67c56
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2df67c56

Branch: refs/heads/ignite-45
Commit: 2df67c567631819f105d3f8df82412522fdb9964
Parents: 46431f8
Author: Alexey Goncharuk 
Authored: Sat Mar 21 12:43:33 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 12:43:33 2015 -0700

--
 .../ignite/examples/java7/ExamplesUtils.java| 54 
 .../marketdata/QueryTopInstruments.java |  2 +-
 .../streaming/marketdata/StreamMarketData.java  |  5 +-
 .../streaming/numbers/QueryPopularNumbers.java  |  2 +-
 .../streaming/numbers/StreamRandomNumbers.java  |  2 +-
 5 files changed, 60 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2df67c56/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java 
b/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java
index 3abb385..452979f 100644
--- a/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java
+++ b/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java
@@ -17,9 +17,11 @@
 
 package org.apache.ignite.examples.java7;
 
+import org.apache.ignite.Ignite;
 import org.apache.ignite.cluster.*;
 
 import java.net.*;
+import java.util.List;
 
 /**
  *
@@ -78,4 +80,56 @@ public class ExamplesUtils {
 
 return true;
 }
+
+
+/**
+ * Checks if cluster has server nodes.
+ *
+ * @param ignite Ignite instance.
+ * @return {@code True} if cluster has server nodes, {@code false} 
otherwise.
+ */
+public static boolean hasServerNodes(Ignite ignite) {
+if (ignite.cluster().forServers().nodes().isEmpty()) {
+System.err.println("Server nodes not found (start data nodes with 
ExampleNodeStartup class)");
+
+return false;
+}
+
+return true;
+}
+
+/**
+ * Convenience method for printing query results.
+ *
+ * @param res Query results.
+ */
+public static void printQueryResults(List res) {
+if (res == null || res.isEmpty())
+System.out.println("Query result set is empty.");
+else {
+for (Object row : res) {
+if (row instanceof List) {
+System.out.print("(");
+
+List l = (List)row;
+
+for (int i = 0; i < l.size(); i++) {
+Object o = l.get(i);
+
+if (o instanceof Double || o instanceof Float)
+System.out.printf("%.2f", o);
+else
+System.out.print(l.get(i));
+
+if (i + 1 != l.size())
+System.out.print(',');
+}
+
+System.out.println(')');
+}
+else
+System.out.println("  " + row);
+}
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2df67c56/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/QueryTopInstruments.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/QueryTopInstruments.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/QueryTopInstruments.java
index 87a1173..4b9eb00 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/QueryTopInstruments.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/QueryTopInstruments.java
@@ -19,7 +19,7 @@ package org.apache.ignite.examples.java7.streaming.marketdata;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.query.*;
-import org.apache.ignite.examples.java8.*;
+import org.apache.ignite.examples.java7.*;
 
 import java.util.*;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2df67c56/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
index 772c59d..513a2e1 100644
--- 
a/examples/src/ma

incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 9dde6c147 -> 629560086


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/62956008
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/62956008
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/62956008

Branch: refs/heads/ignite-45
Commit: 629560086e9face071aeb3dc4f945dc779de8041
Parents: 9dde6c1
Author: Valentin Kulichenko 
Authored: Sat Mar 21 13:43:00 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 13:43:00 2015 -0700

--
 .../streaming/marketdata/StreamMarketData.java  |  8 ++---
 .../streaming/marketdata/StreamMarketData.java  |  2 +-
 .../org/apache/ignite/stream/StreamVisitor.java | 36 
 3 files changed, 26 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/62956008/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
index 513a2e1..6d46f04 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/java7/streaming/marketdata/StreamMarketData.java
@@ -18,9 +18,7 @@
 package org.apache.ignite.examples.java7.streaming.marketdata;
 
 import org.apache.ignite.*;
-import org.apache.ignite.examples.streaming.numbers.ExamplesUtils;
 import org.apache.ignite.examples.java7.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.stream.*;
 
 import java.util.*;
@@ -64,9 +62,9 @@ public class StreamMarketData {
 try (IgniteDataStreamer mktStmr = 
ignite.dataStreamer(mktCache.getName())) {
 // Note that we receive market data, but do not populate 
'mktCache' (it remains empty).
 // Instead we update the instruments in the 'instCache'.
-mktStmr.receiver(new StreamVisitor<>(new 
IgniteBiInClosure, Map.Entry>() {
+mktStmr.receiver(new StreamVisitor() {
 @Override
-public void apply(IgniteCache 
mktCache, Map.Entry e) {
+public void visit(IgniteCache 
mktCache, Map.Entry e) {
 String symbol = e.getKey();
 MarketTick tick = e.getValue();
 
@@ -81,7 +79,7 @@ public class StreamMarketData {
 
 instCache.put(symbol, inst);
 }
-}));
+});
 
 // Stream market data into market data stream cache.
 while (true) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/62956008/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
index ccec740..ed2a25a 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/marketdata/StreamMarketData.java
@@ -62,7 +62,7 @@ public class StreamMarketData {
 try (IgniteDataStreamer mktStmr = 
ignite.dataStreamer(mktCache.getName())) {
 // Note that we receive market data, but do not populate 
'mktCache' (it remains empty).
 // Instead we update the instruments in the 'instCache'.
-mktStmr.receiver(new StreamVisitor<>((cache, e) -> {
+mktStmr.receiver(StreamVisitor.from((cache, e) -> {
 String symbol = e.getKey();
 MarketTick tick = e.getValue();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/62956008/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java 
b/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
index 0474278..105607a 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
@@ -27,27 +27,35 @@ import java.util.*;
  * does not update the c

incubator-ignite git commit: IGNITE-45 - Fixed version comparison in PRIMARY mode.

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 629560086 -> 963e9c261


IGNITE-45 - Fixed version comparison in PRIMARY mode.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/963e9c26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/963e9c26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/963e9c26

Branch: refs/heads/ignite-45
Commit: 963e9c26185e631186d9d2935445845f239f403b
Parents: 6295600
Author: Alexey Goncharuk 
Authored: Sat Mar 21 14:22:18 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 14:22:18 2015 -0700

--
 .../affinity/GridAffinityProcessor.java | 12 --
 .../cache/GridCacheAtomicVersionComparator.java | 21 +
 .../processors/cache/GridCacheMapEntry.java | 24 
 .../GridCacheVersionConflictResolver.java   |  2 +-
 4 files changed, 26 insertions(+), 33 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/963e9c26/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
index 82491a6..869f30e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
@@ -131,18 +131,6 @@ public class GridAffinityProcessor extends 
GridProcessorAdapter {
 }
 
 /**
- * Maps keys to nodes on default cache.
- *
- * @param keys Keys to map.
- * @return Map of nodes to keys.
- * @throws IgniteCheckedException If failed.
- */
-public  Map> mapKeysToNodes(@Nullable 
Collection keys)
-throws IgniteCheckedException {
-return keysToNodes(null, keys);
-}
-
-/**
  * Maps single key to a node.
  *
  * @param cacheName Cache name.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/963e9c26/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
index 56feb9c..3a06100 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
@@ -19,18 +19,19 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.internal.processors.cache.version.*;
 
-import java.io.*;
-import java.util.*;
-
 /**
  * Atomic cache version comparator.
  */
-public class GridCacheAtomicVersionComparator implements 
Comparator, Serializable {
-/** */
-private static final long serialVersionUID = 0L;
-
-/** {@inheritDoc} */
-@Override public int compare(GridCacheVersion one, GridCacheVersion other) 
{
+public class GridCacheAtomicVersionComparator {
+/**
+ * Compares two cache versions.
+ *
+ * @param one First version.
+ * @param other Second version.
+ * @param ignoreTime {@code True} if global time should be ignored.
+ * @return Comparison value.
+ */
+public int compare(GridCacheVersion one, GridCacheVersion other, boolean 
ignoreTime) {
 int topVer = one.topologyVersion();
 int otherTopVer = other.topologyVersion();
 
@@ -38,7 +39,7 @@ public class GridCacheAtomicVersionComparator implements 
Comparatorhttp://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/963e9c26/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index a52c7e0..4ca6ba5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -63,7 +63,7 @@ public abstract class GridCacheMapEntry implements 
GridCacheEntryEx {
 private static final byte IS_UNS

[12/12] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread vkulichenko
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/aa676326
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/aa676326
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/aa676326

Branch: refs/heads/ignite-45
Commit: aa6763269a04b837be1a4fda578f1cda767fcc6a
Parents: b473e30 963e9c2
Author: Valentin Kulichenko 
Authored: Sat Mar 21 14:59:42 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 14:59:42 2015 -0700

--
 .../affinity/GridAffinityProcessor.java | 12 --
 .../cache/GridCacheAtomicVersionComparator.java | 21 +
 .../processors/cache/GridCacheMapEntry.java | 24 
 .../GridCacheVersionConflictResolver.java   |  2 +-
 4 files changed, 26 insertions(+), 33 deletions(-)
--




[09/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
new file mode 100644
index 000..7ba7ea1
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
@@ -0,0 +1,204 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.datagrid.hibernate;
+
+import org.apache.ignite.*;
+import org.apache.ignite.examples.*;
+import org.hibernate.*;
+import org.hibernate.cache.spi.access.AccessType;
+import org.hibernate.cfg.*;
+import org.hibernate.service.*;
+import org.hibernate.stat.*;
+
+import java.net.*;
+import java.util.*;
+
+/**
+ * This example demonstrates the use of Ignite In-Memory Data Ignite cluster 
as a Hibernate
+ * Second-Level cache provider.
+ * 
+ * The Hibernate Second-Level cache (or "L2 cache" shortly) lets you 
significantly
+ * reduce the number of requests to the underlying SQL database. Because 
database
+ * access is known to be an expansive operation, using L2 cache may improve
+ * performance dramatically.
+ * 
+ * This example defines 2 entity classes: {@link User} and {@link Post}, with
+ * 1 <-> N relation, and marks them with appropriate annotations for Hibernate
+ * object-relational mapping to SQL tables of an underlying H2 in-memory 
database.
+ * The example launches node in the same JVM and registers it in
+ * Hibernate configuration as an L2 cache implementation. It then stores and
+ * queries instances of the entity classes to and from the database, having
+ * Hibernate SQL output, L2 cache statistics output, and Ignite cache metrics
+ * output enabled.
+ * 
+ * When running example, it's easy to notice that when an object is first
+ * put into a database, the L2 cache is not used and it's contents is empty.
+ * However, when an object is first read from the database, it is immediately
+ * stored in L2 cache (which is Ignite In-Memory Data Ignite cluster in fact), 
which can
+ * be seen in stats output. Further requests of the same object only read the 
data
+ * from L2 cache and do not hit the database.
+ * 
+ * In this example, the Hibernate query cache is also enabled. Query cache 
lets you
+ * avoid hitting the database in case of repetitive queries with the same 
parameter
+ * values. You may notice that when the example runs the same query repeatedly 
in
+ * loop, only the first query hits the database and the successive requests 
take the
+ * data from L2 cache.
+ * 
+ * Note: this example uses {@link AccessType#READ_ONLY} L2 cache access type, 
but you
+ * can experiment with other access types by modifying the Hibernate 
configuration file
+ * {@code 
IGNITE_HOME/examples/config/hibernate/example-hibernate-L2-cache.xml}, used by 
the example.
+ * 
+ * Remote nodes should always be started using {@link 
HibernateL2CacheExampleNodeStartup}
+ */
+public class HibernateL2CacheExample {
+/** JDBC URL for backing database (an H2 in-memory database is used). */
+private static final String JDBC_URL = 
"jdbc:h2:mem:example;DB_CLOSE_DELAY=-1";
+
+/** Path to hibernate configuration file (will be resolved from 
application {@code CLASSPATH}). */
+private static final String HIBERNATE_CFG = 
"hibernate/example-hibernate-L2-cache.xml";
+
+/** Entity names for stats output. */
+private static final List ENTITY_NAMES =
+Arrays.asList(User.class.getName(), Post.class.getName(), 
User.class.getName() + ".posts");
+
+/**
+ * Executes example.
+ *
+ * @param args Command line arguments, none required.
+ * @throws IgniteException If example execution failed.
+ */
+public static void main(String[] args) throws IgniteException {
+// Start the node, run the example, and stop the node when finished.
+try (Ignite ignite = 
Ignition.start(HibernateL2CacheExampleNodeStartup.co

[11/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b473e309
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b473e309
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b473e309

Branch: refs/heads/ignite-45
Commit: b473e309950b5388c007832b5bcfcb089f11e169
Parents: 6295600
Author: Valentin Kulichenko 
Authored: Sat Mar 21 14:59:35 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 14:59:35 2015 -0700

--
 examples/config/example-cache.xml   |  10 +-
 .../ignite/examples/ExampleNodeStartup.java |  35 ++
 .../apache/ignite/examples/ExamplesUtils.java   | 132 ++
 .../computegrid/ComputeBroadcastExample.java| 114 ++
 .../computegrid/ComputeCallableExample.java |  79 
 .../computegrid/ComputeClosureExample.java  |  77 
 .../ComputeClusterGroupsExample.java|  93 +
 .../ComputeContinuousMapperExample.java | 158 +++
 .../ComputeExecutorServiceExample.java  |  71 
 .../ComputeFibonacciContinuationExample.java| 194 +
 .../computegrid/ComputeReducerExample.java  |  89 
 .../computegrid/ComputeRunnableExample.java |  74 
 .../computegrid/ComputeScheduleExample.java |  81 
 .../computegrid/ComputeTaskMapExample.java  | 113 +
 .../computegrid/ComputeTaskSplitExample.java| 102 +
 .../failover/ComputeFailoverExample.java| 137 +++
 .../failover/ComputeFailoverNodeStartup.java|  77 
 .../computegrid/failover/package-info.java  |  22 +
 .../examples/computegrid/montecarlo/Credit.java | 110 +
 .../montecarlo/CreditRiskExample.java   | 153 +++
 .../montecarlo/CreditRiskManager.java   | 143 +++
 .../computegrid/montecarlo/package-info.java|  22 +
 .../examples/computegrid/package-info.java  |  22 +
 .../examples/datagrid/CacheAffinityExample.java | 138 +++
 .../examples/datagrid/CacheApiExample.java  | 128 ++
 .../datagrid/CacheContinuousQueryExample.java   | 107 +
 .../datagrid/CacheDataStreamerExample.java  |  91 +
 .../examples/datagrid/CacheEventsExample.java   |  99 +
 .../datagrid/CachePopularNumbersExample.java| 172 
 .../examples/datagrid/CachePutGetExample.java   | 113 +
 .../examples/datagrid/CacheQueryExample.java| 407 +++
 .../datagrid/CacheTransactionExample.java   | 148 +++
 .../hibernate/HibernateL2CacheExample.java  | 204 ++
 .../HibernateL2CacheExampleNodeStartup.java |  97 +
 .../examples/datagrid/hibernate/Post.java   | 126 ++
 .../examples/datagrid/hibernate/User.java   | 151 +++
 .../datagrid/hibernate/package-info.java|  22 +
 .../ignite/examples/datagrid/package-info.java  |  22 +
 .../starschema/CacheStarSchemaExample.java  | 244 +++
 .../datagrid/starschema/DimProduct.java | 101 +
 .../examples/datagrid/starschema/DimStore.java  | 101 +
 .../datagrid/starschema/FactPurchase.java   | 103 +
 .../datagrid/starschema/package-info.java   |  22 +
 .../store/CacheNodeWithStoreStartup.java| 155 +++
 .../datagrid/store/CacheStoreExample.java   | 107 +
 .../store/CacheStoreLoadDataExample.java|  67 +++
 .../store/dummy/CacheDummyPersonStore.java  | 120 ++
 .../datagrid/store/dummy/package-info.java  |  22 +
 .../hibernate/CacheHibernatePersonStore.java| 291 +
 .../datagrid/store/hibernate/Person.hbm.xml |  34 ++
 .../datagrid/store/hibernate/hibernate.cfg.xml  |  41 ++
 .../datagrid/store/hibernate/package-info.java  |  22 +
 .../store/jdbc/CacheJdbcPersonStore.java| 275 +
 .../store/jdbc/CacheJdbcPojoPersonStore.java|  82 
 .../datagrid/store/jdbc/package-info.java   |  22 +
 .../examples/datagrid/store/model/Person.java   | 155 +++
 .../examples/datagrid/store/package-info.java   |  22 +
 .../datastructures/IgniteAtomicLongExample.java |  74 
 .../IgniteAtomicReferenceExample.java   | 110 +
 .../IgniteAtomicSequenceExample.java|  91 +
 .../IgniteAtomicStampedExample.java | 117 ++
 .../IgniteCountDownLatchExample.java|  95 +
 .../datastructures/IgniteQueueExample.java  | 215 ++
 .../datastructures/IgniteSetExample.java| 197 +
 .../examples/datastructures/package-info.java   |  22 +
 .../ignite/examples/events/EventsExample.java   | 144 +++
 .../ignite/examples/events/package-info.java|  22 +
 .../ignite/examples/igfs/IgfsExample.java   | 278 +
 .../examples/igfs/IgfsMapReduceExample.java | 249 
 .../ignite/examples/igfs/IgfsNodeStartup.java   |  41 ++
 .../ignite/examples/igfs/package-info.java  |  22 +
 .../exam

[06/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/computegrid/montecarlo/CreditRiskManager.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/computegrid/montecarlo/CreditRiskManager.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/computegrid/montecarlo/CreditRiskManager.java
deleted file mode 100644
index 5bc3b13..000
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/computegrid/montecarlo/CreditRiskManager.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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 KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.java7.computegrid.montecarlo;
-
-import java.util.*;
-
-/**
- * This class abstracts out the calculation of risk for a credit portfolio.
- */
-@SuppressWarnings({"FloatingPointEquality"})
-public class CreditRiskManager {
-/**
- * Default randomizer with normal distribution.
- * Note that since every JVM on the cluster will have its own random
- * generator (independently initialized) the Monte-Carlo simulation
- * will be slightly skewed when performed on the ignite cluster due to 
skewed
- * normal distribution of the sub-jobs comparing to execution on the
- * local node only with single random generator. Real-life applications
- * may want to provide its own implementation of distributed random
- * generator.
- */
-private static Random rndGen = new Random();
-
-/**
- * Calculates credit risk for a given credit portfolio. This calculation 
uses
- * Monte-Carlo Simulation to produce risk value.
- *
- * @param portfolio Credit portfolio.
- * @param horizon Forecast horizon (in days).
- * @param num Number of Monte-Carlo iterations.
- * @param percentile Cutoff level.
- * @return Credit risk value, i.e. the minimal amount that creditor has to
- *  have available to cover possible defaults.
- */
-public double calculateCreditRiskMonteCarlo(Credit[] portfolio, int 
horizon, int num, double percentile) {
-System.out.println(">>> Calculating credit risk for portfolio [size=" 
+ portfolio.length + ", horizon=" +
-horizon + ", percentile=" + percentile + ", iterations=" + num + 
"] <<<");
-
-long start = System.currentTimeMillis();
-
-double[] losses = calculateLosses(portfolio, horizon, num);
-
-Arrays.sort(losses);
-
-double[] lossProbs = new double[losses.length];
-
-// Count variational numbers.
-// Every next one either has the same value or previous one plus 
probability of loss.
-for (int i = 0; i < losses.length; i++)
-if (i == 0)
-// First time it's just a probability of first value.
-lossProbs[i] = getLossProbability(losses, 0);
-else if (losses[i] != losses[i - 1])
-// Probability of this loss plus previous one.
-lossProbs[i] = getLossProbability(losses, i) + lossProbs[i - 
1];
-else
-// The same loss the same probability.
-lossProbs[i] = lossProbs[i - 1];
-
-// Count percentile.
-double crdRisk = 0;
-
-for (int i = 0; i < lossProbs.length; i++)
-if (lossProbs[i] > percentile) {
-crdRisk = losses[i - 1];
-
-break;
-}
-
-System.out.println(">>> Finished calculating portfolio risk [risk=" + 
crdRisk +
-", time=" + (System.currentTimeMillis() - start) + "ms]");
-
-return crdRisk;
-}
-
-/**
- * Calculates losses for the given credit portfolio using Monte-Carlo 
Simulation.
- * Simulates probability of default only.
- *
- * @param portfolio Credit portfolio.
- * @param horizon Forecast horizon.
- * @param num Number of Monte-Carlo iterations.
- * @return Losses array simulated by Monte Carlo method.
- */
-private double[] calculateLosses(Credit[] portfolio, int horizon, int num) 
{
-double[] losses = new double[num];
-
-// Count losses using Monte-Carlo method. 

[04/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicLongExample.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicLongExample.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicLongExample.java
deleted file mode 100644
index 5e99393..000
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicLongExample.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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 KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.java7.datastructures;
-
-import org.apache.ignite.*;
-import org.apache.ignite.examples.java7.*;
-import org.apache.ignite.lang.*;
-
-import java.util.*;
-
-/**
- * Demonstrates a simple usage of distributed atomic long.
- * 
- * Remote nodes should always be started with special configuration file which
- * enables P2P class loading: {@code 'ignite.{sh|bat} 
examples/config/example-ignite.xml'}.
- * 
- * Alternatively you can run {@link ExampleNodeStartup} in another JVM which 
will
- * start node with {@code examples/config/example-ignite.xml} configuration.
- */
-public final class IgniteAtomicLongExample {
-/** Number of retries */
-private static final int RETRIES = 20;
-
-/**
- * Executes example.
- *
- * @param args Command line arguments, none required.
- * @throws Exception If example execution failed.
- */
-public static void main(String[] args) throws Exception {
-try (Ignite ignite = 
Ignition.start("examples/config/example-ignite.xml")) {
-System.out.println();
-System.out.println(">>> Atomic long example started.");
-
-// Make name for atomic long (by which it will be known in the 
cluster).
-String atomicName = UUID.randomUUID().toString();
-
-// Initialize atomic long.
-final IgniteAtomicLong atomicLong = ignite.atomicLong(atomicName, 
0, true);
-
-System.out.println();
-System.out.println("Atomic long initial value : " + 
atomicLong.get() + '.');
-
-// Try increment atomic long from all nodes.
-// Note that this node is also part of the ignite cluster.
-ignite.compute().broadcast(new IgniteCallable() {
-@Override public Object call() {
-for (int i = 0; i < RETRIES; i++)
-System.out.println("AtomicLong value has been 
incremented: " + atomicLong.incrementAndGet());
-
-return null;
-}
-});
-
-System.out.println();
-System.out.println("Atomic long value after successful CAS: " + 
atomicLong.get());
-}
-}
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicReferenceExample.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicReferenceExample.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicReferenceExample.java
deleted file mode 100644
index 4632a45..000
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/datastructures/IgniteAtomicReferenceExample.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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 C

[02/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
 
b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
new file mode 100644
index 000..1c24f77
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
@@ -0,0 +1,133 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.messaging;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Demonstrates simple message exchange between local and remote nodes.
+ * 
+ * To run this example you must have at least one remote node started.
+ * 
+ * Remote nodes should always be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} 
examples/config/example-ignite.xml'}.
+ * 
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which 
will start node
+ * with {@code examples/config/example-ignite.xml} configuration.
+ */
+public class MessagingPingPongExample {
+/**
+ * Executes example.
+ *
+ * @param args Command line arguments, none required.
+ * @throws Exception If example execution failed.
+ */
+public static void main(String[] args) throws Exception {
+// Game is played over the default ignite.
+try (Ignite ignite = 
Ignition.start("examples/config/example-ignite.xml")) {
+if (!ExamplesUtils.checkMinTopologySize(ignite.cluster(), 2))
+return;
+
+System.out.println();
+System.out.println(">>> Messaging ping-pong example started.");
+
+// Pick random remote node as a partner.
+ClusterGroup nodeB = ignite.cluster().forRemotes().forRandom();
+
+// Note that both nodeA and nodeB will always point to
+// same nodes regardless of whether they were implicitly
+// serialized and deserialized on another node as part of
+// anonymous closure's state during its remote execution.
+
+// Set up remote player.
+ignite.message(nodeB).remoteListen(null, new 
IgniteBiPredicate() {
+/** This will be injected on node listener comes to. */
+@IgniteInstanceResource
+private Ignite ignite;
+
+@Override public boolean apply(UUID nodeId, String rcvMsg) {
+System.out.println("Received message [msg=" + rcvMsg + ", 
sender=" + nodeId + ']');
+
+try {
+if ("PING".equals(rcvMsg)) {
+
ignite.message(ignite.cluster().forNodeId(nodeId)).send(null, "PONG");
+
+return true; // Continue listening.
+}
+
+return false; // Unsubscribe.
+}
+catch (IgniteException e) {
+throw new GridClosureException(e);
+}
+}
+});
+
+int MAX_PLAYS = 10;
+
+final CountDownLatch cnt = new CountDownLatch(MAX_PLAYS);
+
+// Set up local player.
+ignite.message().localListen(null, new IgniteBiPredicate() {
+@Override public boolean apply(UUID nodeId, String rcvMsg) {
+System.out.println("Received message [msg=" + rcvMsg + ", 
sender=" + nodeId + ']');
+
+try {
+if (cnt.getCount() == 1) {
+
ignite.message(ignite.cluster().forNodeId(nodeId)).send(null, "STOP");
+
+cnt.countDown();
+
+return false; // Stop listening.
+  

[08/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
new file mode 100644
index 000..252c037
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
@@ -0,0 +1,275 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.datagrid.store.jdbc;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.store.*;
+import org.apache.ignite.examples.datagrid.store.model.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.jetbrains.annotations.*;
+
+import javax.cache.*;
+import javax.cache.integration.*;
+import java.sql.*;
+import java.util.*;
+
+/**
+ * Example of {@link CacheStore} implementation that uses JDBC
+ * transaction with cache transactions and maps {@link Long} to {@link Person}.
+ *
+ */
+public class CacheJdbcPersonStore extends CacheStoreAdapter {
+/** Transaction metadata attribute name. */
+private static final String ATTR_NAME = "SIMPLE_STORE_CONNECTION";
+
+/** Auto-injected store session. */
+@CacheStoreSessionResource
+private CacheStoreSession ses;
+
+/**
+ * Constructor.
+ *
+ * @throws IgniteException If failed.
+ */
+public CacheJdbcPersonStore() throws IgniteException {
+prepareDb();
+}
+
+/**
+ * Prepares database for example execution. This method will create a
+ * table called "PERSONS" so it can be used by store implementation.
+ *
+ * @throws IgniteException If failed.
+ */
+private void prepareDb() throws IgniteException {
+try (Connection conn = openConnection(false); Statement st = 
conn.createStatement()) {
+st.execute("create table if not exists PERSONS (id number unique, 
firstName varchar(255), " +
+"lastName varchar(255))");
+
+conn.commit();
+}
+catch (SQLException e) {
+throw new IgniteException("Failed to create database table.", e);
+}
+}
+
+/** {@inheritDoc} */
+@Override public void txEnd(boolean commit) {
+Map props = ses.properties();
+
+try (Connection conn = props.remove(ATTR_NAME)) {
+if (conn != null) {
+if (commit)
+conn.commit();
+else
+conn.rollback();
+}
+
+System.out.println(">>> Transaction ended [commit=" + commit + 
']');
+}
+catch (SQLException e) {
+throw new CacheWriterException("Failed to end transaction: " + 
ses.transaction(), e);
+}
+}
+
+/** {@inheritDoc} */
+@Override public Person load(Long key) {
+System.out.println(">>> Loading key: " + key);
+
+Connection conn = null;
+
+try {
+conn = connection();
+
+try (PreparedStatement st = conn.prepareStatement("select * from 
PERSONS where id=?")) {
+st.setString(1, key.toString());
+
+ResultSet rs = st.executeQuery();
+
+if (rs.next())
+return new Person(rs.getLong(1), rs.getString(2), 
rs.getString(3));
+}
+}
+catch (SQLException e) {
+throw new CacheLoaderException("Failed to load object: " + key, e);
+}
+finally {
+end(conn);
+}
+
+return null;
+}
+
+/** {@inheritDoc} */
+@Override public void write(Cache.Entry 
entry) {
+Long key = entry.getKey();
+
+Person val = entry.getValue();
+
+System.out.println(">>> Putting [key=" + key + ", val=" + val +  ']');
+
+Connection conn = null;
+
+try {
+conn = connection();
+
+int updated;
+
+// Try update first. If it does not work, then try insert.
+   

[07/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/ExampleNodeStartup.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/ExampleNodeStartup.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/ExampleNodeStartup.java
deleted file mode 100644
index e4ae6c0..000
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/ExampleNodeStartup.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.java7;
-
-import org.apache.ignite.*;
-
-/**
- * Starts up an empty node with example compute configuration.
- */
-public class ExampleNodeStartup {
-/**
- * Start up an empty node with example compute configuration.
- *
- * @param args Command line arguments, none required.
- * @throws IgniteException If failed.
- */
-public static void main(String[] args) throws IgniteException {
-Ignition.start("examples/config/example-ignite.xml");
-}
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java 
b/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java
deleted file mode 100644
index 452979f..000
--- a/examples/src/main/java/org/apache/ignite/examples/java7/ExamplesUtils.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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 KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.java7;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.cluster.*;
-
-import java.net.*;
-import java.util.List;
-
-/**
- *
- */
-public class ExamplesUtils {
-/** */
-private static final ClassLoader CLS_LDR = 
ExamplesUtils.class.getClassLoader();
-
-/**
- * Exits with code {@code -1} if maximum memory is below 90% of minimally 
allowed threshold.
- *
- * @param min Minimum memory threshold.
- */
-public static void checkMinMemory(long min) {
-long maxMem = Runtime.getRuntime().maxMemory();
-
-if (maxMem < .85 * min) {
-System.err.println("Heap limit is too low (" + (maxMem / (1024 * 
1024)) +
-"MB), please increase heap size at least up to " + (min / 
(1024 * 1024)) + "MB.");
-
-System.exit(-1);
-}
-}
-
-/**
- * Returns URL resolved by class loader for classes in examples project.
- *
- * @return Resolved URL.
- */
-public static URL url(String path) {
-URL url = CLS_LDR.getResource(path);
-
-if (url == null)
-throw new RuntimeException("Failed to resolve resource URL by 
path: " + path);
-
-return url;
-}
-
-/**
- * Checks minimum topology size for running a certain example.
- *
- * @param prj Cluster to check size for.
- * @param size Minimum number of nodes required to run a certain example.
- * @return {@code True} if check passed, {@code false} otherwise.
- */
-public static boolean checkMinTopologySize(ClusterGroup prj, int size) {
-int prjSize = prj.nodes().size();
-
-if (prjSize < size) {
-System.out.println();
- 

[10/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/ComputeFailoverNodeStartup.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/ComputeFailoverNodeStartup.java
 
b/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/ComputeFailoverNodeStartup.java
new file mode 100644
index 000..bcd7db1
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/ComputeFailoverNodeStartup.java
@@ -0,0 +1,77 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.computegrid.failover;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.checkpoint.sharedfs.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.util.*;
+
+/**
+ * Starts up an empty node with checkpoint-enabled configuration.
+ * 
+ * The difference is that running this class from IDE adds all example classes 
to classpath
+ * but running from command line doesn't.
+ */
+public class ComputeFailoverNodeStartup {
+/**
+ * Start up an empty node with specified configuration.
+ *
+ * @param args Command line arguments, none required.
+ * @throws IgniteException If example execution failed.
+ */
+public static void main(String[] args) throws IgniteException {
+Ignition.start(configuration());
+}
+
+/**
+ * Create Ignite configuration with configured checkpoints.
+ *
+ * @return Ignite configuration.
+ * @throws IgniteException If configuration creation failed.
+ */
+public static IgniteConfiguration configuration() throws IgniteException {
+IgniteConfiguration cfg = new IgniteConfiguration();
+
+cfg.setLocalHost("127.0.0.1");
+cfg.setPeerClassLoadingEnabled(true);
+
+// Configure checkpoint SPI.
+SharedFsCheckpointSpi checkpointSpi = new SharedFsCheckpointSpi();
+
+
checkpointSpi.setDirectoryPaths(Collections.singletonList("work/checkpoint/sharedfs"));
+
+cfg.setCheckpointSpi(checkpointSpi);
+
+// Configure discovery SPI.
+TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
+
+ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));
+
+discoSpi.setIpFinder(ipFinder);
+
+cfg.setDiscoverySpi(discoSpi);
+
+return cfg;
+}
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/package-info.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/package-info.java
 
b/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/package-info.java
new file mode 100644
index 000..d065d52
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/computegrid/failover/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * 
+ * Compute failover example.
+ */
+package org.apache.ignite.examples.computegrid.failover;

http://git-wip-us.apache.org/repos/asf/in

[05/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/User.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/User.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/User.java
deleted file mode 100644
index 2ee6c38..000
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/User.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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 KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.java7.datagrid.hibernate;
-
-import org.hibernate.annotations.*;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.*;
-import java.util.*;
-
-/**
- * A user entity class. Represents a user of some public service,
- * having a number of personal information fields as well as a
- * number of posts written.
- */
-@Entity
-class User {
-/** ID. */
-@Id
-@GeneratedValue(strategy=GenerationType.AUTO)
-private long id;
-
-/** Login. */
-@NaturalId
-private String login;
-
-/** First name. */
-private String firstName;
-
-/** Last name. */
-private String lastName;
-
-/** Posts. */
-@OneToMany(mappedBy = "author", cascade = CascadeType.ALL)
-private Set posts = new HashSet<>();
-
-/**
- * Default constructor (required by Hibernate).
- */
-User() {
-// No-op.
-}
-
-/**
- * Constructor.
- *
- * @param login Login.
- * @param firstName First name.
- * @param lastName Last name.
- */
-User(String login, String firstName, String lastName) {
-this.login = login;
-this.firstName = firstName;
-this.lastName = lastName;
-}
-
-/**
- * @return ID.
- */
-public long getId() {
-return id;
-}
-
-/**
- * @param id New ID.
- */
-public void setId(long id) {
-this.id = id;
-}
-
-/**
- * @return Login.
- */
-public String getLogin() {
-return login;
-}
-
-/**
- * @param login New login.
- */
-public void setLogin(String login) {
-this.login = login;
-}
-
-/**
- * @return First name.
- */
-public String getFirstName() {
-return firstName;
-}
-
-/**
- * @param firstName New first name.
- */
-public void setFirstName(String firstName) {
-this.firstName = firstName;
-}
-
-/**
- * @return Last name.
- */
-public String getLastName() {
-return lastName;
-}
-
-/**
- * @param lastName New last name.
- */
-public void setLastName(String lastName) {
-this.lastName = lastName;
-}
-
-/**
- * @return Posts.
- */
-public Set getPosts() {
-return posts;
-}
-
-/**
- * @param posts New posts.
- */
-public void setPosts(Set posts) {
-this.posts = posts;
-}
-
-/** {@inheritDoc} */
-@Override public String toString() {
-return "User [id=" + id +
-", login=" + login +
-", firstName=" + firstName +
-", lastName=" + lastName +
-']';
-}
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/package-info.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/package-info.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/package-info.java
deleted file mode 100644
index 9458510..000
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/datagrid/hibernate/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 th

[01/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 963e9c261 -> aa6763269


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
 
b/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
new file mode 100644
index 000..efb5f28
--- /dev/null
+++ 
b/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
@@ -0,0 +1,79 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.streaming.numbers;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.stream.*;
+
+import javax.cache.processor.*;
+import java.util.*;
+
+/**
+ * Stream random numbers into the streaming cache.
+ * To start the example, you should:
+ * 
+ * Start a few nodes using {@link ExampleNodeStartup} or by starting 
remote nodes as specified below.
+ * Start streaming using {@link StreamRandomNumbers}.
+ * Start querying popular numbers using {@link 
QueryPopularNumbers}.
+ * 
+ * 
+ * You should start remote nodes by running {@link ExampleNodeStartup} in 
another JVM.
+ */
+public class StreamRandomNumbers {
+/** Random number generator. */
+private static final Random RAND = new Random();
+
+/** Range within which to generate numbers. */
+private static final int RANGE = 1000;
+
+public static void main(String[] args) throws Exception {
+// Mark this cluster member as client.
+Ignition.setClientMode(true);
+
+try (Ignite ignite = 
Ignition.start("examples/config/example-ignite.xml")) {
+if (!ExamplesUtils.hasServerNodes(ignite))
+return;
+
+// The cache is configured with sliding window holding 1 second of 
the streaming data.
+IgniteCache stmCache = 
ignite.getOrCreateCache(CacheConfig.randomNumbersCache());
+
+try (IgniteDataStreamer stmr = 
ignite.dataStreamer(stmCache.getName())) {
+// Allow data updates.
+stmr.allowOverwrite(true);
+
+// Configure data transformation to count instances of the 
same word.
+stmr.receiver(new StreamTransformer<>(new 
CacheEntryProcessor() {
+@Override
+public Object process(MutableEntry e, 
Object... arg) {
+Long val = e.getValue();
+
+e.setValue(val == null ? 1L : val + 1);
+
+return null;
+}
+}));
+
+// Stream random numbers into the streamer cache.
+while (true)
+stmr.addData(RAND.nextInt(RANGE), 1L);
+}
+}
+}
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java8/org/apache/ignite/examples/java8/ComputeExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/ComputeExample.java 
b/examples/src/main/java8/org/apache/ignite/examples/java8/ComputeExample.java
deleted file mode 100644
index eda875f..000
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/ComputeExample.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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 

[03/12] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b473e309/examples/src/main/java/org/apache/ignite/examples/java7/misc/client/memcache/MemcacheRestExample.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/java7/misc/client/memcache/MemcacheRestExample.java
 
b/examples/src/main/java/org/apache/ignite/examples/java7/misc/client/memcache/MemcacheRestExample.java
deleted file mode 100644
index 2ff302f..000
--- 
a/examples/src/main/java/org/apache/ignite/examples/java7/misc/client/memcache/MemcacheRestExample.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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 KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.examples.java7.misc.client.memcache;
-
-import net.spy.memcached.*;
-import org.apache.ignite.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * This example shows how to use Memcache client for manipulating Ignite cache.
- * 
- * Ignite implements Memcache binary protocol and it is available if
- * REST is enabled on the node.
- * Remote nodes should always be started using {@link 
MemcacheRestExampleNodeStartup}.
- */
-public class MemcacheRestExample {
-/** Hostname for client connection. */
-private static final String host = "localhost";
-
-/** Port number for client connection. */
-private static final int port = 11211;
-
-/**
- * @param args Command line arguments.
- * @throws Exception In case of error.
- */
-public static void main(String[] args) throws Exception {
-MemcachedClient client = null;
-
-try (Ignite ignite = 
Ignition.start(MemcacheRestExampleNodeStartup.configuration())) {
-System.out.println();
-System.out.println(">>> Memcache REST example started.");
-
-IgniteCache cache = ignite.jcache(null);
-
-client = startMemcachedClient(host, port);
-
-// Put string value to cache using Memcache binary protocol.
-if (client.add("strKey", 0, "strVal").get())
-System.out.println(">>> Successfully put string value using 
Memcache client.");
-
-// Check that string value is actually in cache using traditional
-// Ignite API and Memcache binary protocol.
-System.out.println(">>> Getting value for 'strKey' using Ignite 
cache API: " + cache.get("strKey"));
-System.out.println(">>> Getting value for 'strKey' using Memcache 
client: " + client.get("strKey"));
-
-// Remove string value from cache using Memcache binary protocol.
-if (client.delete("strKey").get())
-System.out.println(">>> Successfully removed string value 
using Memcache client.");
-
-// Check that cache is empty.
-System.out.println(">>> Current cache size: " + cache.size() + " 
(expected: 0).");
-
-// Put integer value to cache using Memcache binary protocol.
-if (client.add("intKey", 0, 100).get())
-System.out.println(">>> Successfully put integer value using 
Memcache client.");
-
-// Check that integer value is actually in cache using traditional
-// Ignite API and Memcache binary protocol.
-System.out.println(">>> Getting value for 'intKey' using Ignite 
cache API: " + cache.get("intKey"));
-System.out.println(">>> Getting value for 'intKey' using Memcache 
client: " + client.get("intKey"));
-
-// Remove string value from cache using Memcache binary protocol.
-if (client.delete("intKey").get())
-System.out.println(">>> Successfully removed integer value 
using Memcache client.");
-
-// Check that cache is empty.
-System.out.println(">>> Current cache size: " + cache.size() + " 
(expected: 0).");
-
-// Create atomic long.
-IgniteAtomicLong l = ignite.atomicLong("atomicLong", 10, true);
-
-// Increment atomic long by 5 using Memcache client.
-if (client.incr("atomicLong", 5, 0) == 15)
-System.out.println(">>> Successfully incremented atomic long 
by 5.");
-
-// In

incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 aa6763269 -> f78883332


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f7888333
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f7888333
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f7888333

Branch: refs/heads/ignite-45
Commit: f7888333242e7eaec645ba1c189203c01b239838
Parents: aa67632
Author: Valentin Kulichenko 
Authored: Sat Mar 21 16:00:39 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 16:00:39 2015 -0700

--
 examples/config/example-cache.xml   | 110 +--
 examples/rest/http-rest-example.php |   9 +--
 examples/rest/memcache-rest-example.php |   4 +-
 3 files changed, 7 insertions(+), 116 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f7888333/examples/config/example-cache.xml
--
diff --git a/examples/config/example-cache.xml 
b/examples/config/example-cache.xml
index 1cf1e2d..f34f12c 100644
--- a/examples/config/example-cache.xml
+++ b/examples/config/example-cache.xml
@@ -28,113 +28,17 @@
 -->
 http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-   xmlns:util="http://www.springframework.org/schema/util";
xsi:schemaLocation="
 http://www.springframework.org/schema/beans
-http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/util
-http://www.springframework.org/schema/util/spring-util.xsd";>
+http://www.springframework.org/schema/beans/spring-beans.xsd";>
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 
 
 
-
 
 
-
-
-
-
-java.util.UUID
-
org.apache.ignite.examples.datagrid.CacheQueryExample.Organization
-
-
-
org.apache.ignite.cache.affinity.CacheAffinityKey
-
org.apache.ignite.examples.datagrid.CacheQueryExample.Person
-
-
-java.lang.Integer
-java.lang.Long
-
-
-java.lang.Integer
-
org.apache.ignite.examples.datagrid.starschema.FactPurchase
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-java.lang.Integer
-
org.apache.ignite.examples.datagrid.starschema.DimStore
-
-
-java.lang.Integer
-
org.apache.ignite.examples.datagrid.starschema.DimProduct
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 
@@ -162,16 +66,4 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f7888333/examples/rest/http-rest-example.php
--
diff --git a/examples/rest/http-rest-example.php 
b/examples/rest/http-rest-example.php
index 30b7f2b..82504ba 100644
--- a/examples/rest/http-rest-example.php
+++ b/examples/rest/http-rest-example.php
@@ -20,15 +20,14 @@
 
 /**
  * To execute this script simply start up an instance of Ignite with cache 
enabled.
- * You can use any cache configuration from examples/config folder a

incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 f78883332 -> 08e65e9d8


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/08e65e9d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/08e65e9d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/08e65e9d

Branch: refs/heads/ignite-45
Commit: 08e65e9d80a691d3dd9d4f2a2867ab1b919356a8
Parents: f788833
Author: Valentin Kulichenko 
Authored: Sat Mar 21 17:40:59 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 17:40:59 2015 -0700

--
 .../src/main/java/org/apache/ignite/stream/StreamVisitor.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/08e65e9d/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java 
b/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
index 105607a..44bc818 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
@@ -42,8 +42,9 @@ public abstract class StreamVisitor implements 
StreamReceiver {
  *
  * @param cache Cache.
  * @param entry Visited entry.
+ * @throws IgniteException In case of error.
  */
-protected abstract void visit(IgniteCache cache, Map.Entry 
entry);
+protected abstract void visit(IgniteCache cache, Map.Entry 
entry) throws IgniteException;
 
 /**
  * Creates a new visitor based on instance of {@link IgniteBiInClosure}.



incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 08e65e9d8 -> 4230e03a1


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4230e03a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4230e03a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4230e03a

Branch: refs/heads/ignite-45
Commit: 4230e03a1502840b4000eb3ad01cc003092a2df2
Parents: 08e65e9
Author: Valentin Kulichenko 
Authored: Sat Mar 21 18:08:41 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 18:08:41 2015 -0700

--
 .../java8/datagrid/CacheAffinityExample.java| 131 +++
 .../java8/datagrid/CacheApiExample.java | 123 +
 2 files changed, 254 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4230e03a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
new file mode 100644
index 000..4aedd5a
--- /dev/null
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
@@ -0,0 +1,131 @@
+/*
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.examples.java8.datagrid;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.lang.*;
+
+import java.util.*;
+
+/**
+ * This example demonstrates the simplest code that populates the distributed 
cache
+ * and co-locates simple closure execution with each key. The goal of this 
particular
+ * example is to provide the simplest code example of this logic.
+ * 
+ * Remote nodes should always be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} 
examples/config/example-ignite.xml'}.
+ * 
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which 
will
+ * start node with {@code examples/config/example-ignite.xml} configuration.
+ */
+public final class CacheAffinityExample {
+/** Cache name. */
+private static final String CACHE_NAME = 
CacheAffinityExample.class.getSimpleName();
+
+/** Number of keys. */
+private static final int KEY_CNT = 20;
+
+/**
+ * Executes example.
+ *
+ * @param args Command line arguments, none required.
+ * @throws IgniteException If example execution failed.
+ */
+public static void main(String[] args) throws IgniteException {
+try (Ignite ignite = 
Ignition.start("examples/config/example-ignite.xml")) {
+System.out.println();
+System.out.println(">>> Cache affinity example started.");
+
+CacheConfiguration cfg = new 
CacheConfiguration<>();
+
+cfg.setCacheMode(CacheMode.PARTITIONED);
+cfg.setName(CACHE_NAME);
+
+try (IgniteCache cache = ignite.createCache(cfg)) 
{
+for (int i = 0; i < KEY_CNT; i++)
+cache.put(i, Integer.toString(i));
+
+// Co-locates jobs with data using 
IgniteCompute.affinityRun(...) method.
+visitUsingAffinityRun();
+
+// Co-locates jobs with data using 
IgniteCluster.mapKeysToNodes(...) method.
+visitUsingMapKeysToNodes();
+}
+}
+}
+
+/**
+ * Collocates jobs with keys they need to work on using
+ * {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)} 
method.
+ */
+private static void visitUsingAffinityRun() {
+Ignite ignite = Ignition.ignite();
+
+final IgniteCache cache = ignite.jcache(CACHE_NAME);
+
+for (int i = 0; i < KEY_CNT; i++)

incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 4230e03a1 -> cc3c939d2


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cc3c939d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cc3c939d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cc3c939d

Branch: refs/heads/ignite-45
Commit: cc3c939d2978d54d254c5a0aa887529d63ef75c0
Parents: 4230e03
Author: Valentin Kulichenko 
Authored: Sat Mar 21 21:03:35 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 21:03:35 2015 -0700

--
 .../streaming/numbers/StreamRandomNumbers.java  |  9 +++
 .../streaming/numbers/StreamRandomNumbers.java  |  2 +-
 .../apache/ignite/stream/StreamTransformer.java | 26 +++-
 3 files changed, 19 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc3c939d/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
 
b/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
index efb5f28..f1e55d2 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.examples.streaming.numbers;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
 import org.apache.ignite.examples.*;
 import org.apache.ignite.stream.*;
 
@@ -59,16 +58,16 @@ public class StreamRandomNumbers {
 stmr.allowOverwrite(true);
 
 // Configure data transformation to count instances of the 
same word.
-stmr.receiver(new StreamTransformer<>(new 
CacheEntryProcessor() {
-@Override
-public Object process(MutableEntry e, 
Object... arg) {
+stmr.receiver(new StreamTransformer() {
+@Override public Object process(MutableEntry e, Object... objects)
+throws EntryProcessorException {
 Long val = e.getValue();
 
 e.setValue(val == null ? 1L : val + 1);
 
 return null;
 }
-}));
+});
 
 // Stream random numbers into the streamer cache.
 while (true)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc3c939d/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
index 25ab99b..630f4e3 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
@@ -57,7 +57,7 @@ public class StreamRandomNumbers {
 stmr.allowOverwrite(true);
 
 // Configure data transformation to count instances of the 
same word.
-stmr.receiver(new StreamTransformer<>((e, arg) -> {
+stmr.receiver(StreamTransformer.from((e, arg) -> {
 Long val = e.getValue();
 
 e.setValue(val == null ? 1L : val + 1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc3c939d/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java 
b/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
index 8c85e5d..3f22299 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
@@ -27,25 +27,27 @@ import java.util.*;
  * Convenience adapter to transform update existing values in streaming cache
  * based on the previously cached value.
  */
-public class StreamTransformer implements StreamReceiver {
+public abstract class StreamTransformer implements StreamReceiver, 
EntryProcessor {
 /** */
 private static final long serialVersionUID = 0L;
 
-/** Entry processor. */
-private EntryProcessor ep;
+  

incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 cc3c939d2 -> 94ea69250


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/94ea6925
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/94ea6925
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/94ea6925

Branch: refs/heads/ignite-45
Commit: 94ea692508b903e2ce05b6efc70d30c4011b03dd
Parents: cc3c939
Author: Valentin Kulichenko 
Authored: Sat Mar 21 21:55:47 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 21:55:47 2015 -0700

--
 .../examples/java8/computegrid/ComputeExecutorServiceExample.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/94ea6925/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
--
diff --git 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
index d62b9e7..00f0c05 100644
--- 
a/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
+++ 
b/examples/src/main/java8/org/apache/ignite/examples/java8/computegrid/ComputeExecutorServiceExample.java
@@ -19,6 +19,7 @@ package org.apache.ignite.examples.java8.computegrid;
 
 import org.apache.ignite.*;
 import org.apache.ignite.examples.*;
+import org.apache.ignite.lang.*;
 
 import java.util.concurrent.*;
 
@@ -50,7 +51,7 @@ public final class ComputeExecutorServiceExample {
 // Iterate through all words in the sentence and create callable 
jobs.
 for (String word : "Print words using runnable".split(" ")) {
 // Execute runnable on some node.
-exec.submit(() -> {
+exec.submit((IgniteRunnable)() -> {
 System.out.println();
 System.out.println(">>> Printing '" + word + "' on this 
node from ignite job.");
 });



[3/4] incubator-ignite git commit: IGNITE-45 - Imports.

2015-03-21 Thread agoncharuk
IGNITE-45 - Imports.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/38fdc247
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/38fdc247
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/38fdc247

Branch: refs/heads/ignite-45
Commit: 38fdc247f1c822ca32c6acd3f491966e9984d19a
Parents: b98be0c
Author: Alexey Goncharuk 
Authored: Sat Mar 21 21:58:25 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 21:58:25 2015 -0700

--
 .../ignite/internal/processors/cache/GridCacheGateway.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38fdc247/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
index 86a99ed..35a5d90 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
@@ -18,8 +18,8 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
-import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.util.GridSpinReadWriteLock;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;



[1/4] incubator-ignite git commit: IGNITE-45 - Fixed stopping of cache.

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 94ea69250 -> 4b84c2fe0


IGNITE-45 - Fixed stopping of cache.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4971a58b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4971a58b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4971a58b

Branch: refs/heads/ignite-45
Commit: 4971a58b44610ad3e9077a96e302e53860356e80
Parents: 963e9c2
Author: Alexey Goncharuk 
Authored: Sat Mar 21 21:42:04 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 21:42:04 2015 -0700

--
 .../apache/ignite/internal/IgniteKernal.java|   2 +
 .../processors/cache/GridCacheGateway.java  | 103 ---
 .../processors/cache/GridCacheProcessor.java|   8 ++
 3 files changed, 53 insertions(+), 60 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4971a58b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 16eec48..48c3001 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -1752,6 +1752,8 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 Thread.currentThread().interrupt();
 
 try {
+ctx.cache().blockGateways();
+
 assert gw.getState() == STARTED || gw.getState() == STARTING;
 
 // No more kernal calls from this point on.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4971a58b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
index 9059478..86a99ed 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
@@ -18,7 +18,8 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
-import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.util.GridSpinReadWriteLock;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
@@ -34,6 +35,9 @@ public class GridCacheGateway {
 /** Stopped flag for dynamic caches. */
 private volatile boolean stopped;
 
+/** */
+private GridSpinReadWriteLock rwLock = new GridSpinReadWriteLock();
+
 /**
  * @param ctx Cache context.
  */
@@ -50,28 +54,12 @@ public class GridCacheGateway {
 if (ctx.deploymentEnabled())
 ctx.deploy().onEnter();
 
-// Must unlock in case of unexpected errors to avoid
-// deadlocks during kernal stop.
-try {
-if (stopped)
-throw new IllegalStateException("Dynamic cache has been 
concurrently stopped: " + ctx.name());
+rwLock.readLock();
 
-ctx.kernalContext().gateway().readLock();
-}
-catch (IllegalStateException e) {
-// This exception is thrown only in case if grid has already been 
stopped
-// and we must not call readUnlock.
-throw e;
-}
-catch (RuntimeException | Error e) {
-try {
-ctx.kernalContext().gateway().readUnlock();
-}
-catch (IllegalMonitorStateException ignore) {
-// No-op.
-}
+if (stopped) {
+rwLock.readUnlock();
 
-throw e;
+throw new IllegalStateException("Dynamic cache has been stopped: " 
+ ctx.name());
 }
 }
 
@@ -84,28 +72,14 @@ public class GridCacheGateway {
 if (ctx.deploymentEnabled())
 ctx.deploy().onEnter();
 
-GridKernalGateway kernalGateway = ctx.kernalContext().gateway();
-
 // Must unlock in case of unexpected errors to avoid
 // deadlocks during kernal stop.
-try {
-kernalGateway.readLockAnyway();
+rwLock.readLock();
 
-if (kernalGateway.getState() != GridKernalState.STARTED || 
stopped) {
-kernalGateway.

[2/4] incubator-ignite git commit: IGNITE-45 - Fixed test timeout.

2015-03-21 Thread agoncharuk
IGNITE-45 - Fixed test timeout.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b98be0c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b98be0c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b98be0c6

Branch: refs/heads/ignite-45
Commit: b98be0c669ad701b6a3f633e012bf6ec724964b2
Parents: 4971a58
Author: Alexey Goncharuk 
Authored: Sat Mar 21 21:57:42 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 21:57:42 2015 -0700

--
 .../GridCacheOffHeapTieredEvictionAbstractSelfTest.java | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b98be0c6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
index 5b74a9d..0cfb7c2 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -57,7 +56,7 @@ public abstract class 
GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
 
 /** {@inheritDoc} */
 @Override protected long getTestTimeout() {
-return 60 * 1000;
+return 120 * 1000;
 }
 
 /** {@inheritDoc} */
@@ -67,6 +66,7 @@ public abstract class 
GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
 ccfg.setAtomicWriteOrderMode(PRIMARY);
 
 ccfg.setMemoryMode(OFFHEAP_TIERED);
+ccfg.setNearConfiguration(null);
 ccfg.setOffHeapMaxMemory(0);
 
 return ccfg;
@@ -109,6 +109,8 @@ public abstract class 
GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
 return atomicityMode() == ATOMIC ? 100_000 : 50_000;
 }
 
+
+
 /**
  * @throws Exception If failed.
  */
@@ -125,6 +127,9 @@ public abstract class 
GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri
 final TestValue val = vals.get(key % VAL_SIZE);
 
 cache.put(key, val);
+
+if (i % 1_000 == 0 && i > 0)
+info("Done " + i + " out of " + iterations());
 }
 
 return null;



[4/4] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread agoncharuk
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4b84c2fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4b84c2fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4b84c2fe

Branch: refs/heads/ignite-45
Commit: 4b84c2fe07a5135b8b7a67a5ea00c3eb2c6a9e1c
Parents: 38fdc24 94ea692
Author: Alexey Goncharuk 
Authored: Sat Mar 21 21:59:00 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 21:59:00 2015 -0700

--
 examples/config/example-cache.xml   | 110 +
 examples/rest/http-rest-example.php |   9 +-
 examples/rest/memcache-rest-example.php |   4 +-
 .../ignite/examples/ExampleNodeStartup.java |  35 ++
 .../apache/ignite/examples/ExamplesUtils.java   | 132 ++
 .../computegrid/ComputeBroadcastExample.java| 114 ++
 .../computegrid/ComputeCallableExample.java |  79 
 .../computegrid/ComputeClosureExample.java  |  77 
 .../ComputeClusterGroupsExample.java|  93 +
 .../ComputeContinuousMapperExample.java | 158 +++
 .../ComputeExecutorServiceExample.java  |  71 
 .../ComputeFibonacciContinuationExample.java| 194 +
 .../computegrid/ComputeReducerExample.java  |  89 
 .../computegrid/ComputeRunnableExample.java |  74 
 .../computegrid/ComputeScheduleExample.java |  81 
 .../computegrid/ComputeTaskMapExample.java  | 113 +
 .../computegrid/ComputeTaskSplitExample.java| 102 +
 .../failover/ComputeFailoverExample.java| 137 +++
 .../failover/ComputeFailoverNodeStartup.java|  77 
 .../computegrid/failover/package-info.java  |  22 +
 .../examples/computegrid/montecarlo/Credit.java | 110 +
 .../montecarlo/CreditRiskExample.java   | 153 +++
 .../montecarlo/CreditRiskManager.java   | 143 +++
 .../computegrid/montecarlo/package-info.java|  22 +
 .../examples/computegrid/package-info.java  |  22 +
 .../examples/datagrid/CacheAffinityExample.java | 138 +++
 .../examples/datagrid/CacheApiExample.java  | 128 ++
 .../datagrid/CacheContinuousQueryExample.java   | 107 +
 .../datagrid/CacheDataStreamerExample.java  |  91 +
 .../examples/datagrid/CacheEventsExample.java   |  99 +
 .../datagrid/CachePopularNumbersExample.java| 172 
 .../examples/datagrid/CachePutGetExample.java   | 113 +
 .../examples/datagrid/CacheQueryExample.java| 407 +++
 .../datagrid/CacheTransactionExample.java   | 148 +++
 .../hibernate/HibernateL2CacheExample.java  | 204 ++
 .../HibernateL2CacheExampleNodeStartup.java |  97 +
 .../examples/datagrid/hibernate/Post.java   | 126 ++
 .../examples/datagrid/hibernate/User.java   | 151 +++
 .../datagrid/hibernate/package-info.java|  22 +
 .../ignite/examples/datagrid/package-info.java  |  22 +
 .../starschema/CacheStarSchemaExample.java  | 244 +++
 .../datagrid/starschema/DimProduct.java | 101 +
 .../examples/datagrid/starschema/DimStore.java  | 101 +
 .../datagrid/starschema/FactPurchase.java   | 103 +
 .../datagrid/starschema/package-info.java   |  22 +
 .../store/CacheNodeWithStoreStartup.java| 155 +++
 .../datagrid/store/CacheStoreExample.java   | 107 +
 .../store/CacheStoreLoadDataExample.java|  67 +++
 .../store/dummy/CacheDummyPersonStore.java  | 120 ++
 .../datagrid/store/dummy/package-info.java  |  22 +
 .../hibernate/CacheHibernatePersonStore.java| 291 +
 .../datagrid/store/hibernate/Person.hbm.xml |  34 ++
 .../datagrid/store/hibernate/hibernate.cfg.xml  |  41 ++
 .../datagrid/store/hibernate/package-info.java  |  22 +
 .../store/jdbc/CacheJdbcPersonStore.java| 275 +
 .../store/jdbc/CacheJdbcPojoPersonStore.java|  82 
 .../datagrid/store/jdbc/package-info.java   |  22 +
 .../examples/datagrid/store/model/Person.java   | 155 +++
 .../examples/datagrid/store/package-info.java   |  22 +
 .../datastructures/IgniteAtomicLongExample.java |  74 
 .../IgniteAtomicReferenceExample.java   | 110 +
 .../IgniteAtomicSequenceExample.java|  91 +
 .../IgniteAtomicStampedExample.java | 117 ++
 .../IgniteCountDownLatchExample.java|  95 +
 .../datastructures/IgniteQueueExample.java  | 215 ++
 .../datastructures/IgniteSetExample.java| 197 +
 .../examples/datastructures/package-info.java   |  22 +
 .../ignite/examples/events/EventsExample.java   | 144 +++
 .../ignite/examples/events/package-info.java|  22 +
 .../ignite/examples/igfs/IgfsExample.java   | 278 +
 .../examples/igfs/IgfsMapReduc

incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 4b84c2fe0 -> 000751688


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/00075168
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/00075168
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/00075168

Branch: refs/heads/ignite-45
Commit: 000751688b42d4008e596db2d2d7932f3a9872a8
Parents: 4b84c2f
Author: Valentin Kulichenko 
Authored: Sat Mar 21 22:05:43 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 22:05:43 2015 -0700

--
 .../ignite/examples/datagrid/CacheQueryExample.java  | 15 +--
 .../scalar/examples/ScalarCacheQueryExample.scala|  5 +
 .../examples/ScalarSnowflakeSchemaExample.scala  |  5 +
 .../java/org/apache/ignite/IgniteJdbcDriver.java | 10 --
 4 files changed, 3 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00075168/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
index c71a8f0..ff32ed0 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
@@ -39,16 +39,6 @@ import java.util.*;
  * limitations (not applied if data is queried from one node only):
  * 
  * 
- * {@code Group by} and {@code sort by} statements are applied 
separately
- * on each node, so result set will likely be incorrectly grouped or 
sorted
- * after results from multiple remote nodes are grouped together.
- * 
- * 
- * Aggregation functions like {@code sum}, {@code max}, {@code avg}, 
etc.
- * are also applied on each node. Therefore you will get several 
results
- * containing aggregated values, one for each node.
- * 
- * 
  * Joins will work correctly only if joined objects are stored in
  * collocated mode. Refer to {@link CacheAffinityKey} javadoc for more 
details.
  * 
@@ -61,10 +51,7 @@ import java.util.*;
  * 
  * 
  * 
- * Remote nodes should always be started with special configuration file which
- * enables P2P class loading: {@code 'ignite.{sh|bat} 
examples/config/example-ignite.xml'}.
- * 
- * Alternatively you can run {@link ExampleNodeStartup} in another JVM which 
will
+ * Remote nodes should be started using {@link ExampleNodeStartup} which will
  * start node with {@code examples/config/example-ignite.xml} configuration.
  */
 public class CacheQueryExample {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00075168/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
--
diff --git 
a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
 
b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
index 87baf67..d471b35 100644
--- 
a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
+++ 
b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
@@ -31,10 +31,7 @@ import scala.collection.JavaConversions._
 /**
  * Demonstrates cache ad-hoc queries with Scalar.
  * 
- * Remote nodes should always be started with special configuration file which
- * enables P2P class loading: `'ignite.{sh|bat} 
examples/config/example-ignite.xml'`.
- * 
- * Alternatively you can run `ExampleNodeStartup` in another JVM which will
+ * Remote nodes should be started using `ExampleNodeStartup` which will
  * start node with `examples/config/example-ignite.xml` configuration.
  */
 object ScalarCacheQueryExample {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00075168/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
--
diff --git 
a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
 
b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
index b861fc5..a0dbd41 100644
--- 
a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
+++ 
b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
@@ -45,10 +45,7 @@ import scala.collection.JavaConversions._
 

[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread dsetrakyan
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/19cf0443
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/19cf0443
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/19cf0443

Branch: refs/heads/ignite-45
Commit: 19cf04431bce5bf24c0acee89e4b8d7b2d989dee
Parents: 9cb0af7 0007516
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 22:16:32 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 22:16:32 2015 -0700

--
 .../ignite/examples/datagrid/CacheQueryExample.java  | 15 +--
 .../scalar/examples/ScalarCacheQueryExample.scala|  5 +
 .../examples/ScalarSnowflakeSchemaExample.scala  |  5 +
 .../java/org/apache/ignite/IgniteJdbcDriver.java | 10 --
 4 files changed, 3 insertions(+), 32 deletions(-)
--




[1/2] incubator-ignite git commit: # ignite-45 - removed META-INF licenses folder.

2015-03-21 Thread dsetrakyan
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 000751688 -> 19cf04431


# ignite-45 - removed META-INF licenses folder.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9cb0af70
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9cb0af70
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9cb0af70

Branch: refs/heads/ignite-45
Commit: 9cb0af706808116b5e5cff2338d52028d303d9dc
Parents: 4b84c2f
Author: Dmitiry Setrakyan 
Authored: Sat Mar 21 22:16:19 2015 -0700
Committer: Dmitiry Setrakyan 
Committed: Sat Mar 21 22:16:19 2015 -0700

--
 .../core/licenses/pcollections-mit-license.txt  |  19 -
 .../resources/META-INF/licenses/apache-2.0.txt  | 202 ---
 .../META-INF/licenses/gnu-gplv2ce-license.txt   | 349 ---
 .../resources/META-INF/licenses/snaptree.txt|  35 --
 4 files changed, 605 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9cb0af70/modules/core/licenses/pcollections-mit-license.txt
--
diff --git a/modules/core/licenses/pcollections-mit-license.txt 
b/modules/core/licenses/pcollections-mit-license.txt
deleted file mode 100644
index 5c36737..000
--- a/modules/core/licenses/pcollections-mit-license.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2008 Harold Cooper
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9cb0af70/modules/core/src/main/resources/META-INF/licenses/apache-2.0.txt
--
diff --git a/modules/core/src/main/resources/META-INF/licenses/apache-2.0.txt 
b/modules/core/src/main/resources/META-INF/licenses/apache-2.0.txt
deleted file mode 100644
index d645695..000
--- a/modules/core/src/main/resources/META-INF/licenses/apache-2.0.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a
-  copyright notice that is included in or attached to the work
- 

[1/2] incubator-ignite git commit: IGNITE-45 - Fixed NPE when node stops on error.

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 19cf04431 -> a57ada587


IGNITE-45 - Fixed NPE when node stops on error.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a6e063b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a6e063b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a6e063b6

Branch: refs/heads/ignite-45
Commit: a6e063b6c21d82e58b7be96f5af004782797b30c
Parents: 4b84c2f
Author: Alexey Goncharuk 
Authored: Sat Mar 21 22:36:28 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 22:36:28 2015 -0700

--
 .../src/main/java/org/apache/ignite/internal/IgniteKernal.java  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6e063b6/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 48c3001..41cceac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -1752,7 +1752,10 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 Thread.currentThread().interrupt();
 
 try {
-ctx.cache().blockGateways();
+GridCacheProcessor cache = ctx.cache();
+
+if (cache != null)
+cache.blockGateways();
 
 assert gw.getState() == STARTED || gw.getState() == STARTING;
 



[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread agoncharuk
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a57ada58
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a57ada58
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a57ada58

Branch: refs/heads/ignite-45
Commit: a57ada5873e83d2ea6dbed75fb1ba99f19c65c0c
Parents: a6e063b 19cf044
Author: Alexey Goncharuk 
Authored: Sat Mar 21 22:36:44 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 22:36:44 2015 -0700

--
 .../examples/datagrid/CacheQueryExample.java|  15 +-
 .../examples/ScalarCacheQueryExample.scala  |   5 +-
 .../examples/ScalarSnowflakeSchemaExample.scala |   5 +-
 .../core/licenses/pcollections-mit-license.txt  |  19 -
 .../org/apache/ignite/IgniteJdbcDriver.java |  10 -
 .../resources/META-INF/licenses/apache-2.0.txt  | 202 ---
 .../META-INF/licenses/gnu-gplv2ce-license.txt   | 349 ---
 .../resources/META-INF/licenses/snaptree.txt|  35 --
 8 files changed, 3 insertions(+), 637 deletions(-)
--




[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread vkulichenko
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/27fbfc6b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/27fbfc6b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/27fbfc6b

Branch: refs/heads/ignite-45
Commit: 27fbfc6bee02edfd327536b1897500c7a1144c2d
Parents: b052ac1 a57ada5
Author: Valentin Kulichenko 
Authored: Sat Mar 21 22:47:11 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 22:47:11 2015 -0700

--
 .../src/main/java/org/apache/ignite/internal/IgniteKernal.java  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--




[1/2] incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 a57ada587 -> 27fbfc6be


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b052ac12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b052ac12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b052ac12

Branch: refs/heads/ignite-45
Commit: b052ac129c8c8cd270a70a6757bd8f83a10029cd
Parents: 19cf044
Author: Valentin Kulichenko 
Authored: Sat Mar 21 22:47:04 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 22:47:04 2015 -0700

--
 .../streaming/marketdata/StreamMarketData.java   |  2 +-
 .../java/org/apache/ignite/stream/StreamVisitor.java | 15 +++
 2 files changed, 4 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b052ac12/examples/src/main/java/org/apache/ignite/examples/streaming/marketdata/StreamMarketData.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/streaming/marketdata/StreamMarketData.java
 
b/examples/src/main/java/org/apache/ignite/examples/streaming/marketdata/StreamMarketData.java
index e1a59d7..d7363e2 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/streaming/marketdata/StreamMarketData.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/streaming/marketdata/StreamMarketData.java
@@ -64,7 +64,7 @@ public class StreamMarketData {
 // Instead we update the instruments in the 'instCache'.
 mktStmr.receiver(new StreamVisitor() {
 @Override
-public void visit(IgniteCache 
mktCache, Map.Entry e) {
+public void apply(IgniteCache cache, 
Map.Entry e) {
 String symbol = e.getKey();
 MarketTick tick = e.getValue();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b052ac12/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java 
b/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
index 44bc818..b97263f 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamVisitor.java
@@ -27,26 +27,17 @@ import java.util.*;
  * does not update the cache. If the tuple needs to be stored in the cache,
  * then {@code cache.put(...)} should be called explicitely.
  */
-public abstract class StreamVisitor implements StreamReceiver {
+public abstract class StreamVisitor implements StreamReceiver, 
IgniteBiInClosure, Map.Entry> {
 /** */
 private static final long serialVersionUID = 0L;
 
 /** {@inheritDoc} */
 @Override public void receive(IgniteCache cache, 
Collection> entries) throws IgniteException {
 for (Map.Entry entry : entries)
-visit(cache, entry);
+apply(cache, entry);
 }
 
 /**
- * Visits one cache entry.
- *
- * @param cache Cache.
- * @param entry Visited entry.
- * @throws IgniteException In case of error.
- */
-protected abstract void visit(IgniteCache cache, Map.Entry 
entry) throws IgniteException;
-
-/**
  * Creates a new visitor based on instance of {@link IgniteBiInClosure}.
  *
  * @param c Closure.
@@ -54,7 +45,7 @@ public abstract class StreamVisitor implements 
StreamReceiver {
  */
 public static  StreamVisitor from(final 
IgniteBiInClosure, Map.Entry> c) {
 return new StreamVisitor() {
-@Override protected void visit(IgniteCache cache, 
Map.Entry entry) {
+@Override public void apply(IgniteCache cache, Map.Entry entry) {
 c.apply(cache, entry);
 }
 };



incubator-ignite git commit: # IGNITE-45 - Examples

2015-03-21 Thread vkulichenko
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 27fbfc6be -> 74009c981


# IGNITE-45 - Examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/74009c98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/74009c98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/74009c98

Branch: refs/heads/ignite-45
Commit: 74009c98172870c132b74a27e366920618a7a17a
Parents: 27fbfc6
Author: Valentin Kulichenko 
Authored: Sat Mar 21 22:48:04 2015 -0700
Committer: Valentin Kulichenko 
Committed: Sat Mar 21 22:48:04 2015 -0700

--
 .../core/src/main/java/org/jdk8/backport/ConcurrentHashMap8.java  | 3 ++-
 .../src/main/java/org/jdk8/backport/ConcurrentLinkedDeque8.java   | 3 ++-
 .../src/main/java/org/jdk8/backport/ConcurrentLinkedHashMap.java  | 3 ++-
 modules/core/src/main/java/org/jdk8/backport/LongAdder8.java  | 3 ++-
 modules/core/src/main/java/org/jdk8/backport/Striped64_8.java | 3 ++-
 .../core/src/main/java/org/jdk8/backport/ThreadLocalRandom8.java  | 3 ++-
 6 files changed, 12 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/74009c98/modules/core/src/main/java/org/jdk8/backport/ConcurrentHashMap8.java
--
diff --git 
a/modules/core/src/main/java/org/jdk8/backport/ConcurrentHashMap8.java 
b/modules/core/src/main/java/org/jdk8/backport/ConcurrentHashMap8.java
index 2f7fcf9..e199fb5 100644
--- a/modules/core/src/main/java/org/jdk8/backport/ConcurrentHashMap8.java
+++ b/modules/core/src/main/java/org/jdk8/backport/ConcurrentHashMap8.java
@@ -5,7 +5,8 @@
  */
 
 /*
- * This file is from JSR-166: http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The initial version of this file was copied from JSR-166:
+ * http://gee.cs.oswego.edu/dl/concurrency-interest/
  */
 
 package org.jdk8.backport;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/74009c98/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedDeque8.java
--
diff --git 
a/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedDeque8.java 
b/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedDeque8.java
index 911f7f4..eca27d6 100644
--- a/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedDeque8.java
+++ b/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedDeque8.java
@@ -5,7 +5,8 @@
  */
 
 /*
- * This file is from JSR-166: http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The initial version of this file was copied from JSR-166:
+ * http://gee.cs.oswego.edu/dl/concurrency-interest/
  */
 
 package org.jdk8.backport;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/74009c98/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedHashMap.java
--
diff --git 
a/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedHashMap.java 
b/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedHashMap.java
index 8f3132d..941b985 100644
--- a/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedHashMap.java
+++ b/modules/core/src/main/java/org/jdk8/backport/ConcurrentLinkedHashMap.java
@@ -5,7 +5,8 @@
  */
 
 /*
- * This file is from JSR-166: http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The initial version of this file was copied from JSR-166:
+ * http://gee.cs.oswego.edu/dl/concurrency-interest/
  */
 
 package org.jdk8.backport;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/74009c98/modules/core/src/main/java/org/jdk8/backport/LongAdder8.java
--
diff --git a/modules/core/src/main/java/org/jdk8/backport/LongAdder8.java 
b/modules/core/src/main/java/org/jdk8/backport/LongAdder8.java
index bb955a2..3de43bc 100644
--- a/modules/core/src/main/java/org/jdk8/backport/LongAdder8.java
+++ b/modules/core/src/main/java/org/jdk8/backport/LongAdder8.java
@@ -5,7 +5,8 @@
  */
 
 /*
- * This file is from JSR-166: http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The initial version of this file was copied from JSR-166:
+ * http://gee.cs.oswego.edu/dl/concurrency-interest/
  */
 
 package org.jdk8.backport;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/74009c98/modules/core/src/main/java/org/jdk8/backport/Striped64_8.java
--
diff --git a/modules/core/src/main/java/org/jdk8/backport/Striped64_8.java 
b/modules/core/src/main/java/org/jdk8/backport/Striped64_8.java
index 7a013af..846f0e3 100644
--- a/modules/core/src/main/java/org/jdk8/backport/Striped64_8.java
+++ b/modules/core/src/mai

[2/2] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-45' into ignite-45

2015-03-21 Thread agoncharuk
Merge remote-tracking branch 'origin/ignite-45' into ignite-45


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/787cab5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/787cab5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/787cab5c

Branch: refs/heads/ignite-45
Commit: 787cab5c19ea6ece92e584671e252115f3ac0a46
Parents: 4ef0663 74009c9
Author: Alexey Goncharuk 
Authored: Sat Mar 21 23:39:42 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 23:39:42 2015 -0700

--
 .../streaming/marketdata/StreamMarketData.java   |  2 +-
 .../java/org/apache/ignite/stream/StreamVisitor.java | 15 +++
 .../java/org/jdk8/backport/ConcurrentHashMap8.java   |  3 ++-
 .../org/jdk8/backport/ConcurrentLinkedDeque8.java|  3 ++-
 .../org/jdk8/backport/ConcurrentLinkedHashMap.java   |  3 ++-
 .../src/main/java/org/jdk8/backport/LongAdder8.java  |  3 ++-
 .../src/main/java/org/jdk8/backport/Striped64_8.java |  3 ++-
 .../java/org/jdk8/backport/ThreadLocalRandom8.java   |  3 ++-
 8 files changed, 16 insertions(+), 19 deletions(-)
--




[1/2] incubator-ignite git commit: IGNITE-45 - Commented hanging test.

2015-03-21 Thread agoncharuk
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 74009c981 -> 787cab5c1


IGNITE-45 - Commented hanging test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4ef06637
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4ef06637
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4ef06637

Branch: refs/heads/ignite-45
Commit: 4ef066375c7676feb7ef4b5150a5dc5ca68fd93d
Parents: a57ada5
Author: Alexey Goncharuk 
Authored: Sat Mar 21 23:39:32 2015 -0700
Committer: Alexey Goncharuk 
Committed: Sat Mar 21 23:39:32 2015 -0700

--
 .../java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4ef06637/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 656192f..c699e79 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -117,7 +117,7 @@ public class IgniteCacheTestSuite extends TestSuite {
 suite.addTestSuite(GridCacheTtlManagerSelfTest.class);
 suite.addTestSuite(GridCacheLifecycleAwareSelfTest.class);
 suite.addTestSuite(IgniteCacheAtomicStopBusySelfTest.class);
-suite.addTestSuite(IgniteCacheTransactionalStopBusySelfTest.class);
+// suite.addTestSuite(IgniteCacheTransactionalStopBusySelfTest.class); 
TODO Ignite-257.
 suite.addTestSuite(GridCacheAtomicNearCacheSelfTest.class);
 suite.addTestSuite(GridCacheStorePutxSelfTest.class);
 suite.addTestSuite(GridCacheOffHeapMultiThreadedUpdateSelfTest.class);



[1/2] incubator-ignite git commit: fixed hibernate examples

2015-03-21 Thread yzhdanov
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 787cab5c1 -> 658b82342


fixed hibernate examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5a46b297
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5a46b297
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5a46b297

Branch: refs/heads/ignite-45
Commit: 5a46b2977e898ab01f53bfd85a64f6ef751da63b
Parents: 787cab5
Author: Yakov Zhdanov 
Authored: Sun Mar 22 09:57:49 2015 +0300
Committer: Yakov Zhdanov 
Committed: Sun Mar 22 09:57:49 2015 +0300

--
 examples/config/hibernate/example-hibernate-L2-cache.xml  | 10 +-
 .../hibernate/HibernateL2CacheExampleNodeStartup.java |  6 +++---
 .../main/java/org/apache/ignite/cache/CacheManager.java   | 10 ++
 3 files changed, 10 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5a46b297/examples/config/hibernate/example-hibernate-L2-cache.xml
--
diff --git a/examples/config/hibernate/example-hibernate-L2-cache.xml 
b/examples/config/hibernate/example-hibernate-L2-cache.xml
index 8966236..324c040 100644
--- a/examples/config/hibernate/example-hibernate-L2-cache.xml
+++ b/examples/config/hibernate/example-hibernate-L2-cache.xml
@@ -56,12 +56,12 @@
 READ_ONLY
 
 
-
-
+
+
 
 
-
-
-
+
+
+
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5a46b297/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
index 19272f8..cef6526 100644
--- 
a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
+++ 
b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExampleNodeStartup.java
@@ -69,9 +69,9 @@ public class HibernateL2CacheExampleNodeStartup {
 cfg.setCacheConfiguration(
 
cacheConfiguration("org.hibernate.cache.spi.UpdateTimestampsCache", ATOMIC),
 
cacheConfiguration("org.hibernate.cache.internal.StandardQueryCache", ATOMIC),
-
cacheConfiguration("org.apache.ignite.examples.java7.datagrid.hibernate.User", 
TRANSACTIONAL),
-
cacheConfiguration("org.apache.ignite.examples.java7.datagrid.hibernate.User.posts",
 TRANSACTIONAL),
-
cacheConfiguration("org.apache.ignite.examples.java7.datagrid.hibernate.Post", 
TRANSACTIONAL)
+
cacheConfiguration("org.apache.ignite.examples.datagrid.hibernate.User", 
TRANSACTIONAL),
+
cacheConfiguration("org.apache.ignite.examples.datagrid.hibernate.User.posts", 
TRANSACTIONAL),
+
cacheConfiguration("org.apache.ignite.examples.datagrid.hibernate.Post", 
TRANSACTIONAL)
 );
 
 return cfg;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5a46b297/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java 
b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index 4a41dd5..6174f2d 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -31,6 +31,7 @@ import javax.cache.*;
 import javax.cache.configuration.*;
 import javax.cache.management.*;
 import javax.management.*;
+import javax.sound.midi.*;
 import java.net.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
@@ -257,11 +258,7 @@ public class CacheManager implements 
javax.cache.CacheManager {
 @Override public void destroyCache(String cacheName) {
 kernalGateway.readLock();
 
-IgniteCache cache;
-
-try {
-cache = getCache0(cacheName);
-
+try (IgniteCache cache = getCache0(cacheName)) {
 if (cache != null) {
 unregisterCacheObject(cacheName, CACHE_CONFIGURATION);
 unregisterCacheObject(cacheName, CACHE_STATISTICS);
@@ -270,9 +267,6 @@ public class CacheManager implements 
javax.cache.CacheManager {
 finally {
 kernalGateway.readUnlock();
 }
-
-if (cache != null)
-cache.close();
 }
 
 /**