You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by iv...@apache.org on 2015/07/06 10:11:35 UTC

[01/25] incubator-ignite git commit: # ignite-gg-10416 Fixed spring exclude properties.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1087 355e33db0 -> 18e4de6b6


# ignite-gg-10416 Fixed spring exclude properties.


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

Branch: refs/heads/ignite-1087
Commit: 178c4f85dca8d050754994b8baaaa48f011e84bc
Parents: 4375529
Author: Andrey <an...@gridgain.com>
Authored: Fri Jun 12 05:48:12 2015 +0300
Committer: Andrey <an...@gridgain.com>
Committed: Fri Jun 12 05:48:12 2015 +0300

----------------------------------------------------------------------
 .../util/spring/IgniteSpringHelperImpl.java     | 58 +++++++++++++-------
 .../scala/org/apache/ignite/visor/visor.scala   |  3 +-
 2 files changed, 39 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/178c4f85/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
index 2c7c7e1..4cc080a 100644
--- a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
+++ b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
@@ -405,32 +405,48 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
         GenericApplicationContext springCtx = new GenericApplicationContext();
 
         BeanFactoryPostProcessor postProc = new BeanFactoryPostProcessor() {
-            @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
-                throws BeansException {
-                for (String beanName : beanFactory.getBeanDefinitionNames()) {
-                    BeanDefinition def = beanFactory.getBeanDefinition(beanName);
-
-                    if (def.getBeanClassName() != null) {
-                        try {
-                            Class.forName(def.getBeanClassName());
-                        }
-                        catch (ClassNotFoundException ignored) {
-                            ((BeanDefinitionRegistry) beanFactory).removeBeanDefinition(beanName);
-
-                            continue;
+            /**
+             * @param beanFactory The bean factory used by the application context.
+             * @param beanName Bean name.
+             * @param def Registered BeanDefinition.
+             * @throws BeansException in case of errors.
+             */
+            private void processBeanDefinition(ConfigurableListableBeanFactory beanFactory, String beanName,
+                BeanDefinition def) throws BeansException {
+                if (def.getBeanClassName() != null) {
+                    try {
+                        Class.forName(def.getBeanClassName());
+
+                        MutablePropertyValues vals = def.getPropertyValues();
+
+                        for (PropertyValue val : new ArrayList<>(vals.getPropertyValueList())) {
+                            for (String excludedProp : excludedProps) {
+                                if (val.getName().equals(excludedProp)) {
+                                    vals.removePropertyValue(val);
+
+                                    return;
+                                }
+                            }
+
+                            if (val.getValue() instanceof Iterable)
+                                for (Object beanDef : (Iterable)val.getValue())
+                                    if (beanDef instanceof BeanDefinitionHolder)
+                                        processBeanDefinition(beanFactory, beanName,
+                                            ((BeanDefinitionHolder)beanDef).getBeanDefinition());
                         }
                     }
-
-                    MutablePropertyValues vals = def.getPropertyValues();
-
-                    for (PropertyValue val : new ArrayList<>(vals.getPropertyValueList())) {
-                        for (String excludedProp : excludedProps) {
-                            if (val.getName().equals(excludedProp))
-                                vals.removePropertyValue(val);
-                        }
+                    catch (ClassNotFoundException ignored) {
+                        ((BeanDefinitionRegistry) beanFactory).removeBeanDefinition(beanName);
                     }
                 }
             }
+
+            /** {@inheritDoc} */
+            @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
+                throws BeansException {
+                for (String beanName : beanFactory.getBeanDefinitionNames())
+                    processBeanDefinition(beanFactory, beanName, beanFactory.getBeanDefinition(beanName));
+            }
         };
 
         springCtx.addBeanFactoryPostProcessor(postProc);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/178c4f85/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
index c943fc5..5f63f23 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
@@ -1573,7 +1573,8 @@ object visor extends VisorTag {
                     try
                         // Cache, IGFS, streamer and DR configurations should be excluded from daemon node config.
                         spring.loadConfigurations(url, "cacheConfiguration", "fileSystemConfiguration",
-                            "streamerConfiguration", "drSenderConfiguration", "drReceiverConfiguration").get1()
+                            "streamerConfiguration", "drSenderConfiguration", "drReceiverConfiguration",
+                            "interopConfiguration", "indexingSpi").get1()
                     finally {
                         if (log4jTup != null)
                             U.removeLog4jNoOpLogger(log4jTup)


[23/25] incubator-ignite git commit: Merge branch 'ignite-1086' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1086

Posted by iv...@apache.org.
Merge branch 'ignite-1086' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1086


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

Branch: refs/heads/ignite-1087
Commit: 95da66291bc22af2e0155617c2c54994746e1e34
Parents: f8d1e90 558df06
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 6 10:59:58 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 6 10:59:58 2015 +0300

----------------------------------------------------------------------

----------------------------------------------------------------------



[05/25] incubator-ignite git commit: # ignite-gg-10416 Fixed exclude nested beans with missing classes.

Posted by iv...@apache.org.
# ignite-gg-10416 Fixed exclude nested beans with missing classes.


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

Branch: refs/heads/ignite-1087
Commit: e5fba8b3a04d982e9b4c1617be416a77880e78ef
Parents: 99b8284
Author: Andrey <an...@gridgain.com>
Authored: Thu Jun 18 16:23:40 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jun 18 16:23:40 2015 +0700

----------------------------------------------------------------------
 .../java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java   | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5fba8b3/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
index 0c2e99e..3ff927a 100644
--- a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
+++ b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
@@ -40,6 +40,8 @@ public class IgniteSpringTestSuite extends TestSuite {
 
         suite.addTest(IgniteResourceSelfTestSuite.suite());
 
+        suite.addTest(new TestSuite(IgniteStartExcludesConfigurationTest.class));
+
         // Tests moved to this suite since they require Spring functionality.
         suite.addTest(new TestSuite(GridP2PUserVersionChangeSelfTest.class));
 


[20/25] incubator-ignite git commit: disable failing test

Posted by iv...@apache.org.
disable failing 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/334fee9e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/334fee9e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/334fee9e

Branch: refs/heads/ignite-1087
Commit: 334fee9e300342c0a9613fdcaba5aa97ef1a86a4
Parents: f72b291
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 6 10:19:18 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 6 10:19:18 2015 +0300

----------------------------------------------------------------------
 .../IgniteCacheAtomicReplicatedNodeRestartSelfTest.java         | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/334fee9e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index 379ed65..52d8871 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -31,6 +31,11 @@ public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheRep
     }
 
     /** {@inheritDoc} */
+    @Override public void testRestartWithPutSixNodesTwoBackups() throws Throwable {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1095");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheAtomicityMode atomicityMode() {
         return ATOMIC;
     }


[16/25] incubator-ignite git commit: ignite-428 Review fixes

Posted by iv...@apache.org.
ignite-428 Review fixes


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

Branch: refs/heads/ignite-1087
Commit: 63fce5a4920531ad8cd9afc47d829bb2fa4bc438
Parents: 2c41739
Author: agura <ag...@gridgain.com>
Authored: Thu Jun 25 22:18:00 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 19:39:12 2015 +0300

----------------------------------------------------------------------
 modules/kafka/pom.xml                           |  18 +-
 .../ignite/stream/kafka/KafkaStreamer.java      | 121 ++++++---
 .../stream/kafka/KafkaEmbeddedBroker.java       | 251 ++++++++++---------
 .../kafka/KafkaIgniteStreamerSelfTest.java      | 131 +++++-----
 .../ignite/stream/kafka/SimplePartitioner.java  |  27 +-
 5 files changed, 293 insertions(+), 255 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 165ec1c..43909bc 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-kafka</artifactId>
-    <version>1.1.1-SNAPSHOT</version>
+    <version>1.1.6-SNAPSHOT</version>
 
     <dependencies>
         <dependency>
@@ -39,6 +39,7 @@
             <artifactId>ignite-core</artifactId>
             <version>${project.version}</version>
         </dependency>
+
         <dependency>
             <groupId>org.apache.kafka</groupId>
             <artifactId>kafka_2.10</artifactId>
@@ -66,6 +67,7 @@
                 </exclusion>
             </exclusions>
         </dependency>
+
         <dependency>
             <groupId>org.apache.zookeeper</groupId>
             <artifactId>zookeeper</artifactId>
@@ -73,12 +75,6 @@
         </dependency>
 
         <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.4</version>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.ignite</groupId>
             <artifactId>ignite-log4j</artifactId>
             <version>${project.version}</version>
@@ -90,7 +86,6 @@
             <version>4.2</version>
         </dependency>
 
-
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
@@ -103,13 +98,6 @@
         </dependency>
 
         <dependency>
-            <groupId>commons-beanutils</groupId>
-            <artifactId>commons-beanutils</artifactId>
-            <version>1.8.3</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.ignite</groupId>
             <artifactId>ignite-spring</artifactId>
             <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
index e0240ce..e9ad0bd 100644
--- a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
+++ b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
@@ -30,16 +30,17 @@ import java.util.*;
 import java.util.concurrent.*;
 
 /**
- * Server that subscribes to topic messages from Kafka broker, streams its to key-value pairs into {@link
- * org.apache.ignite.IgniteDataStreamer} instance.
+ * Server that subscribes to topic messages from Kafka broker and streams its to key-value pairs into
+ * {@link IgniteDataStreamer} instance.
  * <p>
- * Uses Kafka's High Level Consumer API to read messages from Kafka
+ * Uses Kafka's High Level Consumer API to read messages from Kafka.
  *
  * @see <a href="https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example">Consumer Consumer Group
  * Example</a>
  */
-public class KafkaStreamer<T, K, V>
-    extends StreamAdapter<T, K, V> {
+public class KafkaStreamer<T, K, V> extends StreamAdapter<T, K, V> {
+    /** Retry timeout. */
+    private static final long DFLT_RETRY_TIMEOUT = 10000;
 
     /** Logger. */
     private IgniteLogger log;
@@ -53,61 +54,78 @@ public class KafkaStreamer<T, K, V>
     /** Number of threads to process kafka streams. */
     private int threads;
 
-    /** Kafka Consumer Config. */
-    private ConsumerConfig consumerConfig;
+    /** Kafka consumer config. */
+    private ConsumerConfig consumerCfg;
 
-    /** Key Decoder. */
+    /** Key decoder. */
     private Decoder<K> keyDecoder;
 
-    /** Value Decoder. */
-    private Decoder<V> valueDecoder;
+    /** Value decoder. */
+    private Decoder<V> valDecoder;
 
-    /** Kafka Consumer connector. */
+    /** Kafka consumer connector. */
     private ConsumerConnector consumer;
 
+    /** Retry timeout. */
+    private long retryTimeout = DFLT_RETRY_TIMEOUT;
+
+    /** Stopped. */
+    private volatile boolean stopped;
+
     /**
-     * Sets the topic.
+     * Sets the topic name.
      *
-     * @param topic Topic Name.
+     * @param topic Topic name.
      */
-    public void setTopic(final String topic) {
+    public void setTopic(String topic) {
         this.topic = topic;
     }
 
     /**
      * Sets the threads.
      *
-     * @param threads Number of Threads.
+     * @param threads Number of threads.
      */
-    public void setThreads(final int threads) {
+    public void setThreads(int threads) {
         this.threads = threads;
     }
 
     /**
      * Sets the consumer config.
      *
-     * @param consumerConfig  Consumer configuration.
+     * @param consumerCfg Consumer configuration.
      */
-    public void setConsumerConfig(final ConsumerConfig consumerConfig) {
-        this.consumerConfig = consumerConfig;
+    public void setConsumerConfig(ConsumerConfig consumerCfg) {
+        this.consumerCfg = consumerCfg;
     }
 
     /**
      * Sets the key decoder.
      *
-     * @param keyDecoder Key Decoder.
+     * @param keyDecoder Key decoder.
      */
-    public void setKeyDecoder(final Decoder<K> keyDecoder) {
+    public void setKeyDecoder(Decoder<K> keyDecoder) {
         this.keyDecoder = keyDecoder;
     }
 
     /**
      * Sets the value decoder.
      *
-     * @param valueDecoder Value Decoder
+     * @param valDecoder Value decoder.
      */
-    public void setValueDecoder(final Decoder<V> valueDecoder) {
-        this.valueDecoder = valueDecoder;
+    public void setValueDecoder(Decoder<V> valDecoder) {
+        this.valDecoder = valDecoder;
+    }
+
+    /**
+     * Sets the retry timeout.
+     *
+     * @param retryTimeout Retry timeout.
+     */
+    public void setRetryTimeout(long retryTimeout) {
+        A.ensure(retryTimeout > 0, "retryTimeout > 0");
+
+        this.retryTimeout = retryTimeout;
     }
 
     /**
@@ -120,35 +138,56 @@ public class KafkaStreamer<T, K, V>
         A.notNull(getIgnite(), "ignite");
         A.notNull(topic, "topic");
         A.notNull(keyDecoder, "key decoder");
-        A.notNull(valueDecoder, "value decoder");
-        A.notNull(consumerConfig, "kafka consumer config");
+        A.notNull(valDecoder, "value decoder");
+        A.notNull(consumerCfg, "kafka consumer config");
         A.ensure(threads > 0, "threads > 0");
 
         log = getIgnite().log();
 
-        consumer = kafka.consumer.Consumer.createJavaConsumerConnector(consumerConfig);
+        consumer = kafka.consumer.Consumer.createJavaConsumerConnector(consumerCfg);
+
+        Map<String, Integer> topicCntMap = new HashMap<>();
 
-        Map<String, Integer> topicCountMap = new HashMap<>();
-        topicCountMap.put(topic, threads);
+        topicCntMap.put(topic, threads);
 
-        Map<String, List<KafkaStream<K, V>>> consumerMap = consumer.createMessageStreams(topicCountMap, keyDecoder,
-            valueDecoder);
+        Map<String, List<KafkaStream<K, V>>> consumerMap =
+            consumer.createMessageStreams(topicCntMap, keyDecoder, valDecoder);
 
         List<KafkaStream<K, V>> streams = consumerMap.get(topic);
 
         // Now launch all the consumer threads.
         executor = Executors.newFixedThreadPool(threads);
 
+        stopped = false;
+
         // Now create an object to consume the messages.
-        for (final KafkaStream<K,V> stream : streams) {
+        for (final KafkaStream<K, V> stream : streams) {
             executor.submit(new Runnable() {
                 @Override public void run() {
-
-                    ConsumerIterator<K, V> it = stream.iterator();
-
-                    while (it.hasNext()) {
-                        final MessageAndMetadata<K, V> messageAndMetadata = it.next();
-                        getStreamer().addData(messageAndMetadata.key(), messageAndMetadata.message());
+                    while (!stopped) {
+                        try {
+                            for (ConsumerIterator<K, V> it = stream.iterator(); it.hasNext() && !stopped; ) {
+                                MessageAndMetadata<K, V> msg = it.next();
+
+                                try {
+                                    getStreamer().addData(msg.key(), msg.message());
+                                }
+                                catch (Exception e) {
+                                    U.warn(log, "Message is ignored due to an error [msg=" + msg + ']', e);
+                                }
+                            }
+                        }
+                        catch (Exception e) {
+                            U.warn(log, "Message can't be consumed from stream. Retry after " +
+                                retryTimeout + " ms.", e);
+
+                            try {
+                                Thread.sleep(retryTimeout);
+                            }
+                            catch (InterruptedException ie) {
+                                // No-op.
+                            }
+                        }
                     }
                 }
             });
@@ -159,6 +198,8 @@ public class KafkaStreamer<T, K, V>
      * Stops streamer.
      */
     public void stop() {
+        stopped = true;
+
         if (consumer != null)
             consumer.shutdown();
 
@@ -168,11 +209,11 @@ public class KafkaStreamer<T, K, V>
             try {
                 if (!executor.awaitTermination(5000, TimeUnit.MILLISECONDS))
                     if (log.isDebugEnabled())
-                        log.debug("Timed out waiting for consumer threads to shut down, exiting uncleanly");
+                        log.debug("Timed out waiting for consumer threads to shut down, exiting uncleanly.");
             }
             catch (InterruptedException e) {
                 if (log.isDebugEnabled())
-                    log.debug("Interrupted during shutdown, exiting uncleanly");
+                    log.debug("Interrupted during shutdown, exiting uncleanly.");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
index 28533f7..98b9e4c 100644
--- a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.stream.kafka;
 
-import org.apache.commons.io.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.zookeeper.server.*;
 
@@ -25,6 +24,7 @@ import kafka.admin.*;
 import kafka.api.*;
 import kafka.api.Request;
 import kafka.producer.*;
+import kafka.serializer.*;
 import kafka.server.*;
 import kafka.utils.*;
 import org.I0Itec.zkclient.*;
@@ -39,106 +39,104 @@ import java.util.concurrent.*;
  * Kafka Embedded Broker.
  */
 public class KafkaEmbeddedBroker {
-
-    /** Default ZooKeeper Host. */
+    /** Default ZooKeeper host. */
     private static final String ZK_HOST = "localhost";
 
-    /** Broker Port. */
+    /** Broker port. */
     private static final int BROKER_PORT = 9092;
 
-    /** ZooKeeper Connection Timeout. */
+    /** ZooKeeper connection timeout. */
     private static final int ZK_CONNECTION_TIMEOUT = 6000;
 
-    /** ZooKeeper Session Timeout. */
+    /** ZooKeeper session timeout. */
     private static final int ZK_SESSION_TIMEOUT = 6000;
 
     /** ZooKeeper port. */
     private static int zkPort = 0;
 
-    /** Is ZooKeeper Ready. */
+    /** Is ZooKeeper ready. */
     private boolean zkReady;
 
-    /** Kafka Config. */
-    private KafkaConfig brokerConfig;
+    /** Kafka config. */
+    private KafkaConfig brokerCfg;
 
-    /** Kafka Server. */
-    private KafkaServer kafkaServer;
+    /** Kafka server. */
+    private KafkaServer kafkaSrv;
 
-    /** ZooKeeper Client. */
+    /** ZooKeeper client. */
     private ZkClient zkClient;
 
     /** Embedded ZooKeeper. */
     private EmbeddedZooKeeper zooKeeper;
 
     /**
-     * Creates an embedded Kafka Broker.
+     * Creates an embedded Kafka broker.
      */
     public KafkaEmbeddedBroker() {
         try {
             setupEmbeddedZooKeeper();
+
             setupEmbeddedKafkaServer();
         }
         catch (IOException | InterruptedException e) {
-            throw new RuntimeException("failed to start Kafka Broker " + e);
+            throw new RuntimeException("Failed to start Kafka broker " + e);
         }
-
     }
 
     /**
-     * @return ZooKeeper Address.
+     * @return ZooKeeper address.
      */
     public static String getZKAddress() {
-        return ZK_HOST + ":" + zkPort;
+        return ZK_HOST + ':' + zkPort;
     }
 
     /**
      * Creates a Topic.
      *
-     * @param topic topic name
-     * @param partitions number of paritions for the topic
-     * @param replicationFactor replication factor
-     * @throws TimeoutException
-     * @throws InterruptedException
+     * @param topic Topic name.
+     * @param partitions Number of partitions for the topic.
+     * @param replicationFactor Replication factor.
+     * @throws TimeoutException If operation is timed out.
+     * @throws InterruptedException If interrupted.
      */
-    public void createTopic(String topic, final int partitions, final int replicationFactor)
+    public void createTopic(String topic, int partitions, int replicationFactor)
         throws TimeoutException, InterruptedException {
         AdminUtils.createTopic(zkClient, topic, partitions, replicationFactor, new Properties());
+
         waitUntilMetadataIsPropagated(topic, 0, 10000, 100);
     }
 
     /**
-     * Sends message to Kafka Broker.
+     * Sends message to Kafka broker.
      *
-     * @param keyedMessages List of Keyed Messages.
+     * @param keyedMessages List of keyed messages.
      * @return Producer used to send the message.
      */
-    public Producer sendMessages(List<KeyedMessage<String, String>> keyedMessages) {
+    public Producer<String, String> sendMessages(List<KeyedMessage<String, String>> keyedMessages) {
         Producer<String, String> producer = new Producer<>(getProducerConfig());
+
         producer.send(scala.collection.JavaConversions.asScalaBuffer(keyedMessages));
+
         return producer;
     }
 
     /**
-     * Shuts down Kafka Broker.
-     *
-     * @throws IOException
+     * Shuts down Kafka broker.
      */
-    public void shutdown()
-        throws IOException {
-
+    public void shutdown() {
         zkReady = false;
 
-        if (kafkaServer != null)
-            kafkaServer.shutdown();
+        if (kafkaSrv != null)
+            kafkaSrv.shutdown();
 
-        List<String> logDirs = scala.collection.JavaConversions.asJavaList(brokerConfig.logDirs());
+        List<String> logDirs = scala.collection.JavaConversions.asJavaList(brokerCfg.logDirs());
 
-        for (String logDir : logDirs) {
-            FileUtils.deleteDirectory(new File(logDir));
-        }
+        for (String logDir : logDirs)
+            U.delete(new File(logDir));
 
         if (zkClient != null) {
             zkClient.close();
+
             zkClient = null;
         }
 
@@ -148,16 +146,15 @@ public class KafkaEmbeddedBroker {
                 zooKeeper.shutdown();
             }
             catch (IOException e) {
-                // ignore
+                // No-op.
             }
 
             zooKeeper = null;
         }
-
     }
 
     /**
-     * @return the Zookeeper Client
+     * @return ZooKeeper client.
      */
     private ZkClient getZkClient() {
         A.ensure(zkReady, "Zookeeper not setup yet");
@@ -169,102 +166,105 @@ public class KafkaEmbeddedBroker {
     /**
      * Checks if topic metadata is propagated.
      *
-     * @param topic topic name
-     * @param partition partition
-     * @return true if propagated otherwise false
+     * @param topic Topic name.
+     * @param part Partition.
+     * @return {@code True} if propagated, otherwise {@code false}.
      */
-    private boolean isMetadataPropagated(final String topic, final int partition) {
-        final scala.Option<PartitionStateInfo> partitionStateOption = kafkaServer.apis().metadataCache().getPartitionInfo(
-            topic, partition);
-        if (partitionStateOption.isDefined()) {
-            final PartitionStateInfo partitionState = partitionStateOption.get();
-            final LeaderAndIsr leaderAndInSyncReplicas = partitionState.leaderIsrAndControllerEpoch().leaderAndIsr();
-
-            if (ZkUtils.getLeaderForPartition(getZkClient(), topic, partition) != null
-                && Request.isValidBrokerId(leaderAndInSyncReplicas.leader())
-                && leaderAndInSyncReplicas.isr().size() >= 1)
-                return true;
+    private boolean isMetadataPropagated(String topic, int part) {
+        scala.Option<PartitionStateInfo> partStateOption =
+            kafkaSrv.apis().metadataCache().getPartitionInfo(topic, part);
 
-        }
-        return false;
+        if (!partStateOption.isDefined())
+            return false;
+
+        PartitionStateInfo partState = partStateOption.get();
+
+        LeaderAndIsr LeaderAndIsr = partState.leaderIsrAndControllerEpoch().leaderAndIsr();
+
+        return ZkUtils.getLeaderForPartition(getZkClient(), topic, part) != null &&
+            Request.isValidBrokerId(LeaderAndIsr.leader()) && LeaderAndIsr.isr().size() >= 1;
     }
 
     /**
      * Waits until metadata is propagated.
      *
-     * @param topic topic name
-     * @param partition partition
-     * @param timeout timeout value in millis
-     * @param interval interval in millis to sleep
-     * @throws TimeoutException
-     * @throws InterruptedException
+     * @param topic Topic name.
+     * @param part Partition.
+     * @param timeout Timeout value in millis.
+     * @param interval Interval in millis to sleep.
+     * @throws TimeoutException If operation is timed out.
+     * @throws InterruptedException If interrupted.
      */
-    private void waitUntilMetadataIsPropagated(final String topic, final int partition, final long timeout,
-        final long interval) throws TimeoutException, InterruptedException {
+    private void waitUntilMetadataIsPropagated(String topic, int part, long timeout, long interval)
+        throws TimeoutException, InterruptedException {
         int attempt = 1;
-        final long startTime = System.currentTimeMillis();
+
+        long startTime = System.currentTimeMillis();
 
         while (true) {
-            if (isMetadataPropagated(topic, partition))
+            if (isMetadataPropagated(topic, part))
                 return;
 
-            final long duration = System.currentTimeMillis() - startTime;
+            long duration = System.currentTimeMillis() - startTime;
 
             if (duration < timeout)
                 Thread.sleep(interval);
             else
-                throw new TimeoutException("metadata propagate timed out, attempt=" + attempt);
+                throw new TimeoutException("Metadata propagation is timed out, attempt " + attempt);
 
             attempt++;
         }
-
     }
 
     /**
-     * Sets up embedded Kafka Server
+     * Sets up embedded Kafka server.
      *
-     * @throws IOException
+     * @throws IOException If failed.
      */
-    private void setupEmbeddedKafkaServer()
-        throws IOException {
+    private void setupEmbeddedKafkaServer() throws IOException {
         A.ensure(zkReady, "Zookeeper should be setup before hand");
 
-        brokerConfig = new KafkaConfig(getBrokerConfig());
-        kafkaServer = new KafkaServer(brokerConfig, SystemTime$.MODULE$);
-        kafkaServer.startup();
+        brokerCfg = new KafkaConfig(getBrokerConfig());
+
+        kafkaSrv = new KafkaServer(brokerCfg, SystemTime$.MODULE$);
+
+        kafkaSrv.startup();
     }
 
     /**
-     * Sets up embedded zooKeeper
+     * Sets up embedded ZooKeeper.
      *
-     * @throws IOException
-     * @throws InterruptedException
+     * @throws IOException If failed.
+     * @throws InterruptedException If interrupted.
      */
-    private void setupEmbeddedZooKeeper()
-        throws IOException, InterruptedException {
+    private void setupEmbeddedZooKeeper() throws IOException, InterruptedException {
         EmbeddedZooKeeper zooKeeper = new EmbeddedZooKeeper(ZK_HOST, zkPort);
+
         zooKeeper.startup();
+
         zkPort = zooKeeper.getActualPort();
+
         zkClient = new ZkClient(getZKAddress(), ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT, ZKStringSerializer$.MODULE$);
+
         zkReady = true;
     }
 
     /**
-     * @return Kafka Broker Address.
+     * @return Kafka broker address.
      */
     private static String getBrokerAddress() {
-        return ZK_HOST + ":" + BROKER_PORT;
+        return ZK_HOST + ':' + BROKER_PORT;
     }
 
     /**
-     * Gets KafKa Brofer Config
+     * Gets Kafka broker config.
      *
-     * @return Kafka Broker Config
-     * @throws IOException
+     * @return Kafka broker config.
+     * @throws IOException If failed.
      */
-    private static Properties getBrokerConfig()
-        throws IOException {
+    private static Properties getBrokerConfig() throws IOException {
         Properties props = new Properties();
+
         props.put("broker.id", "0");
         props.put("host.name", ZK_HOST);
         props.put("port", "" + BROKER_PORT);
@@ -272,60 +272,63 @@ public class KafkaEmbeddedBroker {
         props.put("zookeeper.connect", getZKAddress());
         props.put("log.flush.interval.messages", "1");
         props.put("replica.socket.timeout.ms", "1500");
+
         return props;
     }
 
     /**
-     * @return Kafka Producer Config
+     * @return Kafka Producer config.
      */
     private static ProducerConfig getProducerConfig() {
         Properties props = new Properties();
+
         props.put("metadata.broker.list", getBrokerAddress());
-        props.put("serializer.class", "kafka.serializer.StringEncoder");
-        props.put("key.serializer.class", "kafka.serializer.StringEncoder");
-        props.put("partitioner.class", "org.apache.ignite.kafka.SimplePartitioner");
+        props.put("serializer.class", StringEncoder.class.getName());
+        props.put("key.serializer.class", StringEncoder.class.getName());
+        props.put("partitioner.class", SimplePartitioner.class.getName());
+
         return new ProducerConfig(props);
     }
 
     /**
-     * Creates Temp Directory
+     * Creates temp directory.
      *
-     * @param prefix prefix
-     * @return Created File.
-     * @throws IOException
+     * @param prefix Prefix.
+     * @return Created file.
+     * @throws IOException If failed.
      */
-    private static File createTempDir(final String prefix)
-        throws IOException {
-        final Path path = Files.createTempDirectory(prefix);
-        return path.toFile();
+    private static File createTempDir( String prefix) throws IOException {
+        Path path = Files.createTempDirectory(prefix);
 
+        return path.toFile();
     }
 
     /**
-     * Creates Embedded ZooKeeper.
+     * Creates embedded ZooKeeper.
      */
     private static class EmbeddedZooKeeper {
-        /** Default ZooKeeper Host. */
+        /** Default ZooKeeper host. */
         private final String zkHost;
 
-        /** Default ZooKeeper Port. */
+        /** Default ZooKeeper port. */
         private final int zkPort;
 
-        /** NIO Context Factory. */
+        /** NIO context factory. */
         private NIOServerCnxnFactory factory;
 
-        /** Snapshot Directory. */
+        /** Snapshot directory. */
         private File snapshotDir;
 
-        /** Log Directory. */
+        /** Log directory. */
         private File logDir;
 
         /**
-         * Creates an embedded Zookeeper
-         * @param zkHost zookeeper host
-         * @param zkPort zookeeper port
+         * Creates an embedded ZooKeeper.
+         *
+         * @param zkHost ZooKeeper host.
+         * @param zkPort ZooKeeper port.
          */
-        EmbeddedZooKeeper(final String zkHost, final int zkPort) {
+        EmbeddedZooKeeper(String zkHost, int zkPort) {
             this.zkHost = zkHost;
             this.zkPort = zkPort;
         }
@@ -333,22 +336,25 @@ public class KafkaEmbeddedBroker {
         /**
          * Starts up ZooKeeper.
          *
-         * @throws IOException
-         * @throws InterruptedException
+         * @throws IOException If failed.
+         * @throws InterruptedException If interrupted.
          */
-        void startup()
-            throws IOException, InterruptedException {
+        void startup() throws IOException, InterruptedException {
             snapshotDir = createTempDir("_ss");
+
             logDir = createTempDir("_log");
-            ZooKeeperServer zooServer = new ZooKeeperServer(snapshotDir, logDir, 500);
+
+            ZooKeeperServer zkSrv = new ZooKeeperServer(snapshotDir, logDir, 500);
+
             factory = new NIOServerCnxnFactory();
+
             factory.configure(new InetSocketAddress(zkHost, zkPort), 16);
-            factory.startup(zooServer);
+
+            factory.startup(zkSrv);
         }
 
         /**
-         *
-         * @return actual port zookeeper is started
+         * @return Actual port ZooKeeper is started.
          */
         int getActualPort() {
             return factory.getLocalPort();
@@ -357,17 +363,16 @@ public class KafkaEmbeddedBroker {
         /**
          * Shuts down ZooKeeper.
          *
-         * @throws IOException
+         * @throws IOException If failed.
          */
-        void shutdown()
-            throws IOException {
+        void shutdown() throws IOException {
             if (factory != null) {
                 factory.shutdown();
 
                 U.delete(snapshotDir);
+
                 U.delete(logDir);
             }
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
index 5972639..2473990 100644
--- a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
@@ -32,31 +32,31 @@ import java.util.*;
 import java.util.concurrent.*;
 
 import static org.apache.ignite.events.EventType.*;
+import static org.apache.ignite.stream.kafka.KafkaEmbeddedBroker.*;
 
 /**
  * Tests {@link KafkaStreamer}.
  */
-public class KafkaIgniteStreamerSelfTest
-    extends GridCommonAbstractTest {
+public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
     /** Embedded Kafka. */
     private KafkaEmbeddedBroker embeddedBroker;
 
     /** Count. */
     private static final int CNT = 100;
 
-    /** Test Topic. */
+    /** Test topic. */
     private static final String TOPIC_NAME = "page_visits";
 
-    /** Kafka Partition. */
+    /** Kafka partition. */
     private static final int PARTITIONS = 4;
 
-    /** Kafka Replication Factor. */
+    /** Kafka replication factor. */
     private static final int REPLICATION_FACTOR = 1;
 
-    /** Topic Message Key Prefix. */
+    /** Topic message key prefix. */
     private static final String KEY_PREFIX = "192.168.2.";
 
-    /** Topic Message Value Url. */
+    /** Topic message value URL. */
     private static final String VALUE_URL = ",www.example.com,";
 
     /** Constructor. */
@@ -65,18 +65,15 @@ public class KafkaIgniteStreamerSelfTest
     }
 
     /** {@inheritDoc} */
-    @Override
-    protected void beforeTest()
-        throws Exception {
+    @SuppressWarnings("unchecked")
+    @Override protected void beforeTest() throws Exception {
         grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration());
 
         embeddedBroker = new KafkaEmbeddedBroker();
     }
 
     /** {@inheritDoc} */
-    @Override
-    protected void afterTest()
-        throws Exception {
+    @Override protected void afterTest() throws Exception {
         grid().cache(null).clear();
 
         embeddedBroker.shutdown();
@@ -85,76 +82,80 @@ public class KafkaIgniteStreamerSelfTest
     /**
      * Tests Kafka streamer.
      *
-     * @throws TimeoutException
-     * @throws InterruptedException
+     * @throws TimeoutException If timed out.
+     * @throws InterruptedException If interrupted.
      */
-    public void testKafkaStreamer()
-        throws TimeoutException, InterruptedException {
+    public void testKafkaStreamer() throws TimeoutException, InterruptedException {
         embeddedBroker.createTopic(TOPIC_NAME, PARTITIONS, REPLICATION_FACTOR);
 
-        Map<String, String> keyValueMap = produceStream(TOPIC_NAME);
-        consumerStream(TOPIC_NAME, keyValueMap);
+        Map<String, String> keyValMap = produceStream(TOPIC_NAME);
+
+        consumerStream(TOPIC_NAME, keyValMap);
     }
 
     /**
-     * Produces/Sends messages to Kafka.
+     * Sends messages to Kafka.
      *
      * @param topic Topic name.
      * @return Map of key value messages.
      */
-    private Map<String, String> produceStream(final String topic) {
-        final Map<String, String> keyValueMap = new HashMap<>();
-
+    private Map<String, String> produceStream(String topic) {
         // Generate random subnets.
         List<Integer> subnet = new ArrayList<>();
 
-        int i = 0;
-        while (i <= CNT)
-            subnet.add(++i);
+        for (int i = 1; i <= CNT; i++)
+            subnet.add(i);
 
         Collections.shuffle(subnet);
 
-        final List<KeyedMessage<String, String>> messages = new ArrayList<>();
-        for (int event = 0; event < CNT; event++) {
-            long runtime = new Date().getTime();
-            String ip = KEY_PREFIX + subnet.get(event);
+        List<KeyedMessage<String, String>> messages = new ArrayList<>(CNT);
+
+        Map<String, String> keyValMap = new HashMap<>();
+
+        for (int evt = 0; evt < CNT; evt++) {
+            long runtime = System.currentTimeMillis();
+
+            String ip = KEY_PREFIX + subnet.get(evt);
+
             String msg = runtime + VALUE_URL + ip;
+
             messages.add(new KeyedMessage<>(topic, ip, msg));
-            keyValueMap.put(ip, msg);
+
+            keyValMap.put(ip, msg);
         }
 
-        final Producer<String, String> producer = embeddedBroker.sendMessages(messages);
+        Producer<String, String> producer = embeddedBroker.sendMessages(messages);
+
         producer.close();
 
-        return keyValueMap;
+        return keyValMap;
     }
 
     /**
-     * Consumes Kafka Stream via ignite.
+     * Consumes Kafka stream via Ignite.
      *
      * @param topic Topic name.
-     * @param keyValueMap Expected key value map.
-     * @throws TimeoutException TimeoutException.
-     * @throws InterruptedException InterruptedException.
+     * @param keyValMap Expected key value map.
+     * @throws TimeoutException If timed out.
+     * @throws InterruptedException If interrupted.
      */
-    private void consumerStream(final String topic, final Map<String, String> keyValueMap)
+    private void consumerStream(String topic, Map<String, String> keyValMap)
         throws TimeoutException, InterruptedException {
-
         KafkaStreamer<String, String, String> kafkaStmr = null;
 
-        final Ignite ignite = grid();
-        try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(null)) {
+        Ignite ignite = grid();
 
+        try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(null)) {
             stmr.allowOverwrite(true);
             stmr.autoFlushFrequency(10);
 
-            // Configure socket streamer.
+            // Configure Kafka streamer.
             kafkaStmr = new KafkaStreamer<>();
 
             // Get the cache.
             IgniteCache<String, String> cache = ignite.cache(null);
 
-            // Set ignite instance.
+            // Set Ignite instance.
             kafkaStmr.setIgnite(ignite);
 
             // Set data streamer instance.
@@ -167,58 +168,55 @@ public class KafkaIgniteStreamerSelfTest
             kafkaStmr.setThreads(4);
 
             // Set the consumer configuration.
-            kafkaStmr.setConsumerConfig(createDefaultConsumerConfig(KafkaEmbeddedBroker.getZKAddress(),
-                "groupX"));
+            kafkaStmr.setConsumerConfig(createDefaultConsumerConfig(getZKAddress(), "groupX"));
 
             // Set the decoders.
-            StringDecoder stringDecoder = new StringDecoder(new VerifiableProperties());
-            kafkaStmr.setKeyDecoder(stringDecoder);
-            kafkaStmr.setValueDecoder(stringDecoder);
+            StringDecoder strDecoder = new StringDecoder(new VerifiableProperties());
+
+            kafkaStmr.setKeyDecoder(strDecoder);
+            kafkaStmr.setValueDecoder(strDecoder);
 
             // Start kafka streamer.
             kafkaStmr.start();
 
             final CountDownLatch latch = new CountDownLatch(CNT);
+
             IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
-                @Override
-                public boolean apply(UUID uuid, CacheEvent evt) {
+                @Override public boolean apply(UUID uuid, CacheEvent evt) {
                     latch.countDown();
+
                     return true;
                 }
             };
 
             ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
-            latch.await();
 
-            for (Map.Entry<String, String> entry : keyValueMap.entrySet()) {
-                final String key = entry.getKey();
-                final String value = entry.getValue();
+            latch.await();
 
-                final String cacheValue = cache.get(key);
-                assertEquals(value, cacheValue);
-            }
+            for (Map.Entry<String, String> entry : keyValMap.entrySet())
+                assertEquals(entry.getValue(), cache.get(entry.getKey()));
         }
-
         finally {
-            // Shutdown kafka streamer.
-            kafkaStmr.stop();
+            if (kafkaStmr != null)
+                kafkaStmr.stop();
         }
     }
 
     /**
      * Creates default consumer config.
      *
-     * @param zooKeeper Zookeeper address <server:port>.
-     * @param groupId Group Id for kafka subscriber.
-     * @return {@link ConsumerConfig} kafka consumer configuration.
+     * @param zooKeeper ZooKeeper address &lt;server:port&gt;.
+     * @param grpId Group Id for kafka subscriber.
+     * @return Kafka consumer configuration.
      */
-    private ConsumerConfig createDefaultConsumerConfig(String zooKeeper, String groupId) {
+    private ConsumerConfig createDefaultConsumerConfig(String zooKeeper, String grpId) {
         A.notNull(zooKeeper, "zookeeper");
-        A.notNull(groupId, "groupId");
+        A.notNull(grpId, "groupId");
 
         Properties props = new Properties();
+
         props.put("zookeeper.connect", zooKeeper);
-        props.put("group.id", groupId);
+        props.put("group.id", grpId);
         props.put("zookeeper.session.timeout.ms", "400");
         props.put("zookeeper.sync.time.ms", "200");
         props.put("auto.commit.interval.ms", "1000");
@@ -226,5 +224,4 @@ public class KafkaIgniteStreamerSelfTest
 
         return new ConsumerConfig(props);
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/63fce5a4/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
index b836b44..1ef4f77 100644
--- a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
@@ -18,29 +18,36 @@
 package org.apache.ignite.stream.kafka;
 
 import kafka.producer.*;
+import kafka.utils.*;
 
 /**
- * Simple Partitioner for Kafka.
+ * Simple partitioner for Kafka.
  */
 @SuppressWarnings("UnusedDeclaration")
-public class SimplePartitioner
-    implements Partitioner {
+public class SimplePartitioner implements Partitioner {
+    /**
+     * Constructs instance.
+     *
+     * @param props Properties.
+     */
+    public SimplePartitioner(VerifiableProperties props) {
+        // No-op.
+    }
 
     /**
      * Partitions the key based on the key value.
      *
      * @param key Key.
-     * @param partitionSize Partition size.
+     * @param partSize Partition size.
      * @return partition Partition.
      */
-    public int partition(Object key, int partitionSize) {
-        int partition = 0;
+    public int partition(Object key, int partSize) {
         String keyStr = (String)key;
+
         String[] keyValues = keyStr.split("\\.");
+
         Integer intKey = Integer.parseInt(keyValues[3]);
-        if (intKey > 0) {
-            partition = intKey % partitionSize;
-        }
-        return partition;
+
+        return intKey > 0 ? intKey % partSize : 0;
     }
 }



[21/25] incubator-ignite git commit: Merge branch 'ignite-sprint-7' into ignite-1086

Posted by iv...@apache.org.
Merge branch 'ignite-sprint-7' into ignite-1086


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

Branch: refs/heads/ignite-1087
Commit: 84233f2cbe7c4a9adf02aad981573c89dbef7324
Parents: d8f5b6f 334fee9
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 6 10:46:51 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 6 10:46:51 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                                  |   8 +-
 bin/ignite.sh                                   |   6 +-
 bin/include/parseargs.bat                       |   1 +
 bin/include/parseargs.sh                        |   3 +
 .../startup/cmdline/CommandLineStartup.java     |   3 +-
 .../startup/cmdline/CommandLineTransformer.java |   9 +
 .../GridCachePartitionedFailoverSelfTest.java   |   5 +
 ...acheAtomicReplicatedNodeRestartSelfTest.java |   5 +
 modules/kafka/pom.xml                           | 116 ++++++
 .../ignite/stream/kafka/KafkaStreamer.java      | 220 +++++++++++
 .../kafka/IgniteKafkaStreamerSelfTestSuite.java |  37 ++
 .../stream/kafka/KafkaEmbeddedBroker.java       | 378 +++++++++++++++++++
 .../kafka/KafkaIgniteStreamerSelfTest.java      | 227 +++++++++++
 .../ignite/stream/kafka/SimplePartitioner.java  |  53 +++
 .../util/spring/IgniteSpringHelperImpl.java     |  72 +++-
 .../IgniteExcludeInConfigurationTest.java       |  78 ++++
 .../org/apache/ignite/spring/sprint-exclude.xml |  57 +++
 .../testsuites/IgniteSpringTestSuite.java       |   2 +
 .../ignite/visor/commands/VisorConsole.scala    |   3 +-
 .../visor/commands/open/VisorOpenCommand.scala  | 319 ++++++++++++++++
 .../scala/org/apache/ignite/visor/visor.scala   | 230 +----------
 .../ignite/visor/VisorRuntimeBaseSpec.scala     |   2 +
 .../commands/kill/VisorKillCommandSpec.scala    |   1 +
 .../commands/start/VisorStartCommandSpec.scala  |   1 +
 .../commands/tasks/VisorTasksCommandSpec.scala  |   1 +
 .../commands/vvm/VisorVvmCommandSpec.scala      |   1 +
 pom.xml                                         |   1 +
 27 files changed, 1598 insertions(+), 241 deletions(-)
----------------------------------------------------------------------



[15/25] incubator-ignite git commit: ignite-428 Implement IgniteKafkaStreamer to stream data from Apache Kafka

Posted by iv...@apache.org.
ignite-428 Implement IgniteKafkaStreamer to stream data from Apache Kafka


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

Branch: refs/heads/ignite-1087
Commit: 2c41739dcd83751270b6bd30c6f2595edc68a1b1
Parents: 9f6a7f9
Author: vishal.garg <vi...@workday.com>
Authored: Mon Jun 22 19:35:08 2015 -0700
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 19:39:11 2015 +0300

----------------------------------------------------------------------
 modules/kafka/pom.xml                           | 128 +++++++
 .../ignite/stream/kafka/KafkaStreamer.java      | 179 +++++++++
 .../stream/kafka/KafkaEmbeddedBroker.java       | 373 +++++++++++++++++++
 .../kafka/KafkaIgniteStreamerSelfTest.java      | 230 ++++++++++++
 .../ignite/stream/kafka/SimplePartitioner.java  |  46 +++
 pom.xml                                         |   1 +
 6 files changed, 957 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
new file mode 100644
index 0000000..165ec1c
--- /dev/null
+++ b/modules/kafka/pom.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<!--
+    POM file.
+-->
+<project xmlns="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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.ignite</groupId>
+        <artifactId>ignite-parent</artifactId>
+        <version>1</version>
+        <relativePath>../../parent</relativePath>
+    </parent>
+
+    <artifactId>ignite-kafka</artifactId>
+    <version>1.1.1-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.kafka</groupId>
+            <artifactId>kafka_2.10</artifactId>
+            <version>0.8.2.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.sun.jmx</groupId>
+                    <artifactId>jmxri</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.sun.jdmk</groupId>
+                    <artifactId>jmxtools</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>net.sf.jopt-simple</groupId>
+                    <artifactId>jopt-simple</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-simple</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.zookeeper</groupId>
+                    <artifactId>zookeeper</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.zookeeper</groupId>
+            <artifactId>zookeeper</artifactId>
+            <version>3.4.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-log4j</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ow2.asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <version>4.2</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.gridgain</groupId>
+            <artifactId>ignite-shmem</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.8.3</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-spring</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-core</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
new file mode 100644
index 0000000..e0240ce
--- /dev/null
+++ b/modules/kafka/src/main/java/org/apache/ignite/stream/kafka/KafkaStreamer.java
@@ -0,0 +1,179 @@
+/*
+ * 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.stream.kafka;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.stream.*;
+
+import kafka.consumer.*;
+import kafka.javaapi.consumer.ConsumerConnector;
+import kafka.message.*;
+import kafka.serializer.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Server that subscribes to topic messages from Kafka broker, streams its to key-value pairs into {@link
+ * org.apache.ignite.IgniteDataStreamer} instance.
+ * <p>
+ * Uses Kafka's High Level Consumer API to read messages from Kafka
+ *
+ * @see <a href="https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example">Consumer Consumer Group
+ * Example</a>
+ */
+public class KafkaStreamer<T, K, V>
+    extends StreamAdapter<T, K, V> {
+
+    /** Logger. */
+    private IgniteLogger log;
+
+    /** Executor used to submit kafka streams. */
+    private ExecutorService executor;
+
+    /** Topic. */
+    private String topic;
+
+    /** Number of threads to process kafka streams. */
+    private int threads;
+
+    /** Kafka Consumer Config. */
+    private ConsumerConfig consumerConfig;
+
+    /** Key Decoder. */
+    private Decoder<K> keyDecoder;
+
+    /** Value Decoder. */
+    private Decoder<V> valueDecoder;
+
+    /** Kafka Consumer connector. */
+    private ConsumerConnector consumer;
+
+    /**
+     * Sets the topic.
+     *
+     * @param topic Topic Name.
+     */
+    public void setTopic(final String topic) {
+        this.topic = topic;
+    }
+
+    /**
+     * Sets the threads.
+     *
+     * @param threads Number of Threads.
+     */
+    public void setThreads(final int threads) {
+        this.threads = threads;
+    }
+
+    /**
+     * Sets the consumer config.
+     *
+     * @param consumerConfig  Consumer configuration.
+     */
+    public void setConsumerConfig(final ConsumerConfig consumerConfig) {
+        this.consumerConfig = consumerConfig;
+    }
+
+    /**
+     * Sets the key decoder.
+     *
+     * @param keyDecoder Key Decoder.
+     */
+    public void setKeyDecoder(final Decoder<K> keyDecoder) {
+        this.keyDecoder = keyDecoder;
+    }
+
+    /**
+     * Sets the value decoder.
+     *
+     * @param valueDecoder Value Decoder
+     */
+    public void setValueDecoder(final Decoder<V> valueDecoder) {
+        this.valueDecoder = valueDecoder;
+    }
+
+    /**
+     * Starts streamer.
+     *
+     * @throws IgniteException If failed.
+     */
+    public void start() {
+        A.notNull(getStreamer(), "streamer");
+        A.notNull(getIgnite(), "ignite");
+        A.notNull(topic, "topic");
+        A.notNull(keyDecoder, "key decoder");
+        A.notNull(valueDecoder, "value decoder");
+        A.notNull(consumerConfig, "kafka consumer config");
+        A.ensure(threads > 0, "threads > 0");
+
+        log = getIgnite().log();
+
+        consumer = kafka.consumer.Consumer.createJavaConsumerConnector(consumerConfig);
+
+        Map<String, Integer> topicCountMap = new HashMap<>();
+        topicCountMap.put(topic, threads);
+
+        Map<String, List<KafkaStream<K, V>>> consumerMap = consumer.createMessageStreams(topicCountMap, keyDecoder,
+            valueDecoder);
+
+        List<KafkaStream<K, V>> streams = consumerMap.get(topic);
+
+        // Now launch all the consumer threads.
+        executor = Executors.newFixedThreadPool(threads);
+
+        // Now create an object to consume the messages.
+        for (final KafkaStream<K,V> stream : streams) {
+            executor.submit(new Runnable() {
+                @Override public void run() {
+
+                    ConsumerIterator<K, V> it = stream.iterator();
+
+                    while (it.hasNext()) {
+                        final MessageAndMetadata<K, V> messageAndMetadata = it.next();
+                        getStreamer().addData(messageAndMetadata.key(), messageAndMetadata.message());
+                    }
+                }
+            });
+        }
+    }
+
+    /**
+     * Stops streamer.
+     */
+    public void stop() {
+        if (consumer != null)
+            consumer.shutdown();
+
+        if (executor != null) {
+            executor.shutdown();
+
+            try {
+                if (!executor.awaitTermination(5000, TimeUnit.MILLISECONDS))
+                    if (log.isDebugEnabled())
+                        log.debug("Timed out waiting for consumer threads to shut down, exiting uncleanly");
+            }
+            catch (InterruptedException e) {
+                if (log.isDebugEnabled())
+                    log.debug("Interrupted during shutdown, exiting uncleanly");
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
new file mode 100644
index 0000000..28533f7
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaEmbeddedBroker.java
@@ -0,0 +1,373 @@
+/*
+ * 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.stream.kafka;
+
+import org.apache.commons.io.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.zookeeper.server.*;
+
+import kafka.admin.*;
+import kafka.api.*;
+import kafka.api.Request;
+import kafka.producer.*;
+import kafka.server.*;
+import kafka.utils.*;
+import org.I0Itec.zkclient.*;
+
+import java.io.*;
+import java.net.*;
+import java.nio.file.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Kafka Embedded Broker.
+ */
+public class KafkaEmbeddedBroker {
+
+    /** Default ZooKeeper Host. */
+    private static final String ZK_HOST = "localhost";
+
+    /** Broker Port. */
+    private static final int BROKER_PORT = 9092;
+
+    /** ZooKeeper Connection Timeout. */
+    private static final int ZK_CONNECTION_TIMEOUT = 6000;
+
+    /** ZooKeeper Session Timeout. */
+    private static final int ZK_SESSION_TIMEOUT = 6000;
+
+    /** ZooKeeper port. */
+    private static int zkPort = 0;
+
+    /** Is ZooKeeper Ready. */
+    private boolean zkReady;
+
+    /** Kafka Config. */
+    private KafkaConfig brokerConfig;
+
+    /** Kafka Server. */
+    private KafkaServer kafkaServer;
+
+    /** ZooKeeper Client. */
+    private ZkClient zkClient;
+
+    /** Embedded ZooKeeper. */
+    private EmbeddedZooKeeper zooKeeper;
+
+    /**
+     * Creates an embedded Kafka Broker.
+     */
+    public KafkaEmbeddedBroker() {
+        try {
+            setupEmbeddedZooKeeper();
+            setupEmbeddedKafkaServer();
+        }
+        catch (IOException | InterruptedException e) {
+            throw new RuntimeException("failed to start Kafka Broker " + e);
+        }
+
+    }
+
+    /**
+     * @return ZooKeeper Address.
+     */
+    public static String getZKAddress() {
+        return ZK_HOST + ":" + zkPort;
+    }
+
+    /**
+     * Creates a Topic.
+     *
+     * @param topic topic name
+     * @param partitions number of paritions for the topic
+     * @param replicationFactor replication factor
+     * @throws TimeoutException
+     * @throws InterruptedException
+     */
+    public void createTopic(String topic, final int partitions, final int replicationFactor)
+        throws TimeoutException, InterruptedException {
+        AdminUtils.createTopic(zkClient, topic, partitions, replicationFactor, new Properties());
+        waitUntilMetadataIsPropagated(topic, 0, 10000, 100);
+    }
+
+    /**
+     * Sends message to Kafka Broker.
+     *
+     * @param keyedMessages List of Keyed Messages.
+     * @return Producer used to send the message.
+     */
+    public Producer sendMessages(List<KeyedMessage<String, String>> keyedMessages) {
+        Producer<String, String> producer = new Producer<>(getProducerConfig());
+        producer.send(scala.collection.JavaConversions.asScalaBuffer(keyedMessages));
+        return producer;
+    }
+
+    /**
+     * Shuts down Kafka Broker.
+     *
+     * @throws IOException
+     */
+    public void shutdown()
+        throws IOException {
+
+        zkReady = false;
+
+        if (kafkaServer != null)
+            kafkaServer.shutdown();
+
+        List<String> logDirs = scala.collection.JavaConversions.asJavaList(brokerConfig.logDirs());
+
+        for (String logDir : logDirs) {
+            FileUtils.deleteDirectory(new File(logDir));
+        }
+
+        if (zkClient != null) {
+            zkClient.close();
+            zkClient = null;
+        }
+
+        if (zooKeeper != null) {
+
+            try {
+                zooKeeper.shutdown();
+            }
+            catch (IOException e) {
+                // ignore
+            }
+
+            zooKeeper = null;
+        }
+
+    }
+
+    /**
+     * @return the Zookeeper Client
+     */
+    private ZkClient getZkClient() {
+        A.ensure(zkReady, "Zookeeper not setup yet");
+        A.notNull(zkClient, "Zookeeper client is not yet initialized");
+
+        return zkClient;
+    }
+
+    /**
+     * Checks if topic metadata is propagated.
+     *
+     * @param topic topic name
+     * @param partition partition
+     * @return true if propagated otherwise false
+     */
+    private boolean isMetadataPropagated(final String topic, final int partition) {
+        final scala.Option<PartitionStateInfo> partitionStateOption = kafkaServer.apis().metadataCache().getPartitionInfo(
+            topic, partition);
+        if (partitionStateOption.isDefined()) {
+            final PartitionStateInfo partitionState = partitionStateOption.get();
+            final LeaderAndIsr leaderAndInSyncReplicas = partitionState.leaderIsrAndControllerEpoch().leaderAndIsr();
+
+            if (ZkUtils.getLeaderForPartition(getZkClient(), topic, partition) != null
+                && Request.isValidBrokerId(leaderAndInSyncReplicas.leader())
+                && leaderAndInSyncReplicas.isr().size() >= 1)
+                return true;
+
+        }
+        return false;
+    }
+
+    /**
+     * Waits until metadata is propagated.
+     *
+     * @param topic topic name
+     * @param partition partition
+     * @param timeout timeout value in millis
+     * @param interval interval in millis to sleep
+     * @throws TimeoutException
+     * @throws InterruptedException
+     */
+    private void waitUntilMetadataIsPropagated(final String topic, final int partition, final long timeout,
+        final long interval) throws TimeoutException, InterruptedException {
+        int attempt = 1;
+        final long startTime = System.currentTimeMillis();
+
+        while (true) {
+            if (isMetadataPropagated(topic, partition))
+                return;
+
+            final long duration = System.currentTimeMillis() - startTime;
+
+            if (duration < timeout)
+                Thread.sleep(interval);
+            else
+                throw new TimeoutException("metadata propagate timed out, attempt=" + attempt);
+
+            attempt++;
+        }
+
+    }
+
+    /**
+     * Sets up embedded Kafka Server
+     *
+     * @throws IOException
+     */
+    private void setupEmbeddedKafkaServer()
+        throws IOException {
+        A.ensure(zkReady, "Zookeeper should be setup before hand");
+
+        brokerConfig = new KafkaConfig(getBrokerConfig());
+        kafkaServer = new KafkaServer(brokerConfig, SystemTime$.MODULE$);
+        kafkaServer.startup();
+    }
+
+    /**
+     * Sets up embedded zooKeeper
+     *
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    private void setupEmbeddedZooKeeper()
+        throws IOException, InterruptedException {
+        EmbeddedZooKeeper zooKeeper = new EmbeddedZooKeeper(ZK_HOST, zkPort);
+        zooKeeper.startup();
+        zkPort = zooKeeper.getActualPort();
+        zkClient = new ZkClient(getZKAddress(), ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT, ZKStringSerializer$.MODULE$);
+        zkReady = true;
+    }
+
+    /**
+     * @return Kafka Broker Address.
+     */
+    private static String getBrokerAddress() {
+        return ZK_HOST + ":" + BROKER_PORT;
+    }
+
+    /**
+     * Gets KafKa Brofer Config
+     *
+     * @return Kafka Broker Config
+     * @throws IOException
+     */
+    private static Properties getBrokerConfig()
+        throws IOException {
+        Properties props = new Properties();
+        props.put("broker.id", "0");
+        props.put("host.name", ZK_HOST);
+        props.put("port", "" + BROKER_PORT);
+        props.put("log.dir", createTempDir("_cfg").getAbsolutePath());
+        props.put("zookeeper.connect", getZKAddress());
+        props.put("log.flush.interval.messages", "1");
+        props.put("replica.socket.timeout.ms", "1500");
+        return props;
+    }
+
+    /**
+     * @return Kafka Producer Config
+     */
+    private static ProducerConfig getProducerConfig() {
+        Properties props = new Properties();
+        props.put("metadata.broker.list", getBrokerAddress());
+        props.put("serializer.class", "kafka.serializer.StringEncoder");
+        props.put("key.serializer.class", "kafka.serializer.StringEncoder");
+        props.put("partitioner.class", "org.apache.ignite.kafka.SimplePartitioner");
+        return new ProducerConfig(props);
+    }
+
+    /**
+     * Creates Temp Directory
+     *
+     * @param prefix prefix
+     * @return Created File.
+     * @throws IOException
+     */
+    private static File createTempDir(final String prefix)
+        throws IOException {
+        final Path path = Files.createTempDirectory(prefix);
+        return path.toFile();
+
+    }
+
+    /**
+     * Creates Embedded ZooKeeper.
+     */
+    private static class EmbeddedZooKeeper {
+        /** Default ZooKeeper Host. */
+        private final String zkHost;
+
+        /** Default ZooKeeper Port. */
+        private final int zkPort;
+
+        /** NIO Context Factory. */
+        private NIOServerCnxnFactory factory;
+
+        /** Snapshot Directory. */
+        private File snapshotDir;
+
+        /** Log Directory. */
+        private File logDir;
+
+        /**
+         * Creates an embedded Zookeeper
+         * @param zkHost zookeeper host
+         * @param zkPort zookeeper port
+         */
+        EmbeddedZooKeeper(final String zkHost, final int zkPort) {
+            this.zkHost = zkHost;
+            this.zkPort = zkPort;
+        }
+
+        /**
+         * Starts up ZooKeeper.
+         *
+         * @throws IOException
+         * @throws InterruptedException
+         */
+        void startup()
+            throws IOException, InterruptedException {
+            snapshotDir = createTempDir("_ss");
+            logDir = createTempDir("_log");
+            ZooKeeperServer zooServer = new ZooKeeperServer(snapshotDir, logDir, 500);
+            factory = new NIOServerCnxnFactory();
+            factory.configure(new InetSocketAddress(zkHost, zkPort), 16);
+            factory.startup(zooServer);
+        }
+
+        /**
+         *
+         * @return actual port zookeeper is started
+         */
+        int getActualPort() {
+            return factory.getLocalPort();
+        }
+
+        /**
+         * Shuts down ZooKeeper.
+         *
+         * @throws IOException
+         */
+        void shutdown()
+            throws IOException {
+            if (factory != null) {
+                factory.shutdown();
+
+                U.delete(snapshotDir);
+                U.delete(logDir);
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
new file mode 100644
index 0000000..5972639
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
@@ -0,0 +1,230 @@
+/*
+ * 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.stream.kafka;
+
+import org.apache.ignite.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import kafka.consumer.*;
+import kafka.producer.*;
+import kafka.serializer.*;
+import kafka.utils.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ * Tests {@link KafkaStreamer}.
+ */
+public class KafkaIgniteStreamerSelfTest
+    extends GridCommonAbstractTest {
+    /** Embedded Kafka. */
+    private KafkaEmbeddedBroker embeddedBroker;
+
+    /** Count. */
+    private static final int CNT = 100;
+
+    /** Test Topic. */
+    private static final String TOPIC_NAME = "page_visits";
+
+    /** Kafka Partition. */
+    private static final int PARTITIONS = 4;
+
+    /** Kafka Replication Factor. */
+    private static final int REPLICATION_FACTOR = 1;
+
+    /** Topic Message Key Prefix. */
+    private static final String KEY_PREFIX = "192.168.2.";
+
+    /** Topic Message Value Url. */
+    private static final String VALUE_URL = ",www.example.com,";
+
+    /** Constructor. */
+    public KafkaIgniteStreamerSelfTest() {
+        super(true);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected void beforeTest()
+        throws Exception {
+        grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration());
+
+        embeddedBroker = new KafkaEmbeddedBroker();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected void afterTest()
+        throws Exception {
+        grid().cache(null).clear();
+
+        embeddedBroker.shutdown();
+    }
+
+    /**
+     * Tests Kafka streamer.
+     *
+     * @throws TimeoutException
+     * @throws InterruptedException
+     */
+    public void testKafkaStreamer()
+        throws TimeoutException, InterruptedException {
+        embeddedBroker.createTopic(TOPIC_NAME, PARTITIONS, REPLICATION_FACTOR);
+
+        Map<String, String> keyValueMap = produceStream(TOPIC_NAME);
+        consumerStream(TOPIC_NAME, keyValueMap);
+    }
+
+    /**
+     * Produces/Sends messages to Kafka.
+     *
+     * @param topic Topic name.
+     * @return Map of key value messages.
+     */
+    private Map<String, String> produceStream(final String topic) {
+        final Map<String, String> keyValueMap = new HashMap<>();
+
+        // Generate random subnets.
+        List<Integer> subnet = new ArrayList<>();
+
+        int i = 0;
+        while (i <= CNT)
+            subnet.add(++i);
+
+        Collections.shuffle(subnet);
+
+        final List<KeyedMessage<String, String>> messages = new ArrayList<>();
+        for (int event = 0; event < CNT; event++) {
+            long runtime = new Date().getTime();
+            String ip = KEY_PREFIX + subnet.get(event);
+            String msg = runtime + VALUE_URL + ip;
+            messages.add(new KeyedMessage<>(topic, ip, msg));
+            keyValueMap.put(ip, msg);
+        }
+
+        final Producer<String, String> producer = embeddedBroker.sendMessages(messages);
+        producer.close();
+
+        return keyValueMap;
+    }
+
+    /**
+     * Consumes Kafka Stream via ignite.
+     *
+     * @param topic Topic name.
+     * @param keyValueMap Expected key value map.
+     * @throws TimeoutException TimeoutException.
+     * @throws InterruptedException InterruptedException.
+     */
+    private void consumerStream(final String topic, final Map<String, String> keyValueMap)
+        throws TimeoutException, InterruptedException {
+
+        KafkaStreamer<String, String, String> kafkaStmr = null;
+
+        final Ignite ignite = grid();
+        try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(null)) {
+
+            stmr.allowOverwrite(true);
+            stmr.autoFlushFrequency(10);
+
+            // Configure socket streamer.
+            kafkaStmr = new KafkaStreamer<>();
+
+            // Get the cache.
+            IgniteCache<String, String> cache = ignite.cache(null);
+
+            // Set ignite instance.
+            kafkaStmr.setIgnite(ignite);
+
+            // Set data streamer instance.
+            kafkaStmr.setStreamer(stmr);
+
+            // Set the topic.
+            kafkaStmr.setTopic(topic);
+
+            // Set the number of threads.
+            kafkaStmr.setThreads(4);
+
+            // Set the consumer configuration.
+            kafkaStmr.setConsumerConfig(createDefaultConsumerConfig(KafkaEmbeddedBroker.getZKAddress(),
+                "groupX"));
+
+            // Set the decoders.
+            StringDecoder stringDecoder = new StringDecoder(new VerifiableProperties());
+            kafkaStmr.setKeyDecoder(stringDecoder);
+            kafkaStmr.setValueDecoder(stringDecoder);
+
+            // Start kafka streamer.
+            kafkaStmr.start();
+
+            final CountDownLatch latch = new CountDownLatch(CNT);
+            IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
+                @Override
+                public boolean apply(UUID uuid, CacheEvent evt) {
+                    latch.countDown();
+                    return true;
+                }
+            };
+
+            ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
+            latch.await();
+
+            for (Map.Entry<String, String> entry : keyValueMap.entrySet()) {
+                final String key = entry.getKey();
+                final String value = entry.getValue();
+
+                final String cacheValue = cache.get(key);
+                assertEquals(value, cacheValue);
+            }
+        }
+
+        finally {
+            // Shutdown kafka streamer.
+            kafkaStmr.stop();
+        }
+    }
+
+    /**
+     * Creates default consumer config.
+     *
+     * @param zooKeeper Zookeeper address <server:port>.
+     * @param groupId Group Id for kafka subscriber.
+     * @return {@link ConsumerConfig} kafka consumer configuration.
+     */
+    private ConsumerConfig createDefaultConsumerConfig(String zooKeeper, String groupId) {
+        A.notNull(zooKeeper, "zookeeper");
+        A.notNull(groupId, "groupId");
+
+        Properties props = new Properties();
+        props.put("zookeeper.connect", zooKeeper);
+        props.put("group.id", groupId);
+        props.put("zookeeper.session.timeout.ms", "400");
+        props.put("zookeeper.sync.time.ms", "200");
+        props.put("auto.commit.interval.ms", "1000");
+        props.put("auto.offset.reset", "smallest");
+
+        return new ConsumerConfig(props);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
new file mode 100644
index 0000000..b836b44
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/SimplePartitioner.java
@@ -0,0 +1,46 @@
+/*
+ * 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.stream.kafka;
+
+import kafka.producer.*;
+
+/**
+ * Simple Partitioner for Kafka.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public class SimplePartitioner
+    implements Partitioner {
+
+    /**
+     * Partitions the key based on the key value.
+     *
+     * @param key Key.
+     * @param partitionSize Partition size.
+     * @return partition Partition.
+     */
+    public int partition(Object key, int partitionSize) {
+        int partition = 0;
+        String keyStr = (String)key;
+        String[] keyValues = keyStr.split("\\.");
+        Integer intKey = Integer.parseInt(keyValues[3]);
+        if (intKey > 0) {
+            partition = intKey % partitionSize;
+        }
+        return partition;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2c41739d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a6d1609..b47d34b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,6 +70,7 @@
         <module>modules/gce</module>
         <module>modules/cloud</module>
         <module>modules/mesos</module>
+        <module>modules/kafka</module>
     </modules>
 
     <profiles>


[11/25] incubator-ignite git commit: Merge branches 'ignite-gg-10416' and 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10416

Posted by iv...@apache.org.
Merge branches 'ignite-gg-10416' and 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10416


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

Branch: refs/heads/ignite-1087
Commit: beb697afabec3342195d301d1c68a58b3154b689
Parents: fcff50e ea90d86
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Jul 3 10:07:42 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Jul 3 10:07:42 2015 +0700

----------------------------------------------------------------------
 .../java/org/apache/ignite/IgniteCache.java     |   5 +
 .../apache/ignite/IgniteSystemProperties.java   |   3 +
 .../apache/ignite/internal/IgniteKernal.java    |   1 -
 .../managers/communication/GridIoManager.java   | 124 +++++++--
 .../managers/communication/GridIoMessage.java   |  15 +-
 .../managers/communication/GridIoPolicy.java    |  32 +--
 .../eventstorage/GridEventStorageManager.java   |   2 +-
 .../processors/cache/CacheOperationContext.java |  44 +++-
 .../internal/processors/cache/CacheType.java    |   8 +-
 .../processors/cache/GridCacheAdapter.java      |  91 ++++---
 .../processors/cache/GridCacheAtomicFuture.java |  12 +-
 .../processors/cache/GridCacheContext.java      |   4 +-
 .../processors/cache/GridCacheIoManager.java    |  12 +-
 .../processors/cache/GridCacheMvccManager.java  |   8 +-
 .../processors/cache/GridCacheProxyImpl.java    |  10 +-
 .../processors/cache/GridCacheSwapManager.java  | 257 ++++++++++++-------
 .../processors/cache/GridCacheUtils.java        |  42 +++
 .../processors/cache/IgniteCacheProxy.java      |  36 ++-
 .../GridDistributedTxFinishRequest.java         |  11 +-
 .../GridDistributedTxPrepareRequest.java        |   9 +-
 .../GridDistributedTxRemoteAdapter.java         |   3 +-
 .../distributed/dht/GridDhtTxFinishRequest.java |   3 +-
 .../cache/distributed/dht/GridDhtTxLocal.java   |   3 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java  |   3 +-
 .../cache/distributed/dht/GridDhtTxRemote.java  |   5 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  18 +-
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |  15 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  | 177 +++++++++++--
 .../near/GridNearTxFinishRequest.java           |   3 +-
 .../cache/distributed/near/GridNearTxLocal.java |   3 +-
 .../distributed/near/GridNearTxRemote.java      |   5 +-
 .../cache/transactions/IgniteInternalTx.java    |   3 +-
 .../cache/transactions/IgniteTxAdapter.java     |  11 +-
 .../transactions/IgniteTxLocalAdapter.java      |   3 +-
 .../datastructures/GridCacheAtomicLongImpl.java |  25 +-
 .../GridCacheAtomicSequenceImpl.java            |  11 +-
 .../GridCacheAtomicStampedImpl.java             |  21 +-
 .../GridCacheCountDownLatchImpl.java            |  16 +-
 .../internal/processors/igfs/IgfsContext.java   |   5 +-
 .../plugin/IgnitePluginProcessor.java           |   3 +-
 .../plugin/extensions/communication/IoPool.java |  42 +++
 .../communication/tcp/TcpCommunicationSpi.java  |   2 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java    |   5 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |   5 +-
 .../TcpDiscoveryMulticastIpFinder.java          |   2 +-
 .../communication/GridIoManagerSelfTest.java    |   2 +-
 .../cache/IgniteInternalCacheTypesTest.java     |   3 +-
 .../IgniteCachePutRetryAbstractSelfTest.java    | 147 +++++++++++
 .../dht/IgniteCachePutRetryAtomicSelfTest.java  |  34 +++
 ...gniteCachePutRetryTransactionalSelfTest.java |  74 ++++++
 ...eAtomicInvalidPartitionHandlingSelfTest.java |   5 +-
 .../GridCacheEvictionFilterSelfTest.java        |   2 -
 .../inmemory/GridTestSwapSpaceSpi.java          |   3 +-
 .../IgniteCacheFailoverTestSuite.java           |   3 +
 .../query/h2/opt/GridH2KeyValueRowOffheap.java  |   8 +-
 .../processors/query/h2/opt/GridH2Table.java    |   2 +-
 .../cache/IgniteCacheOffheapEvictQueryTest.java |   2 +-
 .../IgniteCacheQueryMultiThreadedSelfTest.java  |   4 +-
 ...QueryOffheapEvictsMultiThreadedSelfTest.java |   5 -
 .../IgniteCacheQueryNodeRestartSelfTest2.java   |   5 +
 modules/urideploy/pom.xml                       |  14 -
 61 files changed, 1053 insertions(+), 378 deletions(-)
----------------------------------------------------------------------



[03/25] incubator-ignite git commit: # Merge ignite-sprint-7 to ignite-gg-10416.

Posted by iv...@apache.org.
# Merge ignite-sprint-7 to ignite-gg-10416.


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

Branch: refs/heads/ignite-1087
Commit: ce31bae57ed9f78d9ae5ce98f9261b26c9f89186
Parents: b12c803 489ab0f
Author: Andrey <an...@gridgain.com>
Authored: Thu Jun 18 13:34:41 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jun 18 13:34:41 2015 +0700

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |  12 +
 examples/pom.xml                                |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../apache/ignite/cache/query/ScanQuery.java    |  23 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  22 +-
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   | 290 +++++++++++
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   6 +-
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   | 148 ++++++
 .../configuration/CacheConfiguration.java       |   3 +-
 .../ignite/internal/GridKernalContextImpl.java  |   5 +-
 .../apache/ignite/internal/IgniteKernal.java    |  11 +-
 .../internal/MarshallerContextAdapter.java      |  18 +-
 .../ignite/internal/MarshallerContextImpl.java  |  14 +-
 .../client/GridClientConfiguration.java         |   4 +-
 .../GridClientOptimizedMarshaller.java          |  26 +
 .../impl/GridTcpRouterNioListenerAdapter.java   |   2 +-
 .../internal/interop/InteropBootstrap.java      |   3 +-
 .../internal/interop/InteropIgnition.java       |   5 +-
 .../discovery/GridDiscoveryManager.java         |   9 +-
 .../processors/cache/GridCacheProcessor.java    |  34 +-
 .../distributed/GridCacheTxRecoveryRequest.java |  26 +-
 .../GridCacheTxRecoveryResponse.java            |  14 +-
 .../distributed/GridDistributedBaseMessage.java |  77 +--
 .../distributed/GridDistributedLockRequest.java |  54 +-
 .../GridDistributedLockResponse.java            |  14 +-
 .../GridDistributedTxFinishRequest.java         |  46 +-
 .../GridDistributedTxPrepareRequest.java        |  62 +--
 .../GridDistributedTxPrepareResponse.java       |  64 +--
 .../GridDistributedUnlockRequest.java           |   6 +-
 .../distributed/dht/GridDhtLockRequest.java     |  72 ++-
 .../distributed/dht/GridDhtLockResponse.java    |  18 +-
 .../distributed/dht/GridDhtTxFinishRequest.java |  38 +-
 .../dht/GridDhtTxPrepareRequest.java            |  54 +-
 .../dht/GridDhtTxPrepareResponse.java           |  22 +-
 .../distributed/dht/GridDhtUnlockRequest.java   |   6 +-
 .../dht/preloader/GridDhtPreloader.java         |   2 +-
 .../distributed/near/GridNearLockRequest.java   |  58 +--
 .../distributed/near/GridNearLockResponse.java  |  26 +-
 .../near/GridNearTxFinishRequest.java           |  26 +-
 .../near/GridNearTxPrepareRequest.java          |  50 +-
 .../near/GridNearTxPrepareResponse.java         |  46 +-
 .../distributed/near/GridNearUnlockRequest.java |   2 +-
 .../cache/transactions/IgniteTxHandler.java     |   3 -
 .../transactions/IgniteTxLocalAdapter.java      |   6 +-
 .../datastructures/DataStructuresProcessor.java |  67 ++-
 .../plugin/IgnitePluginProcessor.java           |  16 +-
 .../processors/query/GridQueryProcessor.java    | 102 ++--
 .../messages/GridQueryNextPageResponse.java     |   1 +
 .../rest/client/message/GridRouterRequest.java  |  18 +
 .../rest/client/message/GridRouterResponse.java |  18 +
 .../rest/protocols/tcp/GridTcpRestProtocol.java |   3 +-
 .../ignite/internal/util/IgniteUtils.java       |  21 +
 .../util/spring/IgniteSpringHelper.java         |  10 +
 .../SpringApplicationContextResource.java       |   4 +-
 .../apache/ignite/resources/SpringResource.java |   6 +-
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |  28 +-
 .../communication/tcp/TcpCommunicationSpi.java  |   2 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java    | 498 +++++++++++++------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 221 ++++----
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |  66 +++
 .../ipfinder/TcpDiscoveryIpFinderAdapter.java   |  34 +-
 .../TcpDiscoveryMulticastIpFinder.java          |  19 +-
 .../messages/TcpDiscoveryAbstractMessage.java   |  10 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../apache/ignite/internal/GridSelfTest.java    |  12 +-
 .../GridDiscoveryManagerAliveCacheSelfTest.java |  17 +-
 .../cache/CacheClientStoreSelfTest.java         | 228 +++++++++
 ...acheReadOnlyTransactionalClientSelfTest.java | 327 ------------
 .../GridCacheAbstractFailoverSelfTest.java      |   2 +
 ...ridCacheMultinodeUpdateAbstractSelfTest.java |   9 +
 .../cache/GridCachePutAllFailoverSelfTest.java  |   5 -
 .../cache/GridCacheVersionMultinodeTest.java    |   8 +-
 ...CacheP2pUnmarshallingRebalanceErrorTest.java |  15 +-
 .../IgniteCacheP2pUnmarshallingTxErrorTest.java |  14 +-
 ...ridCachePartitionNotLoadedEventSelfTest.java |  82 +++
 .../IgniteCacheClientNodeConcurrentStart.java   |  14 +-
 .../distributed/IgniteCacheManyClientsTest.java | 189 ++++++-
 .../dht/GridCacheColocatedFailoverSelfTest.java |   5 -
 .../GridCachePartitionedFailoverSelfTest.java   |   5 -
 .../GridCachePartitionedTxSalvageSelfTest.java  |  37 +-
 .../GridCacheReplicatedFailoverSelfTest.java    |   5 -
 ...CacheClientWriteBehindStoreAbstractTest.java | 104 ++++
 ...teCacheClientWriteBehindStoreAtomicTest.java |  38 ++
 .../IgnteCacheClientWriteBehindStoreTxTest.java |  32 ++
 .../DataStreamProcessorSelfTest.java            |   3 +-
 .../marshaller/MarshallerContextTestImpl.java   |  18 +
 .../tcp/TcpClientDiscoverySpiSelfTest.java      |  73 ++-
 .../junits/GridTestKernalContext.java           |   1 +
 .../junits/common/GridCommonAbstractTest.java   |  11 +-
 .../IgniteCacheFailoverTestSuite.java           |   8 -
 .../IgniteCacheFailoverTestSuite2.java          |  47 ++
 .../testsuites/IgniteCacheTestSuite4.java       |   6 +-
 .../IgniteCacheWriteBehindTestSuite.java        |   2 +
 .../testsuites/IgniteKernalSelfTestSuite.java   |   2 +-
 .../ignite/util/TestTcpCommunicationSpi.java    |  21 +
 modules/extdata/p2p/pom.xml                     |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |   2 +-
 modules/hibernate/pom.xml                       |  16 +-
 .../hibernate/CacheHibernateBlobStore.java      |  87 +---
 .../CacheHibernateBlobStoreFactory.java         | 235 +++++++++
 .../hibernate/src/test/config/factory-cache.xml |  59 +++
 .../src/test/config/factory-cache1.xml          |  61 +++
 .../config/factory-incorrect-store-cache.xml    |  56 +++
 .../CacheHibernateStoreFactorySelfTest.java     | 273 ++++++++++
 .../testsuites/IgniteHibernateTestSuite.java    |   2 +
 modules/indexing/pom.xml                        |   2 +-
 .../CacheAbstractQueryMetricsSelfTest.java      | 205 ++++++++
 .../CachePartitionedQueryMetricsSelfTest.java   |  32 ++
 .../CacheReplicatedQueryMetricsSelfTest.java    |  32 ++
 .../cache/GridCacheQueryMetricsSelfTest.java    | 206 --------
 .../query/h2/sql/BaseH2CompareQueryTest.java    |   2 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   4 +-
 modules/jcl/pom.xml                             |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   9 +-
 .../GridResourceSpringBeanInjector.java         |   2 +-
 .../util/spring/IgniteSpringHelperImpl.java     |  17 +
 .../src/test/config/incorrect-store-cache.xml   |  57 +++
 modules/spring/src/test/config/node.xml         |  43 ++
 modules/spring/src/test/config/node1.xml        |  45 ++
 .../test/config/pojo-incorrect-store-cache.xml  |  56 +++
 modules/spring/src/test/config/store-cache.xml  |  59 +++
 modules/spring/src/test/config/store-cache1.xml |  62 +++
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 +++++++
 .../testsuites/IgniteSpringTestSuite.java       |   5 +
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 .../ignite/tools/classgen/ClassesGenerator.java |  30 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 modules/yardstick/pom.xml                       |   2 +-
 pom.xml                                         |   2 +-
 154 files changed, 4386 insertions(+), 1615 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ce31bae5/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
----------------------------------------------------------------------


[08/25] incubator-ignite git commit: Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10416

Posted by iv...@apache.org.
Merge branch 'ignite-sprint-7' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-gg-10416


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

Branch: refs/heads/ignite-1087
Commit: ad3e6af49e9e86f49dd6092c29dc3de8946e0389
Parents: 7e82a68 d3783a1
Author: Andrey <an...@gridgain.com>
Authored: Thu Jul 2 09:50:59 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jul 2 09:50:59 2015 +0700

----------------------------------------------------------------------
 assembly/dependencies-fabric.xml                |   1 +
 examples/pom.xml                                |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../ignite/compute/ComputeTaskSplitAdapter.java |   2 +-
 .../configuration/CacheConfiguration.java       | 105 +++----
 .../configuration/NearCacheConfiguration.java   |  10 +-
 .../ignite/internal/GridKernalContextImpl.java  |   2 +-
 .../managers/communication/GridIoManager.java   |  49 ++--
 .../discovery/GridDiscoveryManager.java         |  32 +-
 .../cache/GridCacheDeploymentManager.java       |  10 +-
 .../processors/cache/GridCacheProcessor.java    |  62 +++-
 .../processors/cache/IgniteCacheFutureImpl.java |  42 +++
 .../processors/cache/IgniteCacheProxy.java      |   2 +-
 .../processors/clock/GridClockServer.java       |  21 +-
 .../internal/util/future/IgniteFutureImpl.java  |  18 +-
 .../shmem/IpcSharedMemoryServerEndpoint.java    |  10 +-
 .../util/nio/GridNioMessageTracker.java         |  23 +-
 .../util/VisorClusterGroupEmptyException.java   |   6 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |   2 +-
 .../TcpDiscoveryMulticastIpFinder.java          |  74 ++++-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../core/src/test/config/spark/spark-config.xml |  46 +++
 modules/core/src/test/config/tests.properties   |   6 +-
 .../IgniteTopologyPrintFormatSelfTest.java      | 289 +++++++++++++++++++
 .../cache/GridCacheDaemonNodeStopSelfTest.java  | 119 --------
 .../IgniteDaemonNodeMarshallerCacheTest.java    | 192 ++++++++++++
 .../GridP2PContinuousDeploymentSelfTest.java    |   2 -
 .../ignite/testsuites/IgniteBasicTestSuite.java |   1 +
 .../testsuites/IgniteCacheTestSuite3.java       |   1 -
 .../testsuites/IgniteKernalSelfTestSuite.java   |   1 +
 modules/core/src/test/resources/helloworld.gar  | Bin 6092 -> 0 bytes
 modules/core/src/test/resources/helloworld1.gar | Bin 6092 -> 0 bytes
 modules/core/src/test/resources/readme.txt      |   6 -
 modules/docker/Dockerfile                       |  55 ++++
 modules/docker/README.txt                       |  11 +
 modules/docker/build_users_libs.sh              |  39 +++
 modules/docker/download_ignite.sh               |  49 ++++
 modules/docker/execute.sh                       |  62 ++++
 modules/docker/run.sh                           |  34 +++
 modules/extdata/p2p/pom.xml                     |   4 +-
 modules/extdata/uri/META-INF/ignite.xml         |  38 +++
 .../extdata/uri/modules/uri-dependency/pom.xml  |  42 +++
 .../deployment/uri/tasks/GarHelloWorldBean.java |  60 ++++
 .../src/main/resources/gar-example.properties   |  18 ++
 modules/extdata/uri/pom.xml                     |  62 +++-
 .../deployment/uri/tasks/GarHelloWorldTask.java |  81 ++++++
 .../deployment/uri/tasks/gar-spring-bean.xml    |  29 ++
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |   2 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |   2 +-
 modules/jcl/pom.xml                             |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 .../ignite/schema/model/PojoDescriptor.java     |   2 +
 .../apache/ignite/schema/model/PojoField.java   |   1 +
 .../parser/dialect/OracleMetadataDialect.java   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 .../org/apache/ignite/spark/IgniteContext.scala |  50 +++-
 .../org/apache/ignite/spark/IgniteRddSpec.scala |  18 ++
 modules/spring/pom.xml                          |   2 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/urideploy/pom.xml                       |  16 +-
 .../GridTaskUriDeploymentDeadlockSelfTest.java  |  13 +-
 .../ignite/p2p/GridP2PDisabledSelfTest.java     |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 modules/yardstick/pom.xml                       |   2 +-
 pom.xml                                         |  14 +-
 86 files changed, 1577 insertions(+), 325 deletions(-)
----------------------------------------------------------------------



[09/25] incubator-ignite git commit: # ignite-gg-10416 Extract opne command from visor cmd.

Posted by iv...@apache.org.
# ignite-gg-10416 Extract opne command from visor cmd.


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

Branch: refs/heads/ignite-1087
Commit: fcff50e386d7f8e7ab1c00b86921f667d646d819
Parents: ad3e6af
Author: Andrey <an...@gridgain.com>
Authored: Thu Jul 2 11:31:31 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jul 2 13:53:00 2015 +0700

----------------------------------------------------------------------
 .../ignite/visor/commands/VisorConsole.scala    |   3 +-
 .../visor/commands/open/VisorOpenCommand.scala  | 319 +++++++++++++++++++
 .../scala/org/apache/ignite/visor/visor.scala   | 231 +-------------
 .../ignite/visor/VisorRuntimeBaseSpec.scala     |   2 +
 .../commands/kill/VisorKillCommandSpec.scala    |   1 +
 .../commands/start/VisorStartCommandSpec.scala  |   1 +
 .../commands/tasks/VisorTasksCommandSpec.scala  |   1 +
 .../commands/vvm/VisorVvmCommandSpec.scala      |   1 +
 8 files changed, 340 insertions(+), 219 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
index d4ac39d..bcfc6e0 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
@@ -71,6 +71,7 @@ class VisorConsole {
         org.apache.ignite.visor.commands.gc.VisorGcCommand
         org.apache.ignite.visor.commands.kill.VisorKillCommand
         org.apache.ignite.visor.commands.node.VisorNodeCommand
+        org.apache.ignite.visor.commands.open.VisorOpenCommand
         org.apache.ignite.visor.commands.ping.VisorPingCommand
         org.apache.ignite.visor.commands.start.VisorStartCommand
         org.apache.ignite.visor.commands.tasks.VisorTasksCommand
@@ -178,7 +179,7 @@ class VisorConsole {
                     buf.append(line.dropRight(1))
                 }
                 else {
-                    if (buf.size != 0) {
+                    if (buf.nonEmpty) {
                         buf.append(line)
 
                         line = buf.toString()

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
new file mode 100644
index 0000000..6498baf
--- /dev/null
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
@@ -0,0 +1,319 @@
+/*
+ *
+ *  * 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.visor.commands.open
+
+import org.apache.ignite.IgniteSystemProperties._
+import org.apache.ignite.configuration.IgniteConfiguration
+import org.apache.ignite.internal.IgniteComponentType._
+import org.apache.ignite.internal.IgniteEx
+import org.apache.ignite.internal.util.scala.impl
+import org.apache.ignite.internal.util.spring.IgniteSpringHelper
+import org.apache.ignite.internal.util.{IgniteUtils => U}
+import org.apache.ignite.logger.NullLogger
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi
+import org.apache.ignite.visor.commands.common.{VisorConsoleCommand, VisorTextTable}
+import org.apache.ignite.visor.visor._
+import org.apache.ignite.visor.{VisorTag, visor}
+import org.apache.ignite.{IgniteException, IgniteSystemProperties, Ignition}
+
+import java.net.URL
+
+import scala.language.{implicitConversions, reflectiveCalls}
+
+/**
+ * ==Overview==
+ * Contains Visor command `node` implementation.
+ *
+ * ==Help==
+ * {{{
+ * +--------------------------------+
+ * | node | Prints node statistics. |
+ * +--------------------------------+
+ * }}}
+ *
+ * ====Specification====
+ * {{{
+ *     node "{-id8=<node-id8>|-id=<node-id>} {-a}"
+ *     node
+ * }}}
+ *
+ * ====Arguments====
+ * {{{
+ *     -id8=<node-id8>
+ *         ID8 of node. Either '-id8' or '-id' can be specified.
+ *         If neither specified - command starts in interactive mode.
+ *     -id=<node-id>
+ *         Full ID of node. Either '-id8' or '-id' can  be specified.
+ *         If neither specified - command starts in interactive mode.
+ *     -a
+ *         Print extended information.
+ *         By default - only abbreviated statistics is printed.
+ * }}}
+ *
+ * ====Examples====
+ * {{{
+ *     node
+ *         Starts command in interactive mode.
+ *     node "-id8=12345678"
+ *         Prints statistics for specified node.
+ *     node "-id8=12345678 -a"
+ *         Prints full statistics for specified node.
+ * }}}
+ */
+class VisorOpenCommand extends VisorConsoleCommand {
+    @impl protected val name = "open"
+
+    /** Default configuration path relative to Ignite home. */
+    private final val DFLT_CFG = "config/default-config.xml"
+
+    /**
+     * ==Command==
+     * Connects Visor console to the default grid.
+     *
+     * ==Example==
+     * <ex>open</ex>
+     * Connects to the default grid.
+     */
+    def open() {
+        open("")
+    }
+
+    /**
+     * ==Command==
+     * Connects Visor console to default or named grid.
+     *
+     * ==Examples==
+     * <ex>open -g=mygrid</ex>
+     * Connects to 'mygrid' grid.
+     *
+     * @param args Command arguments.
+     */
+    def open(args: String) {
+        assert(args != null)
+
+        if (isConnected) {
+            warn("Visor is already connected. Disconnect first.")
+
+            return
+        }
+
+        try {
+            def configuration(path: String): IgniteConfiguration = {
+                assert(path != null)
+
+                val url =
+                    try
+                        new URL(path)
+                    catch {
+                        case e: Exception =>
+                            val url = U.resolveIgniteUrl(path)
+
+                            if (url == null)
+                                throw new IgniteException("Ignite configuration path is invalid: " + path, e)
+
+                            url
+                    }
+
+                // Add no-op logger to remove no-appender warning.
+                val log4jTup =
+                    if (classOf[Ignition].getClassLoader.getResource("org/apache/log4j/Appender.class") != null)
+                        U.addLog4jNoOpLogger()
+                    else
+                        null
+
+                val spring: IgniteSpringHelper = SPRING.create(false)
+
+                val cfgs =
+                    try
+                        // Cache, IGFS, indexing SPI configurations should be excluded from daemon node config.
+                        spring.loadConfigurations(url, "cacheConfiguration", "fileSystemConfiguration",
+                            "indexingSpi").get1()
+                    finally {
+                        if (log4jTup != null)
+                            U.removeLog4jNoOpLogger(log4jTup)
+                    }
+
+                if (cfgs == null || cfgs.isEmpty)
+                    throw new IgniteException("Can't find grid configuration in: " + url)
+
+                if (cfgs.size > 1)
+                    throw new IgniteException("More than one grid configuration found in: " + url)
+
+                val cfg = cfgs.iterator().next()
+
+                // Setting up 'Config URL' for properly print in console.
+                System.setProperty(IgniteSystemProperties.IGNITE_CONFIG_URL, url.getPath)
+
+                var cpuCnt = Runtime.getRuntime.availableProcessors
+
+                if (cpuCnt < 4)
+                    cpuCnt = 4
+
+                cfg.setConnectorConfiguration(null)
+
+                // All thread pools are overridden to have size equal to number of CPUs.
+                cfg.setPublicThreadPoolSize(cpuCnt)
+                cfg.setSystemThreadPoolSize(cpuCnt)
+                cfg.setPeerClassLoadingThreadPoolSize(cpuCnt)
+
+                var ioSpi = cfg.getCommunicationSpi
+
+                if (ioSpi == null)
+                    ioSpi = new TcpCommunicationSpi()
+
+                cfg
+            }
+
+            val argLst = parseArgs(args)
+
+            val path = argValue("cpath", argLst)
+            val dflt = hasArgFlag("d", argLst)
+
+            val (cfg, cfgPath) =
+                if (path.isDefined)
+                    (configuration(path.get), path.get)
+                else if (dflt)
+                    (configuration(DFLT_CFG), "<default>")
+                else {
+                    // If configuration file is not defined in arguments,
+                    // ask to choose from the list
+                    askConfigFile() match {
+                        case Some(p) =>
+                            nl()
+
+                            (VisorTextTable() +=("Using configuration", p)) render()
+
+                            nl()
+
+                            (configuration(p), p)
+                        case None =>
+                            return
+                    }
+                }
+
+            open(cfg, cfgPath)
+        }
+        catch {
+            case e: IgniteException =>
+                warn(e.getMessage)
+                warn("Type 'help open' to see how to use this command.")
+
+                status("q")
+        }
+    }
+
+    /**
+     * Connects Visor console to configuration with path.
+     *
+     * @param cfg Configuration.
+     * @param cfgPath Configuration path.
+     */
+    def open(cfg: IgniteConfiguration, cfgPath: String) = {
+        val daemon = Ignition.isDaemon
+
+        val shutdownHook = IgniteSystemProperties.getString(IGNITE_NO_SHUTDOWN_HOOK, "false")
+
+        // Make sure Visor console starts as daemon node.
+        Ignition.setDaemon(true)
+
+        // Make sure visor starts without shutdown hook.
+        System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, "true")
+
+        // Set NullLoger in quite mode.
+        if ("true".equalsIgnoreCase(sys.props.getOrElse(IGNITE_QUIET, "true")))
+            cfg.setGridLogger(new NullLogger)
+
+        val startedGridName = try {
+            Ignition.start(cfg).name
+        }
+        finally {
+            Ignition.setDaemon(daemon)
+
+            System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, shutdownHook)
+        }
+
+        ignite =
+            try
+                Ignition.ignite(startedGridName).asInstanceOf[IgniteEx]
+            catch {
+                case _: IllegalStateException =>
+                    throw new IgniteException("Named grid unavailable: " + startedGridName)
+            }
+
+        visor.open(startedGridName, cfgPath)
+    }
+}
+
+/**
+ * Companion object that does initialization of the command.
+ */
+object VisorOpenCommand {
+    /** Singleton command. */
+    private val cmd = new VisorOpenCommand
+
+    // Adds command's help to visor.
+    addHelp(
+        name = "open",
+        shortInfo = "Connects Visor console to the grid.",
+        longInfo = Seq(
+            "Connects Visor console to the grid. Note that P2P class loading",
+            "should be enabled on all nodes.",
+            " ",
+            "If neither '-cpath' or '-d' are provided, command will ask",
+            "user to select Ignite configuration file in interactive mode."
+        ),
+        spec = Seq(
+            "open -cpath=<path>",
+            "open -d"
+        ),
+        args = Seq(
+            "-cpath=<path>" -> Seq(
+                "Ignite configuration path.",
+                "Can be absolute, relative to Ignite home folder or any well formed URL."
+            ),
+            "-d" -> Seq(
+                "Flag forces the command to connect to grid using default Ignite configuration file.",
+                "without interactive mode."
+            )
+        ),
+        examples = Seq(
+            "open" ->
+                "Prompts user to select Ignite configuration file in interactive mode.",
+            "open -d" ->
+                "Connects Visor console to grid using default Ignite configuration file.",
+            "open -cpath=/gg/config/mycfg.xml" ->
+                "Connects Visor console to grid using Ignite configuration from provided file."
+        ),
+        emptyArgs = cmd.open,
+        withArgs = cmd.open
+    )
+
+    /**
+     * Singleton.
+     */
+    def apply() = cmd
+
+    /**
+     * Implicit converter from visor to commands "pimp".
+     *
+     * @param vs Visor tagging trait.
+     */
+    implicit def fromNode2Visor(vs: VisorTag): VisorOpenCommand = cmd
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
index 5f63f23..67e3d70 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
@@ -17,23 +17,17 @@
 
 package org.apache.ignite.visor
 
-import org.apache.ignite.IgniteSystemProperties._
 import org.apache.ignite._
 import org.apache.ignite.cluster.{ClusterGroup, ClusterGroupEmptyException, ClusterMetrics, ClusterNode}
-import org.apache.ignite.configuration.IgniteConfiguration
 import org.apache.ignite.events.EventType._
 import org.apache.ignite.events.{DiscoveryEvent, Event}
-import org.apache.ignite.internal.IgniteComponentType._
 import org.apache.ignite.internal.IgniteEx
 import org.apache.ignite.internal.IgniteNodeAttributes._
 import org.apache.ignite.internal.cluster.ClusterGroupEmptyCheckedException
 import org.apache.ignite.internal.util.lang.{GridFunc => F}
-import org.apache.ignite.internal.util.spring.IgniteSpringHelper
 import org.apache.ignite.internal.util.typedef._
 import org.apache.ignite.internal.util.{GridConfigurationFinder, IgniteUtils => U}
 import org.apache.ignite.lang._
-import org.apache.ignite.logger.NullLogger
-import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi
 import org.apache.ignite.thread.IgniteThreadPoolExecutor
 import org.apache.ignite.visor.commands.common.VisorTextTable
 
@@ -213,9 +207,6 @@ object visor extends VisorTag {
      */
     private final val DFLT_LOG_PATH = "visor/visor-log"
 
-    /** Default configuration path relative to Ignite home. */
-    private final val DFLT_CFG = "config/default-config.xml"
-
     /** Log file. */
     private var logFile: File = null
 
@@ -429,42 +420,6 @@ object visor extends VisorTag {
         withArgs = status
     )
 
-    addHelp(
-        name = "open",
-        shortInfo = "Connects Visor console to the grid.",
-        longInfo = Seq(
-            "Connects Visor console to the grid. Note that P2P class loading",
-            "should be enabled on all nodes.",
-            " ",
-            "If neither '-cpath' or '-d' are provided, command will ask",
-            "user to select Ignite configuration file in interactive mode."
-        ),
-        spec = Seq(
-            "open -cpath=<path>",
-            "open -d"
-        ),
-        args = Seq(
-            "-cpath=<path>" -> Seq(
-                "Ignite configuration path.",
-                "Can be absolute, relative to Ignite home folder or any well formed URL."
-            ),
-            "-d" -> Seq(
-                "Flag forces the command to connect to grid using default Ignite configuration file.",
-                "without interactive mode."
-            )
-        ),
-        examples = Seq(
-            "open" ->
-                "Prompts user to select Ignite configuration file in interactive mode.",
-            "open -d" ->
-                "Connects Visor console to grid using default Ignite configuration file.",
-            "open -cpath=/gg/config/mycfg.xml" ->
-                "Connects Visor console to grid using Ignite configuration from provided file."
-        ),
-        emptyArgs = open,
-        withArgs = open
-    )
-
     /**
      * @param name - command name.
      */
@@ -980,7 +935,7 @@ object visor extends VisorTag {
 
             val sb = new StringBuilder()
 
-            for (i <- 0 until lst.size if lst(i).nonEmpty || sb.size != 0) {
+            for (i <- 0 until lst.size if lst(i).nonEmpty || sb.nonEmpty) {
                 val arg = sb.toString + lst(i)
 
                 arg match {
@@ -1007,7 +962,7 @@ object visor extends VisorTag {
     def hasArgValue(@Nullable v: String, args: ArgList): Boolean = {
         assert(args != null)
 
-        args.find(_._2 == v).nonEmpty
+        args.exists(_._2 == v)
     }
 
     /**
@@ -1019,7 +974,7 @@ object visor extends VisorTag {
     def hasArgName(@Nullable n: String, args: ArgList): Boolean = {
         assert(args != null)
 
-        args.find(_._1 == n).nonEmpty
+        args.exists(_._1 == n)
     }
 
     /**
@@ -1032,7 +987,7 @@ object visor extends VisorTag {
     def hasArgFlag(n: String, args: ArgList): Boolean = {
         assert(n != null && args != null)
 
-        args.find((a) => a._1 == n && a._2 == null).nonEmpty
+        args.exists((a) => a._1 == n && a._2 == null)
     }
 
     /**
@@ -1525,170 +1480,22 @@ object visor extends VisorTag {
     private def blank(len: Int) = new String().padTo(len, ' ')
 
     /**
-     * ==Command==
-     * Connects Visor console to default or named grid.
-     *
-     * ==Examples==
-     * <ex>open -g=mygrid</ex>
-     * Connects to 'mygrid' grid.
-     *
-     * @param args Command arguments.
-     */
-    def open(args: String) {
-        assert(args != null)
-
-        if (isConnected) {
-            warn("Visor is already connected. Disconnect first.")
-
-            return
-        }
-
-        try {
-            def configuration(path: String): IgniteConfiguration = {
-                assert(path != null)
-
-                val url =
-                    try
-                        new URL(path)
-                    catch {
-                        case e: Exception =>
-                            val url = U.resolveIgniteUrl(path)
-
-                            if (url == null)
-                                throw new IgniteException("Ignite configuration path is invalid: " + path, e)
-
-                            url
-                    }
-
-                // Add no-op logger to remove no-appender warning.
-                val log4jTup =
-                    if (classOf[Ignition].getClassLoader.getResource("org/apache/log4j/Appender.class") != null)
-                        U.addLog4jNoOpLogger()
-                    else
-                        null
-
-                val spring: IgniteSpringHelper = SPRING.create(false)
-
-                val cfgs =
-                    try
-                        // Cache, IGFS, streamer and DR configurations should be excluded from daemon node config.
-                        spring.loadConfigurations(url, "cacheConfiguration", "fileSystemConfiguration",
-                            "streamerConfiguration", "drSenderConfiguration", "drReceiverConfiguration",
-                            "interopConfiguration", "indexingSpi").get1()
-                    finally {
-                        if (log4jTup != null)
-                            U.removeLog4jNoOpLogger(log4jTup)
-                    }
-
-                if (cfgs == null || cfgs.isEmpty)
-                    throw new IgniteException("Can't find grid configuration in: " + url)
-
-                if (cfgs.size > 1)
-                    throw new IgniteException("More than one grid configuration found in: " + url)
-
-                val cfg = cfgs.iterator().next()
-
-                // Setting up 'Config URL' for properly print in console.
-                System.setProperty(IgniteSystemProperties.IGNITE_CONFIG_URL, url.getPath)
-
-                var cpuCnt = Runtime.getRuntime.availableProcessors
-
-                if (cpuCnt < 4)
-                    cpuCnt = 4
-
-                cfg.setConnectorConfiguration(null)
-
-                // All thread pools are overridden to have size equal to number of CPUs.
-                cfg.setPublicThreadPoolSize(cpuCnt)
-                cfg.setSystemThreadPoolSize(cpuCnt)
-                cfg.setPeerClassLoadingThreadPoolSize(cpuCnt)
-
-                var ioSpi = cfg.getCommunicationSpi
-
-                if (ioSpi == null)
-                    ioSpi = new TcpCommunicationSpi()
-
-                cfg
-            }
-
-            val argLst = parseArgs(args)
-
-            val path = argValue("cpath", argLst)
-            val dflt = hasArgFlag("d", argLst)
-
-            val (cfg, cfgPath) =
-                if (path.isDefined)
-                    (configuration(path.get), path.get)
-                else if (dflt)
-                    (configuration(DFLT_CFG), "<default>")
-                else {
-                    // If configuration file is not defined in arguments,
-                    // ask to choose from the list
-                    askConfigFile() match {
-                        case Some(p) =>
-                            nl()
-
-                            (VisorTextTable() +=("Using configuration", p)) render()
-
-                            nl()
-
-                            (configuration(p), p)
-                        case None =>
-                            return
-                    }
-                }
-
-            open(cfg, cfgPath)
-        }
-        catch {
-            case e: IgniteException =>
-                warn(e.getMessage)
-                warn("Type 'help open' to see how to use this command.")
-
-                status("q")
-        }
-    }
-
-    /**
      * Connects Visor console to configuration with path.
      *
-     * @param cfg Configuration.
+     * @param gridName Name of grid instance.
      * @param cfgPath Configuration path.
      */
-    def open(cfg: IgniteConfiguration, cfgPath: String) {
-        val daemon = Ignition.isDaemon
-
-        val shutdownHook = IgniteSystemProperties.getString(IGNITE_NO_SHUTDOWN_HOOK, "false")
-
-        // Make sure Visor console starts as daemon node.
-        Ignition.setDaemon(true)
-
-        // Make sure visor starts without shutdown hook.
-        System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, "true")
-
-        // Set NullLoger in quite mode.
-        if ("true".equalsIgnoreCase(sys.props.getOrElse(IGNITE_QUIET, "true")))
-            cfg.setGridLogger(new NullLogger)
-
-        val startedGridName = try {
-             Ignition.start(cfg).name
-        }
-        finally {
-            Ignition.setDaemon(daemon)
-
-            System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, shutdownHook)
-        }
-
+    def open(gridName: String, cfgPath: String) {
         this.cfgPath = cfgPath
 
         ignite =
             try
-                Ignition.ignite(startedGridName).asInstanceOf[IgniteEx]
+                Ignition.ignite(gridName).asInstanceOf[IgniteEx]
             catch {
                 case _: IllegalStateException =>
                     this.cfgPath = null
 
-                    throw new IgniteException("Named grid unavailable: " + startedGridName)
+                    throw new IgniteException("Named grid unavailable: " + gridName)
             }
 
         assert(cfgPath != null)
@@ -1824,18 +1631,6 @@ object visor extends VisorTag {
     }
 
     /**
-     * ==Command==
-     * Connects Visor console to the default grid.
-     *
-     * ==Example==
-     * <ex>open</ex>
-     * Connects to the default grid.
-     */
-    def open() {
-        open("")
-    }
-
-    /**
      * Returns string with node id8, its memory variable, if available, and its
      * IP address (first internal address), if node is alive.
      *
@@ -2016,7 +1811,7 @@ object visor extends VisorTag {
         else if (nodes.size == 1)
             Some(nodes.head.id)
         else {
-            (0 until nodes.size) foreach (i => {
+            nodes.indices foreach (i => {
                 val n = nodes(i)
 
                 val m = n.metrics
@@ -2080,7 +1875,7 @@ object visor extends VisorTag {
             None
         }
         else {
-            (0 until neighborhood.size) foreach (i => {
+            neighborhood.indices foreach (i => {
                 val neighbors = neighborhood(i)
 
                 var ips = immutable.Set.empty[String]
@@ -2229,7 +2024,7 @@ object visor extends VisorTag {
 
         val ids = ignite.cluster.forRemotes().nodes().map(nid8).toList
 
-        (0 until ids.size).foreach(i => println((i + 1) + ": " + ids(i)))
+        ids.indices.foreach(i => println((i + 1) + ": " + ids(i)))
 
         nl()
 
@@ -2758,7 +2553,7 @@ object visor extends VisorTag {
         help()
     }
 
-    lazy val commands = cmdLst.map(_.name) ++ cmdLst.map(_.aliases).flatten
+    lazy val commands = cmdLst.map(_.name) ++ cmdLst.flatMap(_.aliases)
 
     def searchCmd(cmd: String) = cmdLst.find(c => c.name.equals(cmd) || (c.aliases != null && c.aliases.contains(cmd)))
 
@@ -2851,7 +2646,7 @@ object visor extends VisorTag {
 
                 var dec = BigDecimal.valueOf(0L)
 
-                for (i <- 0 until octets.length) dec += octets(i).toLong * math.pow(256, octets.length - 1 - i).toLong
+                for (i <- octets.indices) dec += octets(i).toLong * math.pow(256, octets.length - 1 - i).toLong
 
                 dec
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
index f27bae3..1c5e232 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/VisorRuntimeBaseSpec.scala
@@ -19,6 +19,8 @@ package org.apache.ignite.visor
 
 import org.apache.ignite.Ignition
 import org.apache.ignite.configuration.IgniteConfiguration
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
+
 import org.scalatest._
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
index 2c659b5..4719606 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/kill/VisorKillCommandSpec.scala
@@ -20,6 +20,7 @@ package org.apache.ignite.visor.commands.kill
 import org.apache.ignite.visor.visor
 import org.scalatest._
 
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
 import org.apache.ignite.visor.commands.kill.VisorKillCommand._
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
index c6404b5..49a861c 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/start/VisorStartCommandSpec.scala
@@ -20,6 +20,7 @@ package org.apache.ignite.visor.commands.start
 import org.apache.ignite.visor.visor
 import org.scalatest._
 
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
 import org.apache.ignite.visor.commands.start.VisorStartCommand._
 import org.apache.ignite.visor.commands.top.VisorTopologyCommand._
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
index db07543..fe364bc 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommandSpec.scala
@@ -26,6 +26,7 @@ import org.scalatest._
 
 import java.util
 
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
 import org.apache.ignite.visor.commands.tasks.VisorTasksCommand._
 
 import scala.collection.JavaConversions._

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcff50e3/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
index 1a4bc3e..022f6d6 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/vvm/VisorVvmCommandSpec.scala
@@ -20,6 +20,7 @@ package org.apache.ignite.visor.commands.vvm
 import org.apache.ignite.visor.visor
 import org.scalatest._
 
+import org.apache.ignite.visor.commands.open.VisorOpenCommand._
 import org.apache.ignite.visor.commands.vvm.VisorVvmCommand._
 
 /**


[07/25] incubator-ignite git commit: Merge branch 'ignite-sprint-7' into ignite-gg-10416

Posted by iv...@apache.org.
Merge branch 'ignite-sprint-7' into ignite-gg-10416


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

Branch: refs/heads/ignite-1087
Commit: 7e82a6826233f94c1601d0c68526a179d5d1104b
Parents: 0acdc2f c6187a9
Author: Andrey <an...@gridgain.com>
Authored: Mon Jun 29 13:32:10 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Jun 29 13:32:10 2015 +0700

----------------------------------------------------------------------
 examples/pom.xml                                |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/aws/pom.xml                             |   2 +-
 .../s3/S3CheckpointManagerSelfTest.java         |   2 +-
 .../checkpoint/s3/S3CheckpointSpiSelfTest.java  |   4 +-
 .../s3/S3CheckpointSpiStartStopSelfTest.java    |   2 +-
 .../s3/S3SessionCheckpointSelfTest.java         |   2 +-
 .../s3/TcpDiscoveryS3IpFinderSelfTest.java      |   2 +-
 modules/clients/pom.xml                         |   2 +-
 .../ClientAbstractConnectivitySelfTest.java     |   4 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../apache/ignite/IgniteSystemProperties.java   |   3 +
 .../org/apache/ignite/cluster/ClusterGroup.java |  18 +-
 .../org/apache/ignite/cluster/ClusterNode.java  |   2 +
 .../ignite/compute/ComputeTaskSplitAdapter.java |   2 +-
 .../configuration/IgniteReflectionFactory.java  |  81 +-
 .../ignite/internal/GridKernalContextImpl.java  |   3 +
 .../ignite/internal/MarshallerContextImpl.java  |  12 +-
 .../client/GridClientConfiguration.java         |   4 +-
 .../internal/cluster/ClusterGroupAdapter.java   |  50 +-
 .../cluster/IgniteClusterAsyncImpl.java         |  12 +-
 .../internal/managers/GridManagerAdapter.java   |   8 +-
 .../discovery/GridDiscoveryManager.java         |  30 +-
 .../affinity/AffinityTopologyVersion.java       |   7 -
 .../processors/cache/GridCacheAdapter.java      |   4 +
 .../processors/cache/GridCacheContext.java      |   2 +-
 .../processors/cache/GridCacheIoManager.java    |  64 +-
 .../GridCachePartitionExchangeManager.java      |  77 +-
 .../processors/cache/GridCacheSwapManager.java  |  12 +-
 .../processors/cache/GridCacheUtils.java        |   9 +
 .../processors/cache/IgniteCacheProxy.java      |  12 +
 .../distributed/dht/GridDhtLocalPartition.java  |  59 +-
 .../distributed/dht/GridDhtLockFuture.java      |   2 +-
 .../dht/GridDhtPartitionTopologyImpl.java       |   4 +-
 .../dht/GridDhtPartitionsReservation.java       | 292 +++++++
 .../dht/GridDhtTransactionalCacheAdapter.java   |   2 +-
 .../cache/distributed/dht/GridReservable.java   |  35 +
 .../dht/atomic/GridDhtAtomicCache.java          |   9 +-
 .../dht/preloader/GridDhtPartitionMap.java      |  26 +-
 .../GridDhtPartitionsExchangeFuture.java        |  95 ++-
 .../cache/query/GridCacheQueryManager.java      |  33 -
 .../cache/query/GridCacheTwoStepQuery.java      |  22 +-
 .../continuous/CacheContinuousQueryHandler.java |   8 +
 .../cache/transactions/IgniteTxHandler.java     |   2 +-
 .../transactions/IgniteTxLocalAdapter.java      |  12 +-
 .../datastructures/DataStructuresProcessor.java |  64 +-
 .../dr/IgniteDrDataStreamerCacheUpdater.java    |   7 +-
 .../processors/hadoop/HadoopJobInfo.java        |   4 +-
 .../hadoop/counter/HadoopCounterWriter.java     |   5 +-
 .../offheap/GridOffHeapProcessor.java           |  19 +-
 .../processors/plugin/CachePluginManager.java   |  10 +-
 .../processors/query/GridQueryIndexing.java     |  14 +-
 .../processors/query/GridQueryProcessor.java    |  21 +-
 .../messages/GridQueryNextPageResponse.java     |  34 +-
 .../h2/twostep/messages/GridQueryRequest.java   | 111 ++-
 .../processors/rest/GridRestProcessor.java      |   4 +-
 .../handlers/task/GridTaskCommandHandler.java   |  12 +-
 .../processors/task/GridTaskProcessor.java      |  23 +-
 .../processors/task/GridTaskWorker.java         |   4 +-
 .../internal/util/GridConfigurationFinder.java  |  55 +-
 .../apache/ignite/internal/util/GridDebug.java  |  48 +-
 .../ignite/internal/util/IgniteUtils.java       |   6 +-
 .../ignite/internal/util/nio/GridNioServer.java |  64 +-
 .../apache/ignite/internal/visor/VisorJob.java  |   2 +
 .../internal/visor/log/VisorLogSearchTask.java  |   2 +-
 .../visor/node/VisorNodeDataCollectorJob.java   |   4 +
 .../visor/query/VisorQueryCleanupTask.java      |  14 +
 .../util/VisorClusterGroupEmptyException.java   |  33 +
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |   7 +-
 .../org/apache/ignite/spi/IgniteSpiContext.java |   9 +-
 .../communication/tcp/TcpCommunicationSpi.java  | 146 +++-
 .../tcp/TcpCommunicationSpiMBean.java           |  19 +
 .../ignite/spi/discovery/DiscoverySpi.java      |   3 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java    | 229 ++++--
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 155 +++-
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |   3 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  51 +-
 .../tcp/internal/TcpDiscoveryNode.java          |  18 +
 .../messages/TcpDiscoveryNodeFailedMessage.java |  18 +
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../internal/ClusterGroupAbstractTest.java      | 777 ++++++++++++++++++
 .../internal/ClusterGroupHostsSelfTest.java     | 141 ++++
 .../ignite/internal/ClusterGroupSelfTest.java   | 251 ++++++
 .../internal/GridDiscoveryEventSelfTest.java    |  12 +-
 ...ridFailFastNodeFailureDetectionSelfTest.java |  17 +-
 .../internal/GridProjectionAbstractTest.java    | 784 -------------------
 .../ignite/internal/GridProjectionSelfTest.java | 251 ------
 .../apache/ignite/internal/GridSelfTest.java    |  22 +-
 .../GridTaskFailoverAffinityRunTest.java        | 170 ++++
 .../IgniteSlowClientDetectionSelfTest.java      | 187 +++++
 .../CacheReadThroughAtomicRestartSelfTest.java  |  32 +
 ...heReadThroughLocalAtomicRestartSelfTest.java |  32 +
 .../CacheReadThroughLocalRestartSelfTest.java   |  32 +
 ...dThroughReplicatedAtomicRestartSelfTest.java |  32 +
 ...cheReadThroughReplicatedRestartSelfTest.java |  32 +
 .../cache/CacheReadThroughRestartSelfTest.java  | 133 ++++
 .../CacheStoreUsageMultinodeAbstractTest.java   | 305 ++++++++
 ...eUsageMultinodeDynamicStartAbstractTest.java | 169 ++++
 ...oreUsageMultinodeDynamicStartAtomicTest.java |  32 +
 ...heStoreUsageMultinodeDynamicStartTxTest.java |  32 +
 ...reUsageMultinodeStaticStartAbstractTest.java | 158 ++++
 ...toreUsageMultinodeStaticStartAtomicTest.java |  32 +
 ...cheStoreUsageMultinodeStaticStartTxTest.java |  32 +
 .../GridCacheAbstractFailoverSelfTest.java      |   6 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |  24 +-
 .../cache/GridCacheAbstractSelfTest.java        |   2 +-
 .../cache/GridCacheDaemonNodeStopSelfTest.java  | 119 +++
 .../IgniteCacheAbstractStopBusySelfTest.java    |  30 +-
 .../IgniteCacheAtomicStopBusySelfTest.java      |   8 +-
 .../IgniteCacheP2pUnmarshallingTxErrorTest.java |  19 +-
 ...gniteCacheTransactionalStopBusySelfTest.java |   8 +-
 ...eDynamicCacheStartNoExchangeTimeoutTest.java | 466 +++++++++++
 .../cache/IgniteDynamicCacheStartSelfTest.java  |  37 +
 ...GridCacheQueueMultiNodeAbstractSelfTest.java |   4 +-
 .../GridCacheSetAbstractSelfTest.java           |  22 +-
 .../IgniteDataStructureWithJobTest.java         | 111 +++
 .../distributed/IgniteCache150ClientsTest.java  | 189 +++++
 ...teCacheClientNodePartitionsExchangeTest.java |   1 +
 .../distributed/IgniteCacheManyClientsTest.java |   2 +
 .../IgniteCacheTxMessageRecoveryTest.java       |   5 +
 ...idCacheNearOnlyMultiNodeFullApiSelfTest.java |   5 -
 ...achePartitionedMultiNodeFullApiSelfTest.java |  53 +-
 .../GridCacheReplicatedFailoverSelfTest.java    |   5 +
 .../IgniteCacheTxStoreSessionTest.java          |   4 +
 .../DataStreamerMultiThreadedSelfTest.java      |   3 +
 .../internal/util/IgniteUtilsSelfTest.java      |  22 +
 .../GridTcpCommunicationSpiConfigSelfTest.java  |   1 -
 .../tcp/TcpClientDiscoverySpiSelfTest.java      | 265 ++++++-
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java |  44 +-
 .../testframework/GridSpiTestContext.java       |   7 +-
 .../testframework/junits/GridAbstractTest.java  |   2 +-
 .../junits/GridTestKernalContext.java           |   2 +-
 .../junits/common/GridCommonAbstractTest.java   |   8 +-
 .../ignite/testsuites/IgniteBasicTestSuite.java |   7 +-
 .../IgniteCacheDataStructuresSelfTestSuite.java |   1 +
 .../ignite/testsuites/IgniteCacheTestSuite.java |   4 +-
 .../testsuites/IgniteCacheTestSuite3.java       |   1 +
 .../testsuites/IgniteCacheTestSuite4.java       |  12 +
 .../testsuites/IgniteClientTestSuite.java       |  38 +
 .../testsuites/IgniteComputeGridTestSuite.java  |   1 +
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../p2p/GridP2PContinuousDeploymentTask1.java   |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |  80 +-
 .../fs/IgniteHadoopFileSystemCounterWriter.java |   9 +-
 .../processors/hadoop/HadoopClassLoader.java    |  29 +
 .../processors/hadoop/HadoopDefaultJobInfo.java |  27 +-
 .../internal/processors/hadoop/HadoopUtils.java | 237 ------
 .../hadoop/SecondaryFileSystemProvider.java     |   3 +-
 .../hadoop/fs/HadoopFileSystemCacheUtils.java   | 241 ++++++
 .../hadoop/fs/HadoopFileSystemsUtils.java       |  11 +
 .../hadoop/fs/HadoopLazyConcurrentMap.java      |   5 +
 .../hadoop/jobtracker/HadoopJobTracker.java     |  25 +-
 .../child/HadoopChildProcessRunner.java         |   3 +-
 .../processors/hadoop/v2/HadoopV2Job.java       |  84 +-
 .../hadoop/v2/HadoopV2JobResourceManager.java   |  22 +-
 .../hadoop/v2/HadoopV2TaskContext.java          |  37 +-
 .../apache/ignite/igfs/IgfsEventsTestSuite.java |   5 +-
 .../processors/hadoop/HadoopMapReduceTest.java  |   2 +-
 .../processors/hadoop/HadoopTasksV1Test.java    |   7 +-
 .../processors/hadoop/HadoopTasksV2Test.java    |   7 +-
 .../processors/hadoop/HadoopV2JobSelfTest.java  |   6 +-
 .../collections/HadoopAbstractMapTest.java      |   3 +-
 .../testsuites/IgniteHadoopTestSuite.java       |   2 +-
 .../IgniteIgfsLinuxAndMacOSTestSuite.java       |   3 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |   2 +-
 .../processors/query/h2/IgniteH2Indexing.java   |  81 +-
 .../query/h2/sql/GridSqlQuerySplitter.java      |  49 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  | 321 ++++++--
 .../query/h2/twostep/GridMergeIndex.java        |  17 +-
 .../h2/twostep/GridMergeIndexUnsorted.java      |   7 +-
 .../h2/twostep/GridReduceQueryExecutor.java     | 650 ++++++++++++---
 .../query/h2/twostep/GridResultPage.java        |  21 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |   3 +-
 .../cache/IgniteCacheOffheapEvictQueryTest.java | 196 +++++
 .../IgniteCacheQueryMultiThreadedSelfTest.java  |   1 -
 ...QueryOffheapEvictsMultiThreadedSelfTest.java |   5 +
 ...lientQueryReplicatedNodeRestartSelfTest.java | 419 ++++++++++
 .../IgniteCacheQueryNodeRestartSelfTest.java    |  36 +-
 .../IgniteCacheQueryNodeRestartSelfTest2.java   | 383 +++++++++
 .../IgniteCacheQuerySelfTestSuite.java          |   5 +-
 modules/jcl/pom.xml                             |   2 +-
 modules/jta/pom.xml                             |   2 +-
 .../cache/jta/GridCacheXAResource.java          |  18 +-
 .../processors/cache/GridCacheJtaSelfTest.java  |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   2 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 .../commands/cache/VisorCacheCommand.scala      |   7 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 .../IgniteWebSessionSelfTestSuite.java          |   2 +-
 modules/yardstick/pom.xml                       |   2 +-
 pom.xml                                         |   2 +-
 scripts/git-patch-prop.sh                       |   2 +-
 213 files changed, 8348 insertions(+), 2249 deletions(-)
----------------------------------------------------------------------



[17/25] incubator-ignite git commit: Kafka module version changed

Posted by iv...@apache.org.
Kafka module version changed


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

Branch: refs/heads/ignite-1087
Commit: b6803e7e1d71d6f6b54b0e9cd769ec6ca91d0564
Parents: 63fce5a
Author: agura <ag...@gridgain.com>
Authored: Fri Jul 3 19:54:19 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 19:54:19 2015 +0300

----------------------------------------------------------------------
 modules/kafka/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6803e7e/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 43909bc..d0e9cd9 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-kafka</artifactId>
-    <version>1.1.6-SNAPSHOT</version>
+    <version>1.2.1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>


[14/25] incubator-ignite git commit: Merge branch 'ignite-1055' into ignite-sprint-7

Posted by iv...@apache.org.
Merge branch 'ignite-1055' into ignite-sprint-7


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

Branch: refs/heads/ignite-1087
Commit: 9f6a7f9bed05bd15807c534eb14d801bedd37970
Parents: 7828d19 251f0c8
Author: ashutak <as...@gridgain.com>
Authored: Fri Jul 3 17:52:00 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Jul 3 17:52:00 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                                              | 8 ++++++--
 bin/ignite.sh                                               | 6 +++++-
 bin/include/parseargs.bat                                   | 1 +
 bin/include/parseargs.sh                                    | 3 +++
 .../apache/ignite/startup/cmdline/CommandLineStartup.java   | 3 ++-
 .../ignite/startup/cmdline/CommandLineTransformer.java      | 9 +++++++++
 6 files changed, 26 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[24/25] incubator-ignite git commit: Merge branch 'ignite-1086' into ignite-1087

Posted by iv...@apache.org.
Merge branch 'ignite-1086' into ignite-1087


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

Branch: refs/heads/ignite-1087
Commit: 2c2def05266a7f8ead7629ee328b21d1a1aa56a3
Parents: 355e33d 95da662
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 6 11:04:17 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 6 11:04:17 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                                  |   8 +-
 bin/ignite.sh                                   |   6 +-
 bin/include/parseargs.bat                       |   1 +
 bin/include/parseargs.sh                        |   3 +
 .../startup/cmdline/CommandLineStartup.java     |   3 +-
 .../startup/cmdline/CommandLineTransformer.java |   9 +
 .../GridCachePartitionedFailoverSelfTest.java   |   5 +
 ...acheAtomicReplicatedNodeRestartSelfTest.java |   5 +
 .../TcpDiscoveryNodeConsistentIdSelfTest.java   |  24 +-
 modules/kafka/pom.xml                           | 116 ++++++
 .../ignite/stream/kafka/KafkaStreamer.java      | 220 +++++++++++
 .../kafka/IgniteKafkaStreamerSelfTestSuite.java |  37 ++
 .../stream/kafka/KafkaEmbeddedBroker.java       | 378 +++++++++++++++++++
 .../kafka/KafkaIgniteStreamerSelfTest.java      | 227 +++++++++++
 .../ignite/stream/kafka/SimplePartitioner.java  |  53 +++
 .../util/spring/IgniteSpringHelperImpl.java     |  72 +++-
 .../IgniteExcludeInConfigurationTest.java       |  78 ++++
 .../org/apache/ignite/spring/sprint-exclude.xml |  57 +++
 .../testsuites/IgniteSpringTestSuite.java       |   2 +
 .../ignite/visor/commands/VisorConsole.scala    |   3 +-
 .../visor/commands/open/VisorOpenCommand.scala  | 319 ++++++++++++++++
 .../scala/org/apache/ignite/visor/visor.scala   | 230 +----------
 .../ignite/visor/VisorRuntimeBaseSpec.scala     |   2 +
 .../commands/kill/VisorKillCommandSpec.scala    |   1 +
 .../commands/start/VisorStartCommandSpec.scala  |   1 +
 .../commands/tasks/VisorTasksCommandSpec.scala  |   1 +
 .../commands/vvm/VisorVvmCommandSpec.scala      |   1 +
 pom.xml                                         |   1 +
 28 files changed, 1616 insertions(+), 247 deletions(-)
----------------------------------------------------------------------



[19/25] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-7' into ignite-1086

Posted by iv...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-7' into ignite-1086


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

Branch: refs/heads/ignite-1087
Commit: 558df06d4da01c434c8c3647dc0608f5d18172e2
Parents: d8f5b6f f72b291
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jul 6 09:19:32 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 6 09:19:32 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                                  |   8 +-
 bin/ignite.sh                                   |   6 +-
 bin/include/parseargs.bat                       |   1 +
 bin/include/parseargs.sh                        |   3 +
 .../startup/cmdline/CommandLineStartup.java     |   3 +-
 .../startup/cmdline/CommandLineTransformer.java |   9 +
 .../GridCachePartitionedFailoverSelfTest.java   |   5 +
 modules/kafka/pom.xml                           | 116 ++++++
 .../ignite/stream/kafka/KafkaStreamer.java      | 220 +++++++++++
 .../kafka/IgniteKafkaStreamerSelfTestSuite.java |  37 ++
 .../stream/kafka/KafkaEmbeddedBroker.java       | 378 +++++++++++++++++++
 .../kafka/KafkaIgniteStreamerSelfTest.java      | 227 +++++++++++
 .../ignite/stream/kafka/SimplePartitioner.java  |  53 +++
 .../util/spring/IgniteSpringHelperImpl.java     |  72 +++-
 .../IgniteExcludeInConfigurationTest.java       |  78 ++++
 .../org/apache/ignite/spring/sprint-exclude.xml |  57 +++
 .../testsuites/IgniteSpringTestSuite.java       |   2 +
 .../ignite/visor/commands/VisorConsole.scala    |   3 +-
 .../visor/commands/open/VisorOpenCommand.scala  | 319 ++++++++++++++++
 .../scala/org/apache/ignite/visor/visor.scala   | 230 +----------
 .../ignite/visor/VisorRuntimeBaseSpec.scala     |   2 +
 .../commands/kill/VisorKillCommandSpec.scala    |   1 +
 .../commands/start/VisorStartCommandSpec.scala  |   1 +
 .../commands/tasks/VisorTasksCommandSpec.scala  |   1 +
 .../commands/vvm/VisorVvmCommandSpec.scala      |   1 +
 pom.xml                                         |   1 +
 26 files changed, 1593 insertions(+), 241 deletions(-)
----------------------------------------------------------------------



[02/25] incubator-ignite git commit: # Merge branches 'ignite-gg-10416' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into

Posted by iv...@apache.org.
# Merge branches 'ignite-gg-10416' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into


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

Branch: refs/heads/ignite-1087
Commit: b12c803026da422244856e11d4720510df50ce91
Parents: 178c4f8 b087aca
Author: Andrey <an...@gridgain.com>
Authored: Fri Jun 12 11:42:23 2015 +0300
Committer: Andrey <an...@gridgain.com>
Committed: Fri Jun 12 11:42:23 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |  15 +
 examples/config/example-cache.xml               |   2 +
 examples/pom.xml                                |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/clients/pom.xml                         |   2 +-
 .../client/router/TcpSslRouterSelfTest.java     |   5 +
 .../client/suite/IgniteClientTestSuite.java     |   3 +-
 modules/cloud/pom.xml                           |   2 +-
 .../cloud/TcpDiscoveryCloudIpFinder.java        |  25 +-
 .../TcpDiscoveryCloudIpFinderSelfTest.java      |   3 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../apache/ignite/cache/query/ScanQuery.java    |   5 +-
 .../ignite/internal/GridPluginContext.java      |   6 +
 .../apache/ignite/internal/IgniteKernal.java    |   2 +-
 .../internal/MarshallerContextAdapter.java      |  30 +-
 .../ignite/internal/MarshallerContextImpl.java  |  10 +-
 .../internal/interop/InteropIgnition.java       |  54 +-
 .../internal/interop/InteropProcessor.java      |   8 +
 .../processors/cache/GridCacheMessage.java      |  51 --
 .../processors/cache/GridCacheProcessor.java    |  27 +-
 .../processors/cache/KeyCacheObjectImpl.java    |  11 +-
 .../cache/query/GridCacheQueryManager.java      |   5 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   9 +-
 .../IgniteCacheObjectProcessorImpl.java         |  12 +-
 .../continuous/GridContinuousProcessor.java     |  15 +-
 .../datastreamer/DataStreamerCacheUpdaters.java |   2 +-
 .../datastreamer/DataStreamerImpl.java          |   8 +-
 .../portable/GridPortableInputStream.java       |  10 +
 .../processors/query/GridQueryProcessor.java    |   2 +-
 .../ignite/internal/util/IgniteUtils.java       |   3 +
 .../util/ipc/shmem/IpcSharedMemoryUtils.java    |   4 +-
 .../internal/visor/VisorMultiNodeTask.java      |   2 +-
 .../ignite/marshaller/MarshallerContext.java    |   8 +
 .../org/apache/ignite/plugin/PluginContext.java |   6 +
 .../java/org/jsr166/ConcurrentHashMap8.java     |   8 +-
 .../java/org/jsr166/ConcurrentLinkedDeque8.java | 586 ++++++-------------
 .../src/main/java/org/jsr166/LongAdder8.java    |  35 +-
 .../core/src/main/java/org/jsr166/README.txt    |  11 +
 .../src/main/java/org/jsr166/Striped64_8.java   |  22 +-
 .../java/org/jsr166/ThreadLocalRandom8.java     |  19 +-
 .../src/main/java/org/jsr166/package-info.java  |  12 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 modules/core/src/test/config/tests.properties   |   2 +-
 .../ignite/GridSuppressedExceptionSelfTest.java |   4 +-
 .../internal/GridDiscoveryEventSelfTest.java    |   6 +-
 ...ridFailFastNodeFailureDetectionSelfTest.java |   2 +
 .../GridFailoverTaskWithPredicateSelfTest.java  |   3 -
 .../GridJobMasterLeaveAwareSelfTest.java        |   2 -
 .../internal/GridJobStealingSelfTest.java       |   3 -
 ...ectionLocalJobMultipleArgumentsSelfTest.java |   2 -
 .../GridTaskExecutionContextSelfTest.java       |   9 -
 .../IgniteComputeEmptyClusterGroupTest.java     |   3 -
 .../IgniteComputeTopologyExceptionTest.java     |   9 -
 .../GridDiscoveryManagerAliveCacheSelfTest.java |   5 +
 .../cache/GridCacheAbstractSelfTest.java        |   3 -
 .../cache/GridCacheAffinityRoutingSelfTest.java |   4 +-
 .../cache/GridCacheDeploymentSelfTest.java      |   3 -
 .../cache/GridCacheEntryMemorySizeSelfTest.java |  91 +--
 .../cache/GridCacheMemoryModeSelfTest.java      |   2 -
 ...inodeUpdateNearEnabledNoBackupsSelfTest.java |   2 +-
 ...CacheMultinodeUpdateNearEnabledSelfTest.java |   2 +-
 .../processors/cache/GridCacheOffHeapTest.java  |  28 +-
 .../cache/GridCachePutAllFailoverSelfTest.java  |   5 +
 .../GridCacheReferenceCleanupSelfTest.java      |   3 -
 .../processors/cache/GridCacheStopSelfTest.java |   5 +
 .../cache/GridCacheVersionMultinodeTest.java    |   2 +-
 .../cache/IgniteCacheAbstractTest.java          |   3 -
 .../IgniteCacheEntryListenerAbstractTest.java   |  14 +-
 .../IgniteCacheInterceptorSelfTestSuite.java    |   2 +-
 .../cache/IgniteCacheInvokeReadThroughTest.java |   5 +
 ...gniteCacheTransactionalStopBusySelfTest.java |   5 +
 ...teStartCacheInTransactionAtomicSelfTest.java |  32 +
 .../IgniteStartCacheInTransactionSelfTest.java  | 254 ++++++++
 .../IgniteTxMultiThreadedAbstractTest.java      |   4 +-
 ...cheAtomicReferenceMultiNodeAbstractTest.java |  11 -
 ...GridCacheQueueMultiNodeAbstractSelfTest.java |   2 -
 ...dCacheQueueMultiNodeConsistencySelfTest.java |   5 +
 ...CacheQueueRotativeMultiNodeAbstractTest.java |  10 -
 .../GridCacheSetAbstractSelfTest.java           |   9 -
 ...omicOffheapQueueCreateMultiNodeSelfTest.java |   5 +
 ...ionedAtomicQueueCreateMultiNodeSelfTest.java |   5 +
 ...rtitionedDataStructuresFailoverSelfTest.java |   5 +
 ...edOffheapDataStructuresFailoverSelfTest.java |   5 +
 ...PartitionedQueueCreateMultiNodeSelfTest.java |   5 +
 ...dCachePartitionedQueueEntryMoveSelfTest.java |   5 +
 ...nedQueueFailoverDataConsistencySelfTest.java |   5 +
 ...eplicatedDataStructuresFailoverSelfTest.java |   5 +
 ...CacheLoadingConcurrentGridStartSelfTest.java |   5 +
 .../GridCacheAbstractJobExecutionTest.java      |   3 -
 .../GridCachePreloadLifecycleAbstractTest.java  |   2 -
 ...heAbstractTransformWriteThroughSelfTest.java |   3 -
 .../dht/GridCacheColocatedFailoverSelfTest.java |   5 +
 .../GridCacheColocatedTxExceptionSelfTest.java  |   5 +
 ...ePartitionedNearDisabledMetricsSelfTest.java |   4 +-
 ...dCachePartitionedTopologyChangeSelfTest.java |   5 +
 .../near/GridCacheNearEvictionSelfTest.java     |   3 -
 .../near/GridCacheNearTxExceptionSelfTest.java  |   5 +
 .../GridCachePartitionedFailoverSelfTest.java   |   5 +
 ...PartitionedFullApiMultithreadedSelfTest.java |   5 +
 ...idCachePartitionedHitsAndMissesSelfTest.java |   3 -
 .../GridCachePartitionedNodeRestartTest.java    |   5 +
 ...ePartitionedOptimisticTxNodeRestartTest.java |   5 +
 ...CachePartitionedTxMultiThreadedSelfTest.java |   5 +
 .../GridCacheReplicatedFailoverSelfTest.java    |   5 +
 ...eReplicatedFullApiMultithreadedSelfTest.java |   5 +
 .../GridCacheReplicatedInvalidateSelfTest.java  |   4 +-
 ...ridCacheReplicatedMultiNodeLockSelfTest.java |   5 +
 .../GridCacheReplicatedMultiNodeSelfTest.java   |   5 +
 .../GridCacheReplicatedNodeRestartSelfTest.java |   5 +
 .../GridCacheReplicatedTxExceptionSelfTest.java |   5 +
 .../replicated/GridReplicatedTxPreloadTest.java |   2 +
 ...acheAtomicReplicatedNodeRestartSelfTest.java |   5 +
 .../GridCacheEvictionFilterSelfTest.java        |   4 +-
 ...cheSynchronousEvictionsFailoverSelfTest.java |   5 +
 .../IgniteCacheExpiryPolicyAbstractTest.java    |  10 +-
 ...eCacheExpiryPolicyWithStoreAbstractTest.java |   4 +-
 ...dCacheLocalFullApiMultithreadedSelfTest.java |   5 +
 .../GridCacheLocalTxExceptionSelfTest.java      |   5 +
 .../GridCacheSwapScanQueryAbstractSelfTest.java |   3 -
 ...ridCacheContinuousQueryAbstractSelfTest.java |   2 -
 .../closure/GridClosureProcessorSelfTest.java   |  29 +-
 .../continuous/GridEventConsumeSelfTest.java    |   2 -
 .../DataStreamProcessorSelfTest.java            |  44 +-
 .../processors/igfs/IgfsModesSelfTest.java      |   4 +-
 .../internal/util/nio/GridNioSelfTest.java      |  13 +-
 .../internal/util/nio/GridNioSslSelfTest.java   |   2 +
 .../unsafe/GridUnsafeMemorySelfTest.java        |   4 +-
 .../tostring/GridToStringBuilderSelfTest.java   |   4 +-
 .../marshaller/MarshallerContextTestImpl.java   |  11 +-
 .../ignite/messaging/GridMessagingSelfTest.java |   3 -
 .../GridP2PContinuousDeploymentSelfTest.java    |   2 +
 .../p2p/GridP2PLocalDeploymentSelfTest.java     |   6 +-
 .../p2p/GridP2PRemoteClassLoadersSelfTest.java  |  31 +-
 .../spi/GridTcpSpiForwardingSelfTest.java       |   3 -
 .../ignite/testframework/GridTestUtils.java     |  14 +
 .../config/GridTestProperties.java              |  14 +-
 .../junits/IgniteTestResources.java             |  16 +-
 .../ignite/testsuites/IgniteBasicTestSuite.java |  29 +-
 .../IgniteCacheDataStructuresSelfTestSuite.java |  24 +-
 .../IgniteCacheEvictionSelfTestSuite.java       |   3 +-
 .../IgniteCacheFailoverTestSuite.java           |  22 +-
 .../IgniteCacheFullApiSelfTestSuite.java        |   8 +-
 ...niteCacheP2pUnmarshallingErrorTestSuite.java |  20 +-
 .../testsuites/IgniteCacheRestartTestSuite.java |  10 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |  44 +-
 .../testsuites/IgniteCacheTestSuite2.java       |   4 +-
 .../testsuites/IgniteCacheTestSuite3.java       |  14 +-
 .../testsuites/IgniteCacheTestSuite4.java       |  13 +-
 .../testsuites/IgniteKernalSelfTestSuite.java   |  14 +-
 .../IgniteMarshallerSelfTestSuite.java          |  28 +-
 .../testsuites/IgniteUtilSelfTestSuite.java     |  18 +-
 .../apache/ignite/util/GridRandomSelfTest.java  |   4 +-
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../tests/p2p/P2PTestTaskExternalPath1.java     |  10 +-
 .../tests/p2p/P2PTestTaskExternalPath2.java     |   8 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |   2 +-
 .../HadoopIgfs20FileSystemAbstractSelfTest.java |   4 +-
 .../IgniteHadoopFileSystemAbstractSelfTest.java |   2 +-
 .../processors/hadoop/HadoopMapReduceTest.java  |  21 +-
 .../collections/HadoopHashMapSelfTest.java      |   4 +-
 .../HadoopExternalTaskExecutionSelfTest.java    |   2 +
 .../HadoopExternalCommunicationSelfTest.java    |   5 +
 .../testsuites/IgniteHadoopTestSuite.java       |   7 +-
 modules/hibernate/pom.xml                       |   2 +-
 .../hibernate/HibernateL2CacheSelfTest.java     |   5 +
 .../HibernateL2CacheTransactionalSelfTest.java  |   5 +
 .../testsuites/IgniteHibernateTestSuite.java    |   4 +-
 modules/indexing/pom.xml                        |  18 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |  10 +-
 .../cache/GridCacheOffHeapSelfTest.java         |   1 -
 ...idCacheReduceQueryMultithreadedSelfTest.java |  10 -
 .../processors/cache/GridCacheSwapSelfTest.java |   3 -
 .../IgniteCacheAbstractFieldsQuerySelfTest.java |  13 +-
 .../cache/IgniteCacheAbstractQuerySelfTest.java |   2 -
 ...hePartitionedQueryMultiThreadedSelfTest.java |  40 +-
 .../IgniteCacheQueryMultiThreadedSelfTest.java  |   1 -
 .../IgniteCacheQueryNodeRestartSelfTest.java    |   5 +
 ...dCacheAbstractReduceFieldsQuerySelfTest.java |   1 -
 .../h2/GridIndexingSpiAbstractSelfTest.java     |   4 +-
 .../query/h2/sql/BaseH2CompareQueryTest.java    |   4 +-
 .../query/h2/sql/GridQueryParsingTest.java      |   5 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +-
 modules/jcl/pom.xml                             |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/mesos/README.txt                        |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 .../apache/ignite/mesos/ClusterProperties.java  |  15 +
 .../apache/ignite/mesos/IgniteScheduler.java    |  10 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |  40 +-
 modules/spring/pom.xml                          |   2 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 .../IgniteWebSessionSelfTestSuite.java          |   2 +-
 modules/yardstick/pom.xml                       |   2 +-
 pom.xml                                         |   2 +-
 213 files changed, 1534 insertions(+), 1037 deletions(-)
----------------------------------------------------------------------



[22/25] incubator-ignite git commit: #ignite-1086: change test.

Posted by iv...@apache.org.
#ignite-1086: change 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/f8d1e90e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f8d1e90e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f8d1e90e

Branch: refs/heads/ignite-1087
Commit: f8d1e90e942ffc996b18a6c46f96ec090b27ba61
Parents: 84233f2
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 6 10:59:44 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 6 10:59:44 2015 +0300

----------------------------------------------------------------------
 .../TcpDiscoveryNodeConsistentIdSelfTest.java   | 24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8d1e90e/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java
index 411e85d..d159d72 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNodeConsistentIdSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.spi.discovery.tcp;
 
+import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.spi.discovery.tcp.internal.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -43,7 +44,7 @@ public class TcpDiscoveryNodeConsistentIdSelfTest extends GridCommonAbstractTest
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
-        startGrids(2);
+        startGrids(1);
     }
 
     /** {@inheritDoc} */
@@ -56,13 +57,24 @@ public class TcpDiscoveryNodeConsistentIdSelfTest extends GridCommonAbstractTest
      */
     public void testConsistentId() throws Exception {
         Object id0 = grid(0).localNode().consistentId();
-        Object id1 = grid(1).localNode().consistentId();
 
-        stopAllGrids();
+        int port0 = getDiscoveryPort(grid(0));
+
+        for (int i = 0; i < 10; ++i) {
+            stopAllGrids();
+
+            startGrids(1);
 
-        startGrids(2);
+            if (port0 == getDiscoveryPort(grid(0)))
+                assertEquals(id0, grid(0).localNode().consistentId());
+        }
+    }
 
-        assertEquals(id0, grid(0).localNode().consistentId());
-        assertEquals(id1, grid(1).localNode().consistentId());
+    /**
+     * @param ignite Ignite.
+     * @return Discovery port.
+     */
+    private int getDiscoveryPort(Ignite ignite) {
+        return ((TcpDiscoveryNode) ignite.cluster().localNode()).discoveryPort();
     }
 }


[04/25] incubator-ignite git commit: # ignite-gg-10416 Fixed exclude nested beans with missing classes.

Posted by iv...@apache.org.
# ignite-gg-10416 Fixed exclude nested beans with missing classes.


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

Branch: refs/heads/ignite-1087
Commit: 99b82841e31d48580f5320d8d46e905b284f27e9
Parents: ce31bae
Author: Andrey <an...@gridgain.com>
Authored: Thu Jun 18 16:21:58 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jun 18 16:21:58 2015 +0700

----------------------------------------------------------------------
 .../util/spring/IgniteSpringHelperImpl.java     | 59 +++++++++------
 .../IgniteStartExcludesConfigurationTest.java   | 80 ++++++++++++++++++++
 .../org/apache/ignite/spring/sprint-exclude.xml | 57 ++++++++++++++
 3 files changed, 172 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99b82841/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
index e9f88ad..df53ca7 100644
--- a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
+++ b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
@@ -423,37 +423,38 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
 
         BeanFactoryPostProcessor postProc = new BeanFactoryPostProcessor() {
             /**
-             * @param beanFactory The bean factory used by the application context.
-             * @param beanName Bean name.
              * @param def Registered BeanDefinition.
              * @throws BeansException in case of errors.
              */
-            private void processBeanDefinition(ConfigurableListableBeanFactory beanFactory, String beanName,
-                BeanDefinition def) throws BeansException {
-                if (def.getBeanClassName() != null) {
-                    try {
-                        Class.forName(def.getBeanClassName());
+            private void processNested(BeanDefinition def) throws BeansException {
+                MutablePropertyValues vals = def.getPropertyValues();
+
+                for (PropertyValue val : new ArrayList<>(vals.getPropertyValueList())) {
+                    for (String excludedProp : excludedProps) {
+                        if (val.getName().equals(excludedProp)) {
+                            vals.removePropertyValue(val);
+
+                            return;
+                        }
+                    }
 
-                        MutablePropertyValues vals = def.getPropertyValues();
+                    if (val.getValue() instanceof Collection) {
+                        Collection<?> nestedVals = (Collection) val.getValue();
 
-                        for (PropertyValue val : new ArrayList<>(vals.getPropertyValueList())) {
-                            for (String excludedProp : excludedProps) {
-                                if (val.getName().equals(excludedProp)) {
-                                    vals.removePropertyValue(val);
+                        for (Object item : new ArrayList<>(nestedVals))
+                            if (item instanceof BeanDefinitionHolder) {
+                                BeanDefinitionHolder holder = (BeanDefinitionHolder)item;
 
-                                    return;
+                                try {
+                                    if (holder.getBeanDefinition().getBeanClassName() != null)
+                                        Class.forName(holder.getBeanDefinition().getBeanClassName());
+
+                                    processNested(holder.getBeanDefinition());
+                                }
+                                catch (ClassNotFoundException ignored) {
+                                    nestedVals.remove(item);
                                 }
                             }
-
-                            if (val.getValue() instanceof Iterable)
-                                for (Object beanDef : (Iterable)val.getValue())
-                                    if (beanDef instanceof BeanDefinitionHolder)
-                                        processBeanDefinition(beanFactory, beanName,
-                                            ((BeanDefinitionHolder)beanDef).getBeanDefinition());
-                        }
-                    }
-                    catch (ClassNotFoundException ignored) {
-                        ((BeanDefinitionRegistry) beanFactory).removeBeanDefinition(beanName);
                     }
                 }
             }
@@ -462,7 +463,17 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
             @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                 throws BeansException {
                 for (String beanName : beanFactory.getBeanDefinitionNames())
-                    processBeanDefinition(beanFactory, beanName, beanFactory.getBeanDefinition(beanName));
+                    try {
+                        BeanDefinition def = beanFactory.getBeanDefinition(beanName);
+
+                        if (def.getBeanClassName() != null)
+                            Class.forName(def.getBeanClassName());
+
+                        processNested(def);
+                    }
+                    catch (ClassNotFoundException ignored) {
+                        ((BeanDefinitionRegistry)beanFactory).removeBeanDefinition(beanName);
+                    }
             }
         };
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99b82841/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
new file mode 100644
index 0000000..f1332e0
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
@@ -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.
+ */
+
+package org.apache.ignite.spring;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.spring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.net.*;
+import java.util.*;
+
+import static org.apache.ignite.internal.IgniteComponentType.*;
+
+/**
+ * Checks exclude properties in spring, exclude beans with not existing classes.
+ */
+public class IgniteStartExcludesConfigurationTest extends GridCommonAbstractTest {
+    /** Tests spring exclude properties. */
+    public void testExcludes() throws Exception {
+        URL cfgLocation = U.resolveIgniteUrl(
+            "modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml");
+
+        IgniteSpringHelper spring = SPRING.create(false);
+
+        Collection<IgniteConfiguration> cfgs = spring.loadConfigurations(cfgLocation, "typeMetadata").get1();
+
+        assert cfgs != null && cfgs.size() == 1;
+
+        IgniteConfiguration cfg = cfgs.iterator().next();
+
+        assert cfg.getCacheConfiguration().length == 1;
+
+        assert cfg.getCacheConfiguration()[0].getTypeMetadata() == null;
+
+        cfgs = spring.loadConfigurations(cfgLocation, "keyType").get1();
+
+        assert cfgs != null && cfgs.size() == 1;
+
+        cfg = cfgs.iterator().next();
+
+        assert cfg.getCacheConfiguration().length == 1;
+
+        Collection<CacheTypeMetadata> typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
+
+        assert typeMetadatas.size() == 1;
+
+        assert typeMetadatas.iterator().next().getKeyType() == null;
+
+        cfgs = spring.loadConfigurations(cfgLocation).get1();
+
+        assert cfgs != null && cfgs.size() == 1;
+
+        cfg = cfgs.iterator().next();
+
+        assert cfg.getCacheConfiguration().length == 1;
+
+        typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
+
+        assert typeMetadatas.size() == 1;
+
+        assert "java.lang.Integer".equals(typeMetadatas.iterator().next().getKeyType());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99b82841/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml b/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml
new file mode 100644
index 0000000..494f786
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<!--
+    GridGain Spring configuration file to startup grid cache.
+-->
+<beans xmlns="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">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <!-- Cache configurations (all properties are optional). -->
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <!-- Configure type metadata to enable queries. -->
+                    <property name="typeMetadata">
+                        <list>
+                            <bean class="org.apache.ignite.cache.CacheTypeMetadata">
+                                <property name="keyType" value="java.lang.Integer"/>
+                                <property name="valueType" value="Organization"/>
+                                <property name="ascendingFields">
+                                    <map>
+                                        <entry key="name" value="java.lang.String"/>
+                                    </map>
+                                </property>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.CacheTypeMetadata2"/>
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+    </bean>
+
+    <bean id="grid.cfg.failed" class="org.apache.ignite.configuration.IgniteConfiguration2"/>
+</beans>


[13/25] incubator-ignite git commit: # ignite-1055: review (add option to help)

Posted by iv...@apache.org.
# ignite-1055: review (add option to help)


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

Branch: refs/heads/ignite-1087
Commit: 251f0c88377b05821e9cfcb4a6ee6caa9026adb9
Parents: 7030ee1
Author: ashutak <as...@gridgain.com>
Authored: Fri Jul 3 17:51:24 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Jul 3 17:51:24 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/startup/cmdline/CommandLineStartup.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/251f0c88/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
index 4ddbbd0..5b39069 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
@@ -158,7 +158,8 @@ public final class CommandLineStartup {
                 "    Where:",
                 "    ?, /help, -help, - show this message.",
                 "    -v               - verbose mode (quiet by default).",
-                "    -np              - no pause on exit (pause by default)");
+                "    -np              - no pause on exit (pause by default)",
+                "    -nojmx           - disable JMX monitoring (enabled by default)");
 
             if (ignite) {
                 X.error(


[12/25] incubator-ignite git commit: muted GridCachePartitionedFailoverSelfTest

Posted by iv...@apache.org.
muted GridCachePartitionedFailoverSelfTest


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

Branch: refs/heads/ignite-1087
Commit: 7828d19f3fc2b3793c2882ac1305b95960646e5c
Parents: beb697a
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jul 3 16:43:17 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jul 3 16:43:17 2015 +0300

----------------------------------------------------------------------
 .../distributed/near/GridCachePartitionedFailoverSelfTest.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7828d19f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
index 553d748..64e8f81 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
  */
 public class GridCachePartitionedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1092");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheMode cacheMode() {
         return PARTITIONED;
     }


[25/25] incubator-ignite git commit: #ignite-1087: fix test.

Posted by iv...@apache.org.
#ignite-1087: fix 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/18e4de6b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/18e4de6b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/18e4de6b

Branch: refs/heads/ignite-1087
Commit: 18e4de6b604d3a0ab9a427a43bc3e4c9ff546cfd
Parents: 2c2def0
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 6 11:11:24 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 6 11:11:24 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/closure/GridClosureProcessor.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/18e4de6b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index 1eb53ee..02b14a1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -415,7 +415,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
             ctx.task().setThreadContext(TC_AFFINITY_KEY, affKey0);
-            ctx.task().setThreadContext(TC_AFFINITY_CACHE, cacheName);
+
+            if (cacheName != null)
+                ctx.task().setThreadContext(TC_AFFINITY_CACHE, cacheName);
 
             return ctx.task().execute(new T5(node, job), null, false);
         }
@@ -449,7 +451,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
             ctx.task().setThreadContext(TC_AFFINITY_KEY, affKey0);
-            ctx.task().setThreadContext(TC_AFFINITY_CACHE, cacheName);
+
+            if (cacheName != null)
+                ctx.task().setThreadContext(TC_AFFINITY_CACHE, cacheName);
 
             return ctx.task().execute(new T4(node, job), null, false);
         }


[06/25] incubator-ignite git commit: # ignite-gg-10416 Exclude nested beans only if exclude properties exists(visor).

Posted by iv...@apache.org.
# ignite-gg-10416 Exclude nested beans only if exclude properties exists(visor).


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

Branch: refs/heads/ignite-1087
Commit: 0acdc2f9f56d1c1f104de82211b38e36388ddb43
Parents: e5fba8b
Author: Andrey <an...@gridgain.com>
Authored: Thu Jun 18 18:15:53 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Jun 18 18:21:49 2015 +0700

----------------------------------------------------------------------
 .../util/spring/IgniteSpringHelperImpl.java     | 93 +++++++++++---------
 .../IgniteExcludeInConfigurationTest.java       | 78 ++++++++++++++++
 .../IgniteStartExcludesConfigurationTest.java   | 80 -----------------
 .../testsuites/IgniteSpringTestSuite.java       |  2 +-
 4 files changed, 129 insertions(+), 124 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
index df53ca7..6cfca36 100644
--- a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
+++ b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
@@ -421,63 +421,70 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
     private static GenericApplicationContext prepareSpringContext(final String... excludedProps){
         GenericApplicationContext springCtx = new GenericApplicationContext();
 
-        BeanFactoryPostProcessor postProc = new BeanFactoryPostProcessor() {
-            /**
-             * @param def Registered BeanDefinition.
-             * @throws BeansException in case of errors.
-             */
-            private void processNested(BeanDefinition def) throws BeansException {
-                MutablePropertyValues vals = def.getPropertyValues();
-
-                for (PropertyValue val : new ArrayList<>(vals.getPropertyValueList())) {
-                    for (String excludedProp : excludedProps) {
-                        if (val.getName().equals(excludedProp)) {
-                            vals.removePropertyValue(val);
-
-                            return;
+        if (excludedProps.length > 0) {
+            BeanFactoryPostProcessor postProc = new BeanFactoryPostProcessor() {
+                /**
+                 * @param def Registered BeanDefinition.
+                 * @throws BeansException in case of errors.
+                 */
+                private void processNested(BeanDefinition def) throws BeansException {
+                    Iterator<PropertyValue> iterVals = def.getPropertyValues().getPropertyValueList().iterator();
+
+                    while (iterVals.hasNext()) {
+                        PropertyValue val = iterVals.next();
+
+                        for (String excludedProp : excludedProps) {
+                            if (val.getName().equals(excludedProp)) {
+                                iterVals.remove();
+
+                                return;
+                            }
                         }
-                    }
 
-                    if (val.getValue() instanceof Collection) {
-                        Collection<?> nestedVals = (Collection) val.getValue();
+                        if (val.getValue() instanceof Iterable) {
+                            Iterator iterNested = ((Iterable)val.getValue()).iterator();
 
-                        for (Object item : new ArrayList<>(nestedVals))
-                            if (item instanceof BeanDefinitionHolder) {
-                                BeanDefinitionHolder holder = (BeanDefinitionHolder)item;
+                            while (iterNested.hasNext()) {
+                                Object item = iterNested.next();
 
-                                try {
-                                    if (holder.getBeanDefinition().getBeanClassName() != null)
-                                        Class.forName(holder.getBeanDefinition().getBeanClassName());
+                                if (item instanceof BeanDefinitionHolder) {
+                                    BeanDefinitionHolder h = (BeanDefinitionHolder)item;
 
-                                    processNested(holder.getBeanDefinition());
-                                }
-                                catch (ClassNotFoundException ignored) {
-                                    nestedVals.remove(item);
+                                    try {
+                                        if (h.getBeanDefinition().getBeanClassName() != null)
+                                            Class.forName(h.getBeanDefinition().getBeanClassName());
+
+                                        processNested(h.getBeanDefinition());
+                                    }
+                                    catch (ClassNotFoundException ignored) {
+                                        iterNested.remove();
+                                    }
                                 }
                             }
+                        }
                     }
                 }
-            }
 
-            /** {@inheritDoc} */
-            @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
-                throws BeansException {
-                for (String beanName : beanFactory.getBeanDefinitionNames())
-                    try {
-                        BeanDefinition def = beanFactory.getBeanDefinition(beanName);
+                @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
+                    throws BeansException {
+                    for (String beanName : beanFactory.getBeanDefinitionNames()) {
+                        try {
+                            BeanDefinition def = beanFactory.getBeanDefinition(beanName);
 
-                        if (def.getBeanClassName() != null)
-                            Class.forName(def.getBeanClassName());
+                            if (def.getBeanClassName() != null)
+                                Class.forName(def.getBeanClassName());
 
-                        processNested(def);
-                    }
-                    catch (ClassNotFoundException ignored) {
-                        ((BeanDefinitionRegistry)beanFactory).removeBeanDefinition(beanName);
+                            processNested(def);
+                        }
+                        catch (ClassNotFoundException ignored) {
+                            ((BeanDefinitionRegistry)beanFactory).removeBeanDefinition(beanName);
+                        }
                     }
-            }
-        };
+                }
+            };
 
-        springCtx.addBeanFactoryPostProcessor(postProc);
+            springCtx.addBeanFactoryPostProcessor(postProc);
+        }
 
         return springCtx;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java
new file mode 100644
index 0000000..1edca77
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java
@@ -0,0 +1,78 @@
+/*
+ * 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.spring;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.spring.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.net.*;
+import java.util.*;
+
+import static org.apache.ignite.internal.IgniteComponentType.*;
+
+/**
+ * Checks excluding properties, beans with not existing classes in spring.
+ */
+public class IgniteExcludeInConfigurationTest extends GridCommonAbstractTest {
+    private URL cfgLocation = U.resolveIgniteUrl(
+        "modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml");
+
+    /** Spring should exclude properties by list and ignore beans with class not existing in classpath. */
+    public void testExclude() throws Exception {
+         IgniteSpringHelper spring = SPRING.create(false);
+
+        Collection<IgniteConfiguration> cfgs = spring.loadConfigurations(cfgLocation, "typeMetadata").get1();
+
+        assertNotNull(cfgs);
+        assertEquals(1, cfgs.size());
+
+        IgniteConfiguration cfg = cfgs.iterator().next();
+
+        assertEquals(1, cfg.getCacheConfiguration().length);
+        assertNull(cfg.getCacheConfiguration()[0].getTypeMetadata());
+
+        cfgs = spring.loadConfigurations(cfgLocation, "keyType").get1();
+
+        assertNotNull(cfgs);
+        assertEquals(1, cfgs.size());
+
+        cfg = cfgs.iterator().next();
+
+        assertEquals(1, cfg.getCacheConfiguration().length);
+
+        Collection<CacheTypeMetadata> typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
+
+        assertEquals(1, typeMetadatas.size());
+        assertNull(typeMetadatas.iterator().next().getKeyType());
+    }
+
+    /** Spring should fail if bean class not exist in classpath. */
+    public void testFail() throws Exception {
+        IgniteSpringHelper spring = SPRING.create(false);
+
+        try {
+             assertNotNull(spring.loadConfigurations(cfgLocation).get1());
+        } catch (Exception e) {
+            assertTrue(X.hasCause(e, ClassNotFoundException.class));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
deleted file mode 100644
index f1332e0..0000000
--- a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartExcludesConfigurationTest.java
+++ /dev/null
@@ -1,80 +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.spring;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.spring.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.net.*;
-import java.util.*;
-
-import static org.apache.ignite.internal.IgniteComponentType.*;
-
-/**
- * Checks exclude properties in spring, exclude beans with not existing classes.
- */
-public class IgniteStartExcludesConfigurationTest extends GridCommonAbstractTest {
-    /** Tests spring exclude properties. */
-    public void testExcludes() throws Exception {
-        URL cfgLocation = U.resolveIgniteUrl(
-            "modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml");
-
-        IgniteSpringHelper spring = SPRING.create(false);
-
-        Collection<IgniteConfiguration> cfgs = spring.loadConfigurations(cfgLocation, "typeMetadata").get1();
-
-        assert cfgs != null && cfgs.size() == 1;
-
-        IgniteConfiguration cfg = cfgs.iterator().next();
-
-        assert cfg.getCacheConfiguration().length == 1;
-
-        assert cfg.getCacheConfiguration()[0].getTypeMetadata() == null;
-
-        cfgs = spring.loadConfigurations(cfgLocation, "keyType").get1();
-
-        assert cfgs != null && cfgs.size() == 1;
-
-        cfg = cfgs.iterator().next();
-
-        assert cfg.getCacheConfiguration().length == 1;
-
-        Collection<CacheTypeMetadata> typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
-
-        assert typeMetadatas.size() == 1;
-
-        assert typeMetadatas.iterator().next().getKeyType() == null;
-
-        cfgs = spring.loadConfigurations(cfgLocation).get1();
-
-        assert cfgs != null && cfgs.size() == 1;
-
-        cfg = cfgs.iterator().next();
-
-        assert cfg.getCacheConfiguration().length == 1;
-
-        typeMetadatas = cfg.getCacheConfiguration()[0].getTypeMetadata();
-
-        assert typeMetadatas.size() == 1;
-
-        assert "java.lang.Integer".equals(typeMetadatas.iterator().next().getKeyType());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0acdc2f9/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
index 3ff927a..75d29fb 100644
--- a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
+++ b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
@@ -40,7 +40,7 @@ public class IgniteSpringTestSuite extends TestSuite {
 
         suite.addTest(IgniteResourceSelfTestSuite.suite());
 
-        suite.addTest(new TestSuite(IgniteStartExcludesConfigurationTest.class));
+        suite.addTest(new TestSuite(IgniteExcludeInConfigurationTest.class));
 
         // Tests moved to this suite since they require Spring functionality.
         suite.addTest(new TestSuite(GridP2PUserVersionChangeSelfTest.class));


[18/25] incubator-ignite git commit: Kafka streamer test suite added

Posted by iv...@apache.org.
Kafka streamer test suite added


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

Branch: refs/heads/ignite-1087
Commit: f72b291498d413d870669e8dcd7cc2a5f3b81b51
Parents: b6803e7
Author: agura <ag...@gridgain.com>
Authored: Fri Jul 3 21:18:57 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 3 21:18:57 2015 +0300

----------------------------------------------------------------------
 .../kafka/IgniteKafkaStreamerSelfTestSuite.java | 37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f72b2914/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.java
new file mode 100644
index 0000000..a2dfd17
--- /dev/null
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/IgniteKafkaStreamerSelfTestSuite.java
@@ -0,0 +1,37 @@
+/*
+ * 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.stream.kafka;
+
+import junit.framework.*;
+
+/**
+ * Apache Kafka streamer tests.
+ */
+public class IgniteKafkaStreamerSelfTestSuite extends TestSuite {
+    /**
+     * @return Test suite.
+     * @throws Exception Thrown in case of the failure.
+     */
+    public static TestSuite suite() throws Exception {
+        TestSuite suite = new TestSuite("Apache Kafka streamer Test Suite");
+
+        suite.addTest(new TestSuite(KafkaIgniteStreamerSelfTest.class));
+
+        return suite;
+    }
+}


[10/25] incubator-ignite git commit: # ignite_1055

Posted by iv...@apache.org.
# ignite_1055


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

Branch: refs/heads/ignite-1087
Commit: 7030ee191f9e229c73a85cb48e01c8255a53a0cc
Parents: b437ec7
Author: Atri <at...@gmail.com>
Authored: Mon Jun 29 21:44:01 2015 +0530
Committer: ashutak <as...@gridgain.com>
Committed: Thu Jul 2 14:05:50 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                                              | 8 ++++++--
 bin/ignite.sh                                               | 6 +++++-
 bin/include/parseargs.bat                                   | 1 +
 bin/include/parseargs.sh                                    | 3 +++
 .../ignite/startup/cmdline/CommandLineTransformer.java      | 9 +++++++++
 5 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/ignite.bat
----------------------------------------------------------------------
diff --git a/bin/ignite.bat b/bin/ignite.bat
index 1a4a58c..43cc58b 100644
--- a/bin/ignite.bat
+++ b/bin/ignite.bat
@@ -129,8 +129,12 @@ set RESTART_SUCCESS_OPT=-DIGNITE_SUCCESS_FILE=%RESTART_SUCCESS_FILE%
 ::
 :: You can specify IGNITE_JMX_PORT environment variable for overriding automatically found JMX port
 ::
-for /F "tokens=*" %%A in ('""%JAVA_HOME%\bin\java" -cp %CP% org.apache.ignite.internal.util.portscanner.GridJmxPortFinder"') do (
-    set JMX_PORT=%%A
+:: This is executed if -nojmx is not specified
+::
+if not "%NO_JMX%" == "1" (
+    for /F "tokens=*" %%A in ('""%JAVA_HOME%\bin\java" -cp %CP% org.apache.ignite.internal.util.portscanner.GridJmxPortFinder"') do (
+        set JMX_PORT=%%A
+    )
 )
 
 ::

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/ignite.sh
----------------------------------------------------------------------
diff --git a/bin/ignite.sh b/bin/ignite.sh
index 660a80f..7fbca57 100755
--- a/bin/ignite.sh
+++ b/bin/ignite.sh
@@ -71,7 +71,11 @@ RESTART_SUCCESS_OPT="-DIGNITE_SUCCESS_FILE=${RESTART_SUCCESS_FILE}"
 #
 # You can specify IGNITE_JMX_PORT environment variable for overriding automatically found JMX port
 #
-findAvailableJmxPort
+# This is executed when -nojmx is not specified
+#
+if [ "${NOJMX}" == "0" ] ; then
+    findAvailableJmxPort
+fi
 
 # Mac OS specific support to display correct name in the dock.
 osname=`uname`

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/include/parseargs.bat
----------------------------------------------------------------------
diff --git a/bin/include/parseargs.bat b/bin/include/parseargs.bat
index e8c764a..c4b35d2 100644
--- a/bin/include/parseargs.bat
+++ b/bin/include/parseargs.bat
@@ -24,6 +24,7 @@
 :: QUIET
 :: NO_PAUSE
 :: JVM_XOPTS
+:: NOJMX
 ::
 :: Script setups reasonable defaults (see below) for omitted arguments.
 ::

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/bin/include/parseargs.sh
----------------------------------------------------------------------
diff --git a/bin/include/parseargs.sh b/bin/include/parseargs.sh
index 8045348..3ab255e 100755
--- a/bin/include/parseargs.sh
+++ b/bin/include/parseargs.sh
@@ -22,6 +22,7 @@
 # INTERACTIVE
 # QUIET
 # JVM_XOPTS
+# NOJMX
 #
 # Script setups reasonable defaults (see below) for omitted arguments.
 #
@@ -35,6 +36,7 @@
 
 CONFIG=${DEFAULT_CONFIG}
 INTERACTIVE="0"
+NOJMX="0"
 QUIET="-DIGNITE_QUIET=true"
 JVM_XOPTS=""
 
@@ -42,6 +44,7 @@ while [ $# -gt 0 ]
 do
     case "$1" in
         -i) INTERACTIVE="1";;
+        -nojmx) NOJMX="1";;
         -v) QUIET="-DIGNITE_QUIET=false";;
         -J*) JVM_XOPTS="$JVM_XOPTS ${1:2}";;
         *) CONFIG="$1";;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7030ee19/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
index 6b2c809..ae0c587 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
@@ -56,6 +56,9 @@ public class CommandLineTransformer {
     /** No pause mode. */
     private boolean noPause;
 
+    /** No JMX mode. */
+    private boolean noJMX;
+
     /** Supported parameter, parsed manually. */
     private String jvmOptions = "";
 
@@ -132,6 +135,11 @@ public class CommandLineTransformer {
 
                     break;
 
+                case "-nojmx":
+                    noJMX = true;
+
+                    break;
+
                 default:
                     argsList.add(arg);
             }
@@ -152,6 +160,7 @@ public class CommandLineTransformer {
         addArgWithValue(sb, "INTERACTIVE", formatBooleanValue(interactive));
         addArgWithValue(sb, "QUIET", "-DIGNITE_QUIET=" + !verbose);
         addArgWithValue(sb, "NO_PAUSE", formatBooleanValue(noPause));
+        addArgWithValue(sb, "NO_JMX", formatBooleanValue(noJMX));
 
         parseJvmOptionsAndSpringConfig(args);