You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/04/07 21:26:33 UTC

[01/27] incubator-ignite git commit: # ignite-684

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-688 b773603b4 -> e4794d406 (forced update)


# ignite-684


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

Branch: refs/heads/ignite-688
Commit: 360a41f258fa405d33045d3dc90fb78767b75677
Parents: 60aaaaa
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 6 17:05:20 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 6 17:21:28 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       |   3 -
 .../cacheobject/IgniteCacheObjectProcessor.java |   3 +-
 .../IgniteCacheObjectProcessorImpl.java         |  20 +--
 .../org/apache/ignite/lang/IgniteImmutable.java |  49 ------
 .../GridCacheOnCopyFlagAbstractSelfTest.java    |  85 ----------
 .../GridCacheReturnValueTransferSelfTest.java   |   1 -
 .../IgniteCacheStoreValueAbstractTest.java      | 168 ++++++++++++++++++-
 7 files changed, 169 insertions(+), 160 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/360a41f2/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index f7f8e26..c90de92 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -1415,11 +1415,8 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
      * Gets flag indicating whether copy of of the value stored in cache should be created
      * for cache operation implying return value. Also if this flag is set copies are created for values
      * passed to {@link CacheInterceptor} and to {@link CacheEntryProcessor}.
-     * <p>
-     * Copies are not created for immutable types, see {@link IgniteImmutable}.
      *
      * @return Copy on get flag.
-     * @see IgniteImmutable
      */
     public boolean isCopyOnRead() {
         return cpOnRead;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/360a41f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
index fff6dd1..358ef1a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
@@ -160,8 +160,7 @@ public interface IgniteCacheObjectProcessor extends GridProcessor {
 
     /**
      * @param obj Value.
-     * @return {@code True} if object is of known immutable type of it is marked
-     *          with {@link IgniteImmutable} annotation.
+     * @return {@code True} if object is of known immutable type.
      */
     public boolean immutable(Object obj);
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/360a41f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 7b3f270..bd79d0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -45,10 +45,6 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
     /** Immutable classes. */
     private static final Collection<Class<?>> IMMUTABLE_CLS = new HashSet<>();
 
-    /** */
-    private final GridBoundedConcurrentLinkedHashMap<Class<?>, Boolean> reflectionCache =
-            new GridBoundedConcurrentLinkedHashMap<>(1024, 1024);
-
     /**
      *
      */
@@ -216,21 +212,7 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
     @Override public boolean immutable(Object obj) {
         assert obj != null;
 
-        Class<?> cls = obj.getClass();
-
-        if (IMMUTABLE_CLS.contains(cls))
-            return true;
-
-        Boolean immutable = reflectionCache.get(cls);
-
-        if (immutable != null)
-            return immutable;
-
-        immutable = IgniteUtils.hasAnnotation(cls, IgniteImmutable.class);
-
-        reflectionCache.putIfAbsent(cls, immutable);
-
-        return immutable;
+        return IMMUTABLE_CLS.contains(obj.getClass());
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/360a41f2/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java
deleted file mode 100644
index bcecd7d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java
+++ /dev/null
@@ -1,49 +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.lang;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-
-import java.lang.annotation.*;
-
-/**
- * Immutable types should be annotated with this annotation to avoid unnecessary
- * copying (e.g. in case of stateless compute closures or cache values).
- * <p>
- * If cache configuration flag {@link CacheConfiguration#isCopyOnRead()} is set
- * then for each operation implying return value copy of the value stored in cache is created.
- * Also if this flag is set copies are created for values passed to {@link CacheInterceptor} and
- * to {@link CacheEntryProcessor}.
- * <p>
- * Copies are not created for types marked with {@link IgniteImmutable} annotation and for known
- * immutable types:
- * <ul>
- *     <li>Boxed primitives ({@link Integer}, {@link Long}, ...)</li>
- *     <li>{@link String}</li>
- *     <li>{@link java.util.UUID}</li>
- *     <li>{@link java.math.BigDecimal}</li>
- *     <li>{@link org.apache.ignite.lang.IgniteUuid}</li>
- * </ul>
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface IgniteImmutable {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/360a41f2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
index 538567c..c1ad283 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
@@ -355,54 +355,6 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
     /**
      * @throws Exception If failed.
      */
-    public void testPutGetImmutable() throws Exception {
-        noInterceptor = true;
-
-        IgniteCache<TestImmutableKey, TestImmutableValue> cache = grid(0).cache(null);
-
-        Map<TestImmutableKey, TestImmutableValue> map = new HashMap<>();
-
-        for (int i = 0; i < ITER_CNT; i++) {
-            TestImmutableKey key = new TestImmutableKey(i, i);
-            TestImmutableValue val = new TestImmutableValue(i);
-
-            cache.put(key, val);
-
-            map.put(key, val);
-        }
-
-        GridCacheAdapter cache0 = internalCache(cache);
-
-        GridCacheContext cctx = cache0.context();
-
-        for (Map.Entry<TestImmutableKey, TestImmutableValue> e : map.entrySet()) {
-            GridCacheEntryEx entry = cache0.peekEx(e.getKey());
-
-            assertNotNull("No entry for key: " + e.getKey(), entry);
-
-            TestKey key0 = entry.key().value(cctx.cacheObjectContext(), false);
-
-            assertSame(key0, e.getKey());
-
-            TestKey key1 = entry.key().value(cctx.cacheObjectContext(), true);
-
-            assertSame(key0, key1);
-
-            TestImmutableValue val0 = entry.rawGet().value(cctx.cacheObjectContext(), false);
-
-            assertNotSame(val0, e.getValue());
-
-            TestImmutableValue val1 = entry.rawGet().value(cctx.cacheObjectContext(), true);
-
-            assertNotSame(val0, val1);
-
-            assertNotSame(e.getValue(), cache.get(e.getKey()));
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testPutGetKnownImmutable() throws Exception {
         noInterceptor = true;
 
@@ -648,41 +600,4 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
             this.delegate = delegate;
         }
     }
-
-    /**
-     *
-     */
-    @IgniteImmutable
-    public static class TestImmutableKey extends TestKey {
-        /**
-         *
-         */
-        public TestImmutableKey() {
-            // No-op.
-        }
-
-        /**
-         * @param key Key.
-         * @param field Field.
-         */
-        public TestImmutableKey(int key, int field) {
-            super(key, field);
-        }
-    }
-
-    /**
-     *
-     */
-    @IgniteImmutable
-    public static class TestImmutableValue {
-        /** */
-        public int val;
-
-        /**
-         * @param val Value.
-         */
-        public TestImmutableValue(int val) {
-            this.val = val;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/360a41f2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
index 0dd23a7..9446486 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
@@ -155,7 +155,6 @@ public class GridCacheReturnValueTransferSelfTest extends GridCommonAbstractTest
     /**
      *
      */
-    @IgniteImmutable
     private static class TestObject implements Externalizable {
         /**
          *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/360a41f2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
index 9552258..3835c8e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
@@ -40,6 +40,9 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
  *
  */
 public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstractTest {
+    /** */
+    private boolean cpyOnRead;
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -58,6 +61,8 @@ public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstr
 
         assertTrue(ccfg.isCopyOnRead());
 
+        ccfg.setCopyOnRead(cpyOnRead);
+
         assertEquals(FULL_SYNC, ccfg.getWriteSynchronizationMode());
 
         ccfg.setCacheStoreFactory(singletonFactory(new CacheStoreAdapter() {
@@ -93,10 +98,26 @@ public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstr
         return 2 * 60_000;
     }
 
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
     /**
      * @throws Exception If failed.
      */
     public void testValueNotStored() throws Exception {
+        cpyOnRead = true;
+
+        startGrids();
+
         IgniteCache<TestKey, TestValue> cache = grid(0).cache(null);
 
         Affinity<Object> aff = grid(0).affinity(null);
@@ -221,10 +242,18 @@ public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstr
                 e = ((GridNearCacheAdapter)cache0).dht().peekEx(key);
 
             if (e != null) {
+                KeyCacheObject keyObj = e.key();
+
+                assertNotNull(keyObj);
+
+                assertEquals(KeyCacheObjectImpl.class, keyObj.getClass());
+
+                assertNotNull("Unexpected value, node: " + g,
+                    GridTestUtils.getFieldValue(keyObj, CacheObjectAdapter.class, "val"));
+
                 CacheObject obj = e.rawGet();
 
                 if (obj != null) {
-                    assertNotNull(obj);
                     assertEquals(CacheObjectImpl.class, obj.getClass());
 
                     assertNull("Unexpected value, node: " + g,
@@ -249,6 +278,143 @@ public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstr
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testValueStored() throws Exception {
+        cpyOnRead = false;
+
+        startGrids();
+
+        IgniteCache<TestKey, TestValue> cache = grid(0).cache(null);
+
+        Affinity<Object> aff = grid(0).affinity(null);
+
+        for (int i = 0; i < 100; i++) {
+            TestKey key = new TestKey(i);
+            TestValue val = new TestValue(i);
+
+            cache.put(key, val);
+
+            checkHasValue(aff, key);
+
+            for (int g = 0; g < gridCount(); g++)
+                assertNotNull(grid(g).cache(null).get(key));
+
+            checkHasValue(aff, key);
+
+            cache.invoke(key, new CacheEntryProcessor<TestKey, TestValue, Object>() {
+                @Override public Object process(MutableEntry<TestKey, TestValue> entry, Object... args) {
+                    assertNotNull(entry.getValue());
+
+                    entry.setValue(new TestValue(10_000));
+
+                    return new TestValue(20_000);
+                }
+            });
+
+            checkHasValue(aff, key);
+
+            for (int g = 0; g < gridCount(); g++)
+                assertNotNull(grid(g).cache(null).get(key));
+
+            checkHasValue(aff, key);
+
+            cache.remove(key);
+
+            for (int g = 0; g < gridCount(); g++)
+                assertNull(grid(g).cache(null).get(key));
+
+            try (IgniteDataStreamer<TestKey, TestValue> streamer  = grid(0).dataStreamer(null)) {
+                streamer.addData(key, val);
+            }
+
+            checkHasValue(aff, key);
+
+            cache.remove(key);
+
+            atomicClockModeDelay(cache);
+
+            try (IgniteDataStreamer<TestKey, TestValue> streamer  = grid(0).dataStreamer(null)) {
+                streamer.allowOverwrite(true);
+
+                streamer.addData(key, val);
+            }
+
+            checkHasValue(aff, key);
+
+            if (aff.isPrimaryOrBackup(grid(0).localNode(), key)) {
+                cache.localEvict(Collections.singleton(key));
+
+                assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+
+                cache.localPromote(Collections.singleton(key));
+
+                assertNotNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+
+                checkHasValue(aff, key);
+            }
+        }
+    }
+
+    /**
+     * @param aff Affinity.
+     * @param key Key.
+     */
+    private void checkHasValue(Affinity<Object> aff, Object key) {
+        for (int g = 0; g < gridCount(); g++) {
+            GridCacheAdapter cache0 = internalCache(grid(g), null);
+
+            GridCacheEntryEx e = cache0.peekEx(key);
+
+            if (e == null && cache0.isNear())
+                e = ((GridNearCacheAdapter)cache0).dht().peekEx(key);
+
+            if (e != null) {
+                KeyCacheObject keyObj = e.key();
+
+                assertNotNull(keyObj);
+
+                assertEquals(KeyCacheObjectImpl.class, keyObj.getClass());
+
+                assertNotNull("Unexpected value, node: " + g,
+                    GridTestUtils.getFieldValue(keyObj, CacheObjectAdapter.class, "val"));
+
+                CacheObject obj = e.rawGet();
+
+                if (obj != null) {
+                    assertEquals(CacheObjectImpl.class, obj.getClass());
+
+                    assertNotNull("Unexpected value, node: " + g,
+                        GridTestUtils.getFieldValue(obj, CacheObjectAdapter.class, "val"));
+
+                    Object val0 = obj.value(cache0.context().cacheObjectContext(), true);
+
+                    assertNotNull("Unexpected value after value() requested1: " + g,
+                        GridTestUtils.getFieldValue(obj, CacheObjectAdapter.class, "val"));
+
+                    Object val1 = obj.value(cache0.context().cacheObjectContext(), true);
+
+                    assertNotNull("Unexpected value after value() requested2: " + g,
+                        GridTestUtils.getFieldValue(obj, CacheObjectAdapter.class, "val"));
+
+                    assertSame(val0, val1);
+
+                    Object val2 = obj.value(cache0.context().cacheObjectContext(), false);
+
+                    assertNotNull("Unexpected value after value() requested3: " + g,
+                        GridTestUtils.getFieldValue(obj, CacheObjectAdapter.class, "val"));
+
+                    assertSame(val1, val2);
+                }
+                else
+                    assertFalse(aff.isPrimaryOrBackup(grid(g).localNode(), key));
+            }
+            else
+                assertFalse("Entry not found, node: " + g, aff.isPrimaryOrBackup(grid(g).localNode(), key));
+        }
+    }
+
+    /**
      *
      */
     static class TestKey implements Serializable {


[08/27] incubator-ignite git commit: # ignite-sprint-3 Fixed exception handling in Visor tasks.

Posted by sb...@apache.org.
# ignite-sprint-3 Fixed exception handling in Visor tasks.


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

Branch: refs/heads/ignite-688
Commit: 404da5f2368f48f9c99c467c98a2af53481962bd
Parents: 238cbb1
Author: Andrey Novikov <an...@gridgain.com>
Authored: Tue Apr 7 17:08:19 2015 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Tue Apr 7 17:08:19 2015 +0700

----------------------------------------------------------------------
 .../apache/ignite/internal/visor/log/VisorLogSearchTask.java    | 3 +--
 .../ignite/internal/visor/query/VisorQueryNextPageTask.java     | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/404da5f2/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
index 470a739..476d58c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.visor.log;
 
 import org.apache.ignite.*;
 import org.apache.ignite.compute.*;
-import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.task.*;
 import org.apache.ignite.internal.util.io.*;
 import org.apache.ignite.internal.util.lang.*;
@@ -213,7 +212,7 @@ public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchTask.Vi
             URL url = U.resolveIgniteUrl(arg.folder);
 
             if (url == null)
-                throw U.convertException(new GridInternalException(new FileNotFoundException("Log folder not found: " + arg.folder)));
+                throw new IgniteException(new FileNotFoundException("Log folder not found: " + arg.folder));
 
             UUID uuid = ignite.localNode().id();
             String nid = uuid.toString().toLowerCase();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/404da5f2/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryNextPageTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryNextPageTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryNextPageTask.java
index d922ad1..3f13d5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryNextPageTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryNextPageTask.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.visor.query;
 
 import org.apache.ignite.*;
-import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.task.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.internal.visor.*;
@@ -77,7 +76,7 @@ public class VisorQueryNextPageTask extends VisorOneNodeTask<IgniteBiTuple<Strin
             VisorQueryTask.VisorFutureResultSetHolder<List<?>> t = storage.get(arg.get1());
 
             if (t == null)
-                throw new GridInternalException("SQL query results are expired.");
+                throw new IgniteException("SQL query results are expired.");
 
             IgniteBiTuple<List<Object[]>, List<?>> nextRows = VisorQueryUtils.fetchSqlQueryRows(t.future(), t.next(), arg.get2());
 
@@ -101,7 +100,7 @@ public class VisorQueryNextPageTask extends VisorOneNodeTask<IgniteBiTuple<Strin
             VisorQueryTask.VisorFutureResultSetHolder<Map.Entry<Object, Object>> t = storage.get(arg.get1());
 
             if (t == null)
-                throw new GridInternalException("Scan query results are expired.");
+                throw new IgniteException("Scan query results are expired.");
 
             IgniteBiTuple<List<Object[]>, Map.Entry<Object, Object>> rows =
                 VisorQueryUtils.fetchScanQueryRows(t.future(), t.next(), arg.get2());


[27/27] incubator-ignite git commit: ignite-688 Age related cluster group doesn't refresh dynamically

Posted by sb...@apache.org.
ignite-688 Age related cluster group doesn't refresh dynamically


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

Branch: refs/heads/ignite-688
Commit: e4794d40683f925b84b3a4d74cac30cd7931e698
Parents: 97ad565
Author: Andrey Gura <ag...@gridgain.com>
Authored: Tue Apr 7 22:01:34 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Tue Apr 7 22:01:34 2015 +0300

----------------------------------------------------------------------
 .../internal/cluster/ClusterGroupAdapter.java   | 73 ++++++++++++++++++--
 1 file changed, 67 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e4794d40/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index b93a920..f431e76 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -120,9 +120,9 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
      * @param ids Node IDs.
      */
     private ClusterGroupAdapter(@Nullable GridKernalContext ctx,
-                                @Nullable UUID subjId,
-                                @Nullable IgnitePredicate<ClusterNode> p,
-                                Set<UUID> ids)
+        @Nullable UUID subjId,
+        @Nullable IgnitePredicate<ClusterNode> p,
+        Set<UUID> ids)
     {
         if (ctx != null)
             setKernalContext(ctx);
@@ -320,7 +320,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
     }
 
     /** {@inheritDoc} */
-    @Override public final IgnitePredicate<ClusterNode> predicate() {
+    @Override public IgnitePredicate<ClusterNode> predicate() {
         return p != null ? p : F.<ClusterNode>alwaysTrue();
     }
 
@@ -809,9 +809,25 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
          * @param isOldest Oldest flag.
          */
         private AgeClusterGroup(ClusterGroupAdapter parent, boolean isOldest) {
-            super(parent.ctx, parent.subjId, parent.p, parent.ids);
+            this(parent.ctx, parent.subjId, parent.p, parent.ids, isOldest);
+        }
 
-            this.parentP = parent.p;
+        /**
+         * @param ctx Context.
+         * @param subjId Subj ID.
+         * @param p Parent predicate.
+         * @param ids Ids.
+         * @param isOldest Is oldest.
+         */
+        private AgeClusterGroup(GridKernalContext ctx,
+            UUID subjId,
+            IgnitePredicate<ClusterNode> p,
+            Set<UUID> ids,
+            boolean isOldest)
+        {
+            super(ctx, subjId, p, ids);
+
+            this.parentP = p;
             this.isOldest = isOldest;
 
             reset();
@@ -856,6 +872,14 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
         }
 
         /** {@inheritDoc} */
+        @Override public IgnitePredicate<ClusterNode> predicate() {
+            if (ctx.discovery().topologyVersion() != lastTopVer)
+                reset();
+
+            return super.predicate();
+        }
+
+        /** {@inheritDoc} */
         @Override public ClusterGroup forPredicate(IgnitePredicate<ClusterNode> p) {
             A.notNull(p, "p");
 
@@ -874,6 +898,34 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
                 unguard();
             }
         }
+
+        /** {@inheritDoc} */
+        @Override public void writeExternal(ObjectOutput out) throws IOException {
+            super.writeExternal(out);
+
+            out.writeBoolean(isOldest);
+            out.writeObject(parentP);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+            super.readExternal(in);
+
+            isOldest = in.readBoolean();
+            parentP = (IgnitePredicate<ClusterNode>)in.readObject();
+        }
+
+        /**
+         * Reconstructs object on unmarshalling.
+         *
+         * @return Reconstructed object.
+         * @throws ObjectStreamException Thrown in case of unmarshalling error.
+         */
+        protected Object readResolve() throws ObjectStreamException {
+            ClusterGroupAdapter parent = (ClusterGroupAdapter)super.readResolve();
+
+            return new AgeClusterGroup(parent.ctx, parent.subjId, parentP, parent.ids, isOldest);
+        }
     }
 
     /**
@@ -900,7 +952,16 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
 
         /** {@inheritDoc} */
         @Override public boolean apply(ClusterNode node) {
+            A.notNull(node, "node is null");
+
             return grp.predicate().apply(node) && p.apply(node);
         }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return getClass().getName() +
+                " [grp='" + grp.getClass().getName() +
+                "', p='" + p.getClass().getName() + "']";
+        }
     }
 }


[20/27] incubator-ignite git commit: minor

Posted by sb...@apache.org.
minor


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

Branch: refs/heads/ignite-688
Commit: 2444811f465e12aaa6639d661a954d00622bbe44
Parents: 6553549
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Apr 7 16:21:40 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Apr 7 16:21:40 2015 +0300

----------------------------------------------------------------------
 .../eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java     | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2444811f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
index c30e3a5..f907c36 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
@@ -381,5 +381,4 @@ public class GridCacheFifoBatchEvictionPolicySelfTest extends
         for (int i = 0; i < gridCnt; i++)
             assert policy(i).queue().size() <= plcMax + policy(i).getBatchSize();
     }
-
 }


[03/27] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-684

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-684


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

Branch: refs/heads/ignite-688
Commit: 72c6dd1933985a443ca6f5781871f05182c9072a
Parents: ed0b864 d20d29b
Author: sboikov <sb...@gridgain.com>
Authored: Tue Apr 7 12:05:49 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Apr 7 12:05:49 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |    2 +-
 examples/README.txt                             |   11 +-
 examples/config/example-ignite.xml              |    2 +-
 .../streaming/StreamTransformerExample.java     |  101 +
 .../streaming/StreamVisitorExample.java         |  171 +
 .../streaming/marketdata/CacheConfig.java       |   44 -
 .../streaming/marketdata/Instrument.java        |  106 -
 .../marketdata/QueryTopInstruments.java         |   73 -
 .../streaming/marketdata/StreamMarketData.java  |  103 -
 .../examples/streaming/numbers/CacheConfig.java |   46 -
 .../streaming/numbers/QueryPopularNumbers.java  |   74 -
 .../streaming/numbers/StreamRandomNumbers.java  |   78 -
 .../streaming/wordcount/CacheConfig.java        |   48 +
 .../streaming/wordcount/QueryWords.java         |   77 +
 .../streaming/wordcount/StreamWords.java        |   68 +
 .../streaming/wordcount/alice-in-wonderland.txt | 3735 ++++++++++++++++++
 .../streaming/wordcount/package-info.java       |   22 +
 .../streaming/StreamTransformerExample.java     |   97 +
 .../java8/streaming/StreamVisitorExample.java   |  168 +
 .../java8/streaming/marketdata/CacheConfig.java |   44 -
 .../java8/streaming/marketdata/Instrument.java  |  106 -
 .../marketdata/QueryTopInstruments.java         |   73 -
 .../streaming/marketdata/StreamMarketData.java  |  101 -
 .../java8/streaming/numbers/CacheConfig.java    |   46 -
 .../streaming/numbers/QueryPopularNumbers.java  |   74 -
 .../streaming/numbers/StreamRandomNumbers.java  |   74 -
 .../ignite/cache/affinity/AffinityUuid.java     |   50 +
 .../cache/eviction/fifo/FifoEvictionPolicy.java |   58 +-
 .../eviction/fifo/FifoEvictionPolicyMBean.java  |   16 +
 .../store/jdbc/CacheAbstractJdbcStore.java      |  104 +-
 .../processors/query/GridQueryProcessor.java    |    8 +-
 .../ignite/internal/util/IgniteUtils.java       |   46 +-
 .../ignite/internal/visor/cache/VisorCache.java |   19 +-
 .../VisorCacheConfigurationCollectorJob.java    |   76 +
 .../VisorCacheConfigurationCollectorTask.java   |   39 +
 .../VisorIgfsProfilerUniformityCounters.java    |    6 +-
 .../visor/node/VisorGridConfiguration.java      |   38 -
 .../visor/node/VisorIgfsConfiguration.java      |    2 +-
 .../visor/node/VisorRestConfiguration.java      |    1 +
 .../internal/visor/util/VisorTaskUtils.java     |    3 +-
 .../org/apache/ignite/stream/StreamVisitor.java |    2 +-
 .../eviction/GridCacheEvictionAbstractTest.java |    5 +-
 ...ridCacheFifoBatchEvictionPolicySelfTest.java |  385 ++
 .../query/h2/sql/GridSqlQuerySplitter.java      |   22 +-
 .../h2/twostep/GridReduceQueryExecutor.java     |    2 +-
 .../query/h2/sql/GridQueryParsingTest.java      |    1 +
 .../query/h2/sql/IgniteVsH2QueryTest.java       |    7 +
 modules/schedule/pom.xml                        |   20 +
 .../commands/cache/VisorCacheCommand.scala      |   26 +-
 .../config/VisorConfigurationCommand.scala      |   15 +-
 .../visor/commands/gc/VisorGcCommand.scala      |   15 +-
 .../scala/org/apache/ignite/visor/visor.scala   |   34 +-
 .../yardstick/config/benchmark-store.properties |    5 +-
 parent/pom.xml                                  |    1 +
 pom.xml                                         |   63 +-
 55 files changed, 5429 insertions(+), 1184 deletions(-)
----------------------------------------------------------------------



[21/27] incubator-ignite git commit: ignite-621 fix

Posted by sb...@apache.org.
ignite-621 fix


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

Branch: refs/heads/ignite-688
Commit: 65f347299c8699ec8b43dad8ec63a40758677dd2
Parents: 2444811
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Apr 7 17:42:04 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Apr 7 17:42:04 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/spi/IgniteSpiAdapter.java | 24 +++++-
 .../communication/tcp/TcpCommunicationSpi.java  | 14 ++--
 .../discovery/tcp/TcpClientDiscoverySpi.java    | 47 ++++++------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 78 ++++++++++----------
 .../discovery/tcp/TcpDiscoverySpiAdapter.java   |  8 +-
 .../spi/swapspace/file/FileSwapSpaceSpi.java    |  4 +-
 .../GridAbstractCommunicationSelfTest.java      |  3 +-
 ...mmunicationSpiConcurrentConnectSelfTest.java |  3 +-
 ...cpCommunicationSpiMultithreadedSelfTest.java |  3 +-
 ...dTcpCommunicationSpiRecoveryAckSelfTest.java |  3 +-
 ...GridTcpCommunicationSpiRecoverySelfTest.java |  2 +-
 11 files changed, 104 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
index 65303db..f198210 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
@@ -54,10 +54,15 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
     @LoggerResource
     private IgniteLogger log;
 
-    /** Ignite instance */
-    @IgniteInstanceResource
+    /** Ignite instance. */
     protected Ignite ignite;
 
+    /** Local node id. */
+    protected UUID nodeId;
+
+    /** Grid instance name. */
+    protected String gridName;
+
     /** SPI name. */
     private String name;
 
@@ -105,7 +110,7 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
 
     /** {@inheritDoc} */
     @Override public UUID getLocalNodeId() {
-        return ignite.configuration().getNodeId();
+        return nodeId;
     }
 
     /** {@inheritDoc} */
@@ -189,6 +194,19 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
     }
 
     /**
+     * Inject ignite instance.
+     */
+    @IgniteInstanceResource
+    protected void injectResources(Ignite ignite){
+        this.ignite = ignite;
+
+        if (ignite != null) {
+            nodeId = ignite.configuration().getNodeId();
+            gridName = ignite.name();
+        }
+    }
+
+    /**
      * Method to be called in the beginning of onContextDestroyed() method.
      */
     protected void onContextDestroyed0() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 613ff64..6cd439b 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -591,9 +591,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
     /** Local port range. */
     private int locPortRange = DFLT_PORT_RANGE;
 
-    /** Grid name. */
-    private String gridName;
-
     /** Allocate direct buffer or heap buffer. */
     private boolean directBuf = true;
 
@@ -742,10 +739,11 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
      */
     @IgniteInstanceResource
     protected void injectResources(Ignite ignite) {
+        super.injectResources(ignite);
+
         if (ignite != null) {
             setAddressResolver(ignite.configuration().getAddressResolver());
             setLocalAddress(ignite.configuration().getLocalHost());
-            gridName = ignite.name();
         }
     }
 
@@ -1189,7 +1187,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
 
     /** {@inheritDoc} */
     @Override public Map<String, Object> getNodeAttributes() throws IgniteSpiException {
-        nodeIdMsg = new NodeIdMessage(ignite.configuration().getNodeId());
+        nodeIdMsg = new NodeIdMessage(getLocalNodeId());
 
         assertParameter(locPort > 1023, "locPort > 1023");
         assertParameter(locPort <= 0xffff, "locPort < 0xffff");
@@ -1557,7 +1555,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
         if (log.isTraceEnabled())
             log.trace("Sending message to node [node=" + node + ", msg=" + msg + ']');
 
-        UUID locNodeId = ignite.configuration().getNodeId();
+        UUID locNodeId = getLocalNodeId();
 
         if (node.id().equals(locNodeId))
             notifyListener(locNodeId, msg, NOOP);
@@ -1957,7 +1955,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                     ch.write(ByteBuffer.wrap(U.IGNITE_HEADER));
 
                     if (recovery != null) {
-                        HandshakeMessage msg = new HandshakeMessage(ignite.configuration().getNodeId(),
+                        HandshakeMessage msg = new HandshakeMessage(getLocalNodeId(),
                             recovery.incrementConnectCount(),
                             recovery.receivedCount());
 
@@ -2630,7 +2628,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                 out.flush();
 
                 if (log.isDebugEnabled())
-                    log.debug("Sent local node ID [locNodeId=" + ignite.configuration().getNodeId() + ", rmtNodeId="
+                    log.debug("Sent local node ID [locNodeId=" + getLocalNodeId() + ", rmtNodeId="
                         + rmtNodeId + ']');
             }
             catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
index 48125bf..bf69efb 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
@@ -255,7 +255,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
         }
 
         locNode = new TcpDiscoveryNode(
-            ignite.configuration().getNodeId(),
+            getLocalNodeId(),
             addrs.get1(),
             addrs.get2(),
             0,
@@ -295,7 +295,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
             leaveLatch = new CountDownLatch(1);
 
             try {
-                TcpDiscoveryNodeLeftMessage msg = new TcpDiscoveryNodeLeftMessage(ignite.configuration().getNodeId());
+                TcpDiscoveryNodeLeftMessage msg = new TcpDiscoveryNodeLeftMessage(getLocalNodeId());
 
                 msg.client(true);
 
@@ -344,7 +344,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
 
     /** {@inheritDoc} */
     @Nullable @Override public ClusterNode getNode(UUID nodeId) {
-        if (ignite.configuration().getNodeId().equals(nodeId))
+        if (getLocalNodeId().equals(nodeId))
             return locNode;
 
         TcpDiscoveryNode node = rmtNodes.get(nodeId);
@@ -356,7 +356,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
     @Override public boolean pingNode(UUID nodeId) {
         assert nodeId != null;
 
-        if (nodeId.equals(ignite.configuration().getNodeId()))
+        if (nodeId.equals(getLocalNodeId()))
             return true;
 
         TcpDiscoveryNode node = rmtNodes.get(nodeId);
@@ -427,7 +427,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
                         locNode.clientRouterNodeId(rmtNodeId);
 
                         TcpDiscoveryAbstractMessage msg = recon ?
-                            new TcpDiscoveryClientReconnectMessage(ignite.configuration().getNodeId(), rmtNodeId,
+                            new TcpDiscoveryClientReconnectMessage(getLocalNodeId(), rmtNodeId,
                                 lastMsgId) :
                             new TcpDiscoveryJoinRequestMessage(locNode, null);
 
@@ -547,7 +547,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
 
         Socket sock = openSocket(addr);
 
-        TcpDiscoveryHandshakeRequest req = new TcpDiscoveryHandshakeRequest(ignite.configuration().getNodeId());
+        TcpDiscoveryHandshakeRequest req = new TcpDiscoveryHandshakeRequest(getLocalNodeId());
 
         req.client(true);
 
@@ -558,7 +558,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
         UUID nodeId = res.creatorNodeId();
 
         assert nodeId != null;
-        assert !ignite.configuration().getNodeId().equals(nodeId);
+        assert !getLocalNodeId().equals(nodeId);
 
         return F.t(sock, nodeId);
     }
@@ -567,7 +567,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
      * FOR TEST PURPOSE ONLY!
      */
     void simulateNodeFailure() {
-        U.warn(log, "Simulating client node failure: " + ignite.configuration().getNodeId());
+        U.warn(log, "Simulating client node failure: " + getLocalNodeId());
 
         U.closeQuiet(sock);
 
@@ -591,7 +591,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
         /**
          */
         protected DisconnectHandler() {
-            super(ignite.name(), "tcp-client-disco-disconnect-hnd", log);
+            super(gridName, "tcp-client-disco-disconnect-hnd", log);
         }
 
         /** {@inheritDoc} */
@@ -644,7 +644,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
         /**
          */
         protected HeartbeatSender() {
-            super(ignite.name(), "tcp-client-disco-heartbeat-sender", log);
+            super(gridName, "tcp-client-disco-heartbeat-sender", log);
         }
 
         /** {@inheritDoc} */
@@ -662,8 +662,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
                 while (!isInterrupted()) {
                     U.sleep(hbFreq);
 
-                    TcpDiscoveryHeartbeatMessage msg =
-                        new TcpDiscoveryHeartbeatMessage(ignite.configuration().getNodeId());
+                    TcpDiscoveryHeartbeatMessage msg = new TcpDiscoveryHeartbeatMessage(getLocalNodeId());
 
                     msg.client(true);
 
@@ -692,7 +691,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
          * @param msgWrk Message worker.
          */
         protected SocketReader(UUID nodeId, MessageWorker msgWrk) {
-            super(ignite.name(), "tcp-client-disco-sock-reader", log);
+            super(gridName, "tcp-client-disco-sock-reader", log);
 
             assert nodeId != null;
             assert msgWrk != null;
@@ -760,7 +759,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
                     catch (IgniteCheckedException e) {
                         if (log.isDebugEnabled())
                             U.error(log, "Failed to read message [sock=" + sock0 + ", " +
-                                "locNodeId=" + ignite.configuration().getNodeId() + ", rmtNodeId=" + nodeId + ']', e);
+                                "locNodeId=" + getLocalNodeId() + ", rmtNodeId=" + nodeId + ']', e);
 
                         IOException ioEx = X.cause(e, IOException.class);
 
@@ -775,14 +774,14 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
                                 "[rmtNodeId=" + nodeId + ", err=" + clsNotFoundEx.getMessage() + ']');
                         else
                             LT.error(log, e, "Failed to read message [sock=" + sock0 + ", locNodeId=" +
-                                ignite.configuration().getNodeId() + ", rmtNodeId=" + nodeId + ']');
+                                getLocalNodeId() + ", rmtNodeId=" + nodeId + ']');
                     }
                 }
             }
             catch (IOException e) {
                 if (log.isDebugEnabled())
                     U.error(log, "Connection failed [sock=" + sock0 + ", locNodeId=" +
-                        ignite.configuration().getNodeId() + ", rmtNodeId=" + nodeId + ']', e);
+                        getLocalNodeId() + ", rmtNodeId=" + nodeId + ']', e);
             }
             finally {
                 U.closeQuiet(sock0);
@@ -877,7 +876,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
 
             UUID newNodeId = node.id();
 
-            if (ignite.configuration().getNodeId().equals(newNodeId)) {
+            if (getLocalNodeId().equals(newNodeId)) {
                 if (joinLatch.getCount() > 0) {
                     Collection<TcpDiscoveryNode> top = msg.topology();
 
@@ -933,7 +932,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
             if (leaveLatch != null)
                 return;
 
-            if (ignite.configuration().getNodeId().equals(msg.nodeId())) {
+            if (getLocalNodeId().equals(msg.nodeId())) {
                 if (joinLatch.getCount() > 0) {
                     long topVer = msg.topologyVersion();
 
@@ -986,7 +985,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
          * @param msg Message.
          */
         private void processNodeLeftMessage(TcpDiscoveryNodeLeftMessage msg) {
-            if (ignite.configuration().getNodeId().equals(msg.creatorNodeId())) {
+            if (getLocalNodeId().equals(msg.creatorNodeId())) {
                 if (log.isDebugEnabled())
                     log.debug("Received node left message for local node: " + msg);
 
@@ -1031,7 +1030,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
             if (leaveLatch != null)
                 return;
 
-            if (!ignite.configuration().getNodeId().equals(msg.creatorNodeId())) {
+            if (!getLocalNodeId().equals(msg.creatorNodeId())) {
                 TcpDiscoveryNode node = rmtNodes.remove(msg.failedNodeId());
 
                 if (node == null) {
@@ -1063,12 +1062,12 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
             if (leaveLatch != null)
                 return;
 
-            if (ignite.configuration().getNodeId().equals(msg.creatorNodeId())) {
+            if (getLocalNodeId().equals(msg.creatorNodeId())) {
                 if (msg.senderNodeId() == null) {
                     Socket sock0 = sock;
 
                     if (sock0 != null) {
-                        msg.setMetrics(ignite.configuration().getNodeId(), metricsProvider.metrics());
+                        msg.setMetrics(getLocalNodeId(), metricsProvider.metrics());
 
                         try {
                             writeToSocket(sock0, msg);
@@ -1117,7 +1116,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
             if (leaveLatch != null)
                 return;
 
-            if (ignite.configuration().getNodeId().equals(msg.creatorNodeId())) {
+            if (getLocalNodeId().equals(msg.creatorNodeId())) {
                 if (msg.success()) {
                     pending = true;
 
@@ -1158,7 +1157,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements Tcp
             assert nodeId != null;
             assert metrics != null;
 
-            TcpDiscoveryNode node = nodeId.equals(ignite.configuration().getNodeId()) ? locNode : rmtNodes.get(nodeId);
+            TcpDiscoveryNode node = nodeId.equals(getLocalNodeId()) ? locNode : rmtNodes.get(nodeId);
 
             if (node != null && node.visible()) {
                 node.setMetrics(metrics);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 1cee279..bad8837 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -626,7 +626,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
     @Nullable @Override public ClusterNode getNode(UUID nodeId) {
         assert nodeId != null;
 
-        UUID locNodeId0 = ignite.configuration().getNodeId();
+        UUID locNodeId0 = getLocalNodeId();
 
         if (locNodeId0 != null && locNodeId0.equals(nodeId))
             // Return local node directly.
@@ -703,7 +703,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         }
 
         locNode = new TcpDiscoveryNode(
-            ignite.configuration().getNodeId(),
+            getLocalNodeId(),
             addrs.get1(),
             addrs.get2(),
             tcpSrvr.port,
@@ -856,7 +856,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         if (hbFreq < 2000)
             U.warn(log, "Heartbeat frequency is too high (at least 2000 ms recommended): " + hbFreq);
 
-        registerMBean(ignite.name(), this, TcpDiscoverySpiMBean.class);
+        registerMBean(gridName, this, TcpDiscoverySpiMBean.class);
 
         if (ipFinder instanceof TcpDiscoveryMulticastIpFinder) {
             TcpDiscoveryMulticastIpFinder mcastIpFinder = ((TcpDiscoveryMulticastIpFinder)ipFinder);
@@ -926,7 +926,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
         if (msgWorker != null && msgWorker.isAlive() && !disconnect) {
             // Send node left message only if it is final stop.
-            msgWorker.addMessage(new TcpDiscoveryNodeLeftMessage(ignite.configuration().getNodeId()));
+            msgWorker.addMessage(new TcpDiscoveryNodeLeftMessage(getLocalNodeId()));
 
             synchronized (mux) {
                 long threshold = U.currentTimeMillis() + netTimeout;
@@ -1088,7 +1088,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
     @Override public boolean pingNode(UUID nodeId) {
         assert nodeId != null;
 
-        if (nodeId == ignite.configuration().getNodeId())
+        if (nodeId == getLocalNodeId())
             return true;
 
         TcpDiscoveryNode node = ring.node(nodeId);
@@ -1116,7 +1116,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
     private boolean pingNode(TcpDiscoveryNode node) {
         assert node != null;
 
-        if (node.id().equals(ignite.configuration().getNodeId()))
+        if (node.id().equals(getLocalNodeId()))
             return true;
 
         UUID clientNodeId = null;
@@ -1160,10 +1160,10 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         throws IgniteCheckedException {
         assert addr != null;
 
-        UUID locNodeId = ignite.configuration().getNodeId();
+        UUID locNodeId = getLocalNodeId();
 
         if (F.contains(locNodeAddrs, addr))
-            return F.t(ignite.configuration().getNodeId(), false);
+            return F.t(getLocalNodeId(), false);
 
         GridFutureAdapter<IgniteBiTuple<UUID, Boolean>> fut = new GridFutureAdapter<>();
 
@@ -1388,7 +1388,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
     @SuppressWarnings({"BusyWait"})
     private boolean sendJoinRequestMessage() throws IgniteSpiException {
         TcpDiscoveryAbstractMessage joinReq = new TcpDiscoveryJoinRequestMessage(locNode,
-            exchange.collect(ignite.configuration().getNodeId()));
+            exchange.collect(getLocalNodeId()));
 
         // Time when it has been detected, that addresses from IP finder do not respond.
         long noResStart = 0;
@@ -1550,7 +1550,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
         boolean joinReqSent = false;
 
-        UUID locNodeId = ignite.configuration().getNodeId();
+        UUID locNodeId = getLocalNodeId();
 
         for (int i = 0; i < reconCnt; i++) {
             // Need to set to false on each new iteration,
@@ -1985,7 +1985,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
      * This method is intended for test purposes only.
      */
     void simulateNodeFailure() {
-        U.warn(log, "Simulating node failure: " + ignite.configuration().getNodeId());
+        U.warn(log, "Simulating node failure: " + getLocalNodeId());
 
         U.interrupt(tcpSrvr);
         U.join(tcpSrvr, log);
@@ -2034,7 +2034,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         }
 
         if (next != null)
-            msgWorker.addMessage(new TcpDiscoveryNodeFailedMessage(ignite.configuration().getNodeId(), next.id(),
+            msgWorker.addMessage(new TcpDiscoveryNodeFailedMessage(getLocalNodeId(), next.id(),
                 next.internalOrder()));
     }
 
@@ -2085,7 +2085,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
             b.append(">>>").append("Dumping discovery SPI debug info.").append(U.nl());
             b.append(">>>").append(U.nl());
 
-            b.append("Local node ID: ").append(ignite.configuration().getNodeId()).append(U.nl()).append(U.nl());
+            b.append("Local node ID: ").append(getLocalNodeId()).append(U.nl()).append(U.nl());
             b.append("Local node: ").append(locNode).append(U.nl()).append(U.nl());
             b.append("SPI state: ").append(spiState).append(U.nl()).append(U.nl());
 
@@ -2141,7 +2141,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         assert debugMode;
 
         String msg0 = new SimpleDateFormat("[HH:mm:ss,SSS]").format(new Date(System.currentTimeMillis())) +
-            '[' + Thread.currentThread().getName() + "][" + ignite.configuration().getNodeId() +
+            '[' + Thread.currentThread().getName() + "][" + getLocalNodeId() +
             "-" + locNode.internalOrder() + "] " +
             msg;
 
@@ -2205,7 +2205,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
          * Constructor.
          */
         private HeartbeatsSender() {
-            super(ignite.name(), "tcp-disco-hb-sender", log);
+            super(gridName, "tcp-disco-hb-sender", log);
 
             setPriority(threadPri);
         }
@@ -2227,9 +2227,9 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
                     return;
                 }
 
-                TcpDiscoveryHeartbeatMessage msg = new TcpDiscoveryHeartbeatMessage(ignite.configuration().getNodeId());
+                TcpDiscoveryHeartbeatMessage msg = new TcpDiscoveryHeartbeatMessage(getLocalNodeId());
 
-                msg.verify(ignite.configuration().getNodeId());
+                msg.verify(getLocalNodeId());
 
                 msgWorker.addMessage(msg);
 
@@ -2249,7 +2249,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
          * Constructor.
          */
         private CheckStatusSender() {
-            super(ignite.name(), "tcp-disco-status-check-sender", log);
+            super(gridName, "tcp-disco-status-check-sender", log);
 
             setPriority(threadPri);
         }
@@ -2313,7 +2313,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
          * Constructor.
          */
         private IpFinderCleaner() {
-            super(ignite.name(), "tcp-disco-ip-finder-cleaner", log);
+            super(gridName, "tcp-disco-ip-finder-cleaner", log);
 
             setPriority(threadPri);
         }
@@ -2579,7 +2579,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
                     ClientMessageWorker wrk = clientMsgWorkers.get(msg.creatorNodeId());
 
                     if (wrk != null) {
-                        msg.verify(ignite.configuration().getNodeId());
+                        msg.verify(getLocalNodeId());
 
                         wrk.addMessage(msg);
                     }
@@ -2638,7 +2638,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
             boolean searchNext = true;
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             while (true) {
                 if (searchNext) {
@@ -3035,7 +3035,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
             TcpDiscoveryNode node = msg.node();
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             if (!msg.client()) {
                 boolean rmtHostLoopback = node.socketAddresses().size() == 1 &&
@@ -3354,7 +3354,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
          * @param msg Client reconnect message.
          */
         private void processClientReconnectMessage(TcpDiscoveryClientReconnectMessage msg) {
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             boolean isLocalNodeRouter = locNodeId.equals(msg.routerNodeId());
 
@@ -3436,7 +3436,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
                 return;
             }
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             if (isLocalNodeCoordinator()) {
                 if (msg.verified()) {
@@ -3650,7 +3650,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
             boolean locNodeCoord = isLocalNodeCoordinator();
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             if (locNodeCoord) {
                 if (msg.verified()) {
@@ -3759,7 +3759,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         private void processNodeLeftMessage(TcpDiscoveryNodeLeftMessage msg) {
             assert msg != null;
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             UUID leavingNodeId = msg.creatorNodeId();
 
@@ -4004,7 +4004,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
             boolean locNodeCoord = isLocalNodeCoordinator();
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             if (locNodeCoord) {
                 if (msg.verified()) {
@@ -4093,7 +4093,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         private void processStatusCheckMessage(TcpDiscoveryStatusCheckMessage msg) {
             assert msg != null;
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             if (msg.failedNodeId() != null) {
                 if (locNodeId.equals(msg.failedNodeId())) {
@@ -4215,7 +4215,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
         private void processHeartbeatMessage(TcpDiscoveryHeartbeatMessage msg) {
             assert msg != null;
 
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             if (ring.node(msg.creatorNodeId()) == null) {
                 if (log.isDebugEnabled())
@@ -4346,9 +4346,9 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
             assert msgId != null;
 
             if (isLocalNodeCoordinator()) {
-                if (!ignite.configuration().getNodeId().equals(msg.verifierNodeId()))
+                if (!getLocalNodeId().equals(msg.verifierNodeId()))
                     // Message is not verified or verified by former coordinator.
-                    msg.verify(ignite.configuration().getNodeId());
+                    msg.verify(getLocalNodeId());
                 else
                     // Discard the message.
                     return;
@@ -4424,7 +4424,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
          * @throws IgniteSpiException In case of error.
          */
         TcpServer() throws IgniteSpiException {
-            super(ignite.name(), "tcp-disco-srvr", log);
+            super(gridName, "tcp-disco-srvr", log);
 
             setPriority(threadPri);
 
@@ -4522,7 +4522,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
          * @param sock Socket to read data from.
          */
         SocketReader(Socket sock) {
-            super(ignite.name(), "tcp-disco-sock-reader", log);
+            super(gridName, "tcp-disco-sock-reader", log);
 
             this.sock = sock;
 
@@ -4533,7 +4533,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
         /** {@inheritDoc} */
         @Override protected void body() throws InterruptedException {
-            UUID locNodeId = ignite.configuration().getNodeId();
+            UUID locNodeId = getLocalNodeId();
 
             try {
                 InputStream in;
@@ -4995,7 +4995,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
                 if (state == CONNECTING) {
                     if (noResAddrs.contains(rmtAddr) ||
-                        ignite.configuration().getNodeId().compareTo(msg.creatorNodeId()) < 0)
+                        getLocalNodeId().compareTo(msg.creatorNodeId()) < 0)
                         // Remote node node has not responded to join request or loses UUID race.
                         res = RES_WAIT;
                     else
@@ -5053,7 +5053,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
          * Constructor.
          */
         StatisticsPrinter() {
-            super(ignite.name(), "tcp-disco-stats-printer", log);
+            super(gridName, "tcp-disco-stats-printer", log);
 
             assert statsPrintFreq > 0;
 
@@ -5130,7 +5130,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
 
                 if (log.isDebugEnabled())
                     log.debug("Redirecting message to client [sock=" + sock + ", locNodeId="
-                        + ignite.configuration().getNodeId() + ", rmtNodeId=" + nodeId + ", msg=" + msg + ']');
+                        + getLocalNodeId() + ", rmtNodeId=" + nodeId + ", msg=" + msg + ']');
 
                 try {
                     prepareNodeAddedMessage(msg, nodeId, null, null);
@@ -5144,10 +5144,10 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
             catch (IgniteCheckedException | IOException e) {
                 if (log.isDebugEnabled())
                     U.error(log, "Client connection failed [sock=" + sock + ", locNodeId="
-                        + ignite.configuration().getNodeId() + ", rmtNodeId=" + nodeId + ", msg=" + msg + ']', e);
+                        + getLocalNodeId() + ", rmtNodeId=" + nodeId + ", msg=" + msg + ']', e);
 
                 onException("Client connection failed [sock=" + sock + ", locNodeId="
-                    + ignite.configuration().getNodeId() + ", rmtNodeId=" + nodeId + ", msg=" + msg + ']', e);
+                    + getLocalNodeId() + ", rmtNodeId=" + nodeId + ", msg=" + msg + ']', e);
 
                 U.interrupt(clientMsgWorkers.remove(nodeId));
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
index 1d9559e..e949846 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java
@@ -152,6 +152,8 @@ abstract class TcpDiscoverySpiAdapter extends IgniteSpiAdapter implements Discov
      */
     @IgniteInstanceResource
     protected void injectResources(Ignite ignite) {
+        super.injectResources(ignite);
+
         // Inject resource.
         if (ignite != null)
             setLocalAddress(ignite.configuration().getLocalHost());
@@ -767,7 +769,7 @@ abstract class TcpDiscoverySpiAdapter extends IgniteSpiAdapter implements Discov
          *
          */
         SocketTimeoutWorker() {
-            super(ignite.name(), "tcp-disco-sock-timeout-worker", log);
+            super(gridName, "tcp-disco-sock-timeout-worker", log);
 
             setPriority(threadPri);
         }
@@ -935,7 +937,7 @@ abstract class TcpDiscoverySpiAdapter extends IgniteSpiAdapter implements Discov
          * @param name Thread name.
          */
         protected MessageWorkerAdapter(String name) {
-            super(ignite.name(), name, log);
+            super(gridName, name, log);
 
             setPriority(threadPri);
         }
@@ -943,7 +945,7 @@ abstract class TcpDiscoverySpiAdapter extends IgniteSpiAdapter implements Discov
         /** {@inheritDoc} */
         @Override protected void body() throws InterruptedException {
             if (log.isDebugEnabled())
-                log.debug("Message worker started [locNodeId=" + ignite.configuration().getNodeId() + ']');
+                log.debug("Message worker started [locNodeId=" + getLocalNodeId() + ']');
 
             while (!isInterrupted()) {
                 TcpDiscoveryAbstractMessage msg = queue.poll(2000, TimeUnit.MILLISECONDS);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
index 1d2670e..5df37d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
@@ -257,7 +257,7 @@ public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi,
 
         registerMBean(gridName, this, FileSwapSpaceSpiMBean.class);
 
-        String path = baseDir + File.separator + gridName + File.separator + ignite.configuration().getNodeId();
+        String path = baseDir + File.separator + gridName + File.separator + getLocalNodeId();
 
         try {
             dir = U.resolveWorkDirectory(path, true);
@@ -1433,8 +1433,6 @@ public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi,
 
                         final Object mux = new Object();
 
-                        String gridName = ignite.name();
-
                         writer = new IgniteSpiThread(gridName,  "Swap writer: " + name, log) {
                             @Override protected void body() throws InterruptedException {
                                 while (!isInterrupted()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
index 0492dd1..bfed977 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.spi.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
 import org.apache.ignite.testframework.junits.spi.*;
@@ -280,7 +281,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
         for (int i = 0; i < getSpiCount(); i++) {
             CommunicationSpi<Message> spi = getSpi(i);
 
-            GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
+            GridTestUtils.setFieldValue(spi, IgniteSpiAdapter.class, "gridName", "grid-" + i);
 
             IgniteTestResources rsrcs = new IgniteTestResources();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
index 2ccb89d..c038ee7 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
@@ -317,7 +318,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
         for (int i = 0; i < SPI_CNT; i++) {
             CommunicationSpi<Message> spi = createSpi();
 
-            GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
+            GridTestUtils.setFieldValue(spi, IgniteSpiAdapter.class, "gridName", "grid-" + i);
 
             IgniteTestResources rsrcs = new IgniteTestResources();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
index 692de62..e7ae957 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
@@ -439,7 +440,7 @@ public class GridTcpCommunicationSpiMultithreadedSelfTest extends GridSpiAbstrac
         for (int i = 0; i < getSpiCount(); i++) {
             CommunicationSpi<Message> spi = newCommunicationSpi();
 
-            GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
+            GridTestUtils.setFieldValue(spi, IgniteSpiAdapter.class, "gridName", "grid-" + i);
 
             IgniteTestResources rsrcs = new IgniteTestResources();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
index f1d0847..c0f0b11 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
@@ -343,7 +344,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T extends CommunicationS
         for (int i = 0; i < SPI_CNT; i++) {
             TcpCommunicationSpi spi = getSpi(ackCnt, idleTimeout, queueLimit);
 
-            GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
+            GridTestUtils.setFieldValue(spi, IgniteSpiAdapter.class, "gridName", "grid-" + i);
 
             IgniteTestResources rsrcs = new IgniteTestResources();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65f34729/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
index 1b941f1..7463388 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
@@ -632,7 +632,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
         for (int i = 0; i < SPI_CNT; i++) {
             TcpCommunicationSpi spi = getSpi(i);
 
-            GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
+            GridTestUtils.setFieldValue(spi, IgniteSpiAdapter.class, "gridName", "grid-" + i);
 
             IgniteTestResources rsrcs = new IgniteTestResources();
 


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

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3


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

Branch: refs/heads/ignite-688
Commit: 5f2d8c29a0d13704810d6b4befcdea9538c2eec3
Parents: 74f6b68 cd65c17
Author: sboikov <sb...@gridgain.com>
Authored: Tue Apr 7 13:29:10 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Apr 7 13:29:10 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                                | 2 +-
 modules/aop/pom.xml                                             | 2 +-
 modules/aws/pom.xml                                             | 2 +-
 modules/clients/pom.xml                                         | 2 +-
 modules/codegen/pom.xml                                         | 2 +-
 modules/core/pom.xml                                            | 2 +-
 .../apache/ignite/internal/visor/log/VisorLogSearchTask.java    | 3 +--
 .../ignite/internal/visor/query/VisorQueryNextPageTask.java     | 5 ++---
 modules/extdata/p2p/pom.xml                                     | 2 +-
 modules/extdata/uri/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/rest-http/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/spring/pom.xml                                          | 2 +-
 modules/ssh/pom.xml                                             | 2 +-
 modules/tools/pom.xml                                           | 2 +-
 modules/urideploy/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 +-
 31 files changed, 32 insertions(+), 34 deletions(-)
----------------------------------------------------------------------



[10/27] incubator-ignite git commit: # ignite-sprint-3 disable hanging test

Posted by sb...@apache.org.
# ignite-sprint-3 disable hanging test


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

Branch: refs/heads/ignite-688
Commit: 74f6b680994e31127410383cb719e53d44e42fa0
Parents: 25af55a
Author: sboikov <sb...@gridgain.com>
Authored: Tue Apr 7 13:28:47 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Apr 7 13:28:47 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/IgniteCacheAffinitySelfTest.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/74f6b680/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
index e5b7d68..3679cdd 100644
--- a/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
@@ -86,6 +86,11 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest {
         return new NearCacheConfiguration();
     }
 
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        fail("Enable when https://issues.apache.org/jira/browse/IGNITE-647 is fixed.");
+    }
+
     /**
      * @throws Exception if failed.
      */


[05/27] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-684' into ignite-sprint-3

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-684' into ignite-sprint-3


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

Branch: refs/heads/ignite-688
Commit: 25af55a10e692d61adf05d15b4f17c113dacbcdb
Parents: 238cbb1 6be884e
Author: sboikov <sb...@gridgain.com>
Authored: Tue Apr 7 12:57:02 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Apr 7 12:57:02 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       |   3 -
 .../processors/cache/CacheLazyEntry.java        |  10 +-
 .../processors/cache/KeyCacheObjectImpl.java    |  13 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   3 +-
 .../IgniteCacheObjectProcessorImpl.java         |  28 +--
 .../org/apache/ignite/lang/IgniteImmutable.java |  49 -----
 .../GridCacheOnCopyFlagAbstractSelfTest.java    | 112 +----------
 .../GridCacheReturnValueTransferSelfTest.java   |   1 -
 .../IgniteCacheStoreValueAbstractTest.java      | 186 ++++++++++++++++++-
 9 files changed, 201 insertions(+), 204 deletions(-)
----------------------------------------------------------------------



[18/27] incubator-ignite git commit: minor

Posted by sb...@apache.org.
minor


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

Branch: refs/heads/ignite-688
Commit: aa812a130a2b35b221392513fe9bfd6ca79b18bb
Parents: 943a49b
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Apr 7 15:59:52 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Apr 7 15:59:52 2015 +0300

----------------------------------------------------------------------
 .../eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java    | 2 +-
 .../apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa812a13/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
index 7a9f4f4..c30e3a5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/fifo/GridCacheFifoBatchEvictionPolicySelfTest.java
@@ -30,7 +30,7 @@ import static org.apache.ignite.cache.CacheMode.*;
  * FIFO batch eviction test.
  */
 public class GridCacheFifoBatchEvictionPolicySelfTest extends
-        GridCacheEvictionAbstractTest<FifoEvictionPolicy<String, String>> {
+    GridCacheEvictionAbstractTest<FifoEvictionPolicy<String, String>> {
     /**
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aa812a13/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
index 26148bb..1037b54 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
@@ -37,6 +37,7 @@ public class IgniteCacheEvictionSelfTestSuite extends TestSuite {
         TestSuite suite = new TestSuite("Ignite Cache Eviction Test Suite");
 
         suite.addTest(new TestSuite(GridCacheFifoEvictionPolicySelfTest.class));
+        suite.addTest(new TestSuite(GridCacheFifoBatchEvictionPolicySelfTest.class));
         suite.addTest(new TestSuite(GridCacheLruEvictionPolicySelfTest.class));
         suite.addTest(new TestSuite(GridCacheLruNearEvictionPolicySelfTest.class));
         suite.addTest(new TestSuite(GridCacheNearOnlyLruNearEvictionPolicySelfTest.class));


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

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3


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

Branch: refs/heads/ignite-688
Commit: f11e3574a97925d01526beb9e3aeaca9f596072a
Parents: 20bc2ed cceceb6
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 7 18:16:59 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 7 18:16:59 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                                  |  2 +-
 bin/ignite.sh                                   |  2 +-
 bin/include/service.sh                          |  8 +-
 config/hadoop/default-config.xml                | 15 ++--
 .../streaming/StreamTransformerExample.java     |  3 +-
 .../ipc/shmem/IpcSharedMemoryNativeLoader.java  | 48 ++++++++----
 .../org/apache/ignite/spi/IgniteSpiAdapter.java | 24 +++++-
 .../communication/tcp/TcpCommunicationSpi.java  | 14 ++--
 .../discovery/tcp/TcpClientDiscoverySpi.java    | 47 ++++++------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 78 ++++++++++----------
 .../discovery/tcp/TcpDiscoverySpiAdapter.java   |  8 +-
 .../spi/swapspace/file/FileSwapSpaceSpi.java    |  4 +-
 ...ridCacheFifoBatchEvictionPolicySelfTest.java |  3 +-
 .../GridAbstractCommunicationSelfTest.java      |  3 +-
 .../GridTcpCommunicationSpiAbstractTest.java    |  5 +-
 ...mmunicationSpiConcurrentConnectSelfTest.java |  3 +-
 ...cpCommunicationSpiMultithreadedSelfTest.java |  3 +-
 ...dTcpCommunicationSpiRecoveryAckSelfTest.java |  3 +-
 ...GridTcpCommunicationSpiRecoverySelfTest.java |  2 +-
 .../IgniteCacheEvictionSelfTestSuite.java       |  1 +
 20 files changed, 162 insertions(+), 114 deletions(-)
----------------------------------------------------------------------



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

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3


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

Branch: refs/heads/ignite-688
Commit: 6553549ff534fb64d1e4405b5f7cde50b84304c6
Parents: aa812a1 21e328d
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Apr 7 16:00:02 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Apr 7 16:00:02 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                   |  2 +-
 bin/ignite.sh                    |  2 +-
 bin/include/service.sh           |  8 +++++---
 config/hadoop/default-config.xml | 15 ++++++++++-----
 4 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------



[16/27] incubator-ignite git commit: # IGNITE-665: Applied patch from Ivan V..

Posted by sb...@apache.org.
# IGNITE-665: Applied patch from Ivan V..


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

Branch: refs/heads/ignite-688
Commit: 2a6462183c37d09321df61a0f6ed56789c562f14
Parents: bed567f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Apr 7 15:34:03 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Apr 7 15:34:03 2015 +0300

----------------------------------------------------------------------
 bin/ignite.bat                   |  2 +-
 bin/ignite.sh                    |  2 +-
 bin/include/service.sh           |  8 +++++---
 config/hadoop/default-config.xml | 15 ++++++++++-----
 4 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a646218/bin/ignite.bat
----------------------------------------------------------------------
diff --git a/bin/ignite.bat b/bin/ignite.bat
index f390422..687db60 100644
--- a/bin/ignite.bat
+++ b/bin/ignite.bat
@@ -195,7 +195,7 @@ if "%MAIN_CLASS%" == "" set MAIN_CLASS=org.apache.ignite.startup.cmdline.Command
 ::
 :: Remote debugging (JPDA).
 :: Uncomment and change if remote debugging is required.
-:: set JVM_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JVM_OPTS%
+:: set JVM_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787 %JVM_OPTS%
 ::
 
 if "%INTERACTIVE%" == "1" (

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a646218/bin/ignite.sh
----------------------------------------------------------------------
diff --git a/bin/ignite.sh b/bin/ignite.sh
index e77db17..a246613 100755
--- a/bin/ignite.sh
+++ b/bin/ignite.sh
@@ -130,7 +130,7 @@ fi
 # Remote debugging (JPDA).
 # Uncomment and change if remote debugging is required.
 #
-# JVM_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n ${JVM_OPTS}"
+# JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787 ${JVM_OPTS}"
 
 ERRORCODE="-1"
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a646218/bin/include/service.sh
----------------------------------------------------------------------
diff --git a/bin/include/service.sh b/bin/include/service.sh
index 7400ec7..73beb86 100755
--- a/bin/include/service.sh
+++ b/bin/include/service.sh
@@ -53,8 +53,7 @@ case "$1" in
 
         # Set default JVM options if they was not passed.
         if [ -z "$JVM_OPTS" ]; then
-            JVM_OPTS="-Xms1g -Xmx1g -server -XX:+AggressiveOpts"
-            [ "$HADOOP_EDITION" = "1" ] && JVM_OPTS="${JVM_OPTS} -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"
+            JVM_OPTS="-Xms1g -Xmx1g -server -XX:+AggressiveOpts -XX:MaxPermSize=512m"
         fi
 
         # Resolve config directory.
@@ -66,9 +65,12 @@ case "$1" in
         # Discover path to Java executable and check it's version.
         checkJava
 
+        # Clear output log.
+        echo >"${IGNITE_LOG_DIR}"/ignite.out
+
         # And run.
         $JAVA $JVM_OPTS -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \
-        -DIGNITE_PROG_NAME="$0" -cp "$IGNITE_LIBS" "$MAIN_CLASS" "$DEFAULT_CONFIG" &>/dev/null &
+          -DIGNITE_PROG_NAME="$0" -cp "$IGNITE_LIBS" "$MAIN_CLASS" "$DEFAULT_CONFIG" >& "${IGNITE_LOG_DIR}"/ignite.out &
 
         # Write process id.
         echo $! >$PIDFILE

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a646218/config/hadoop/default-config.xml
----------------------------------------------------------------------
diff --git a/config/hadoop/default-config.xml b/config/hadoop/default-config.xml
index e45311e..30413b0 100644
--- a/config/hadoop/default-config.xml
+++ b/config/hadoop/default-config.xml
@@ -130,14 +130,19 @@
                         </bean>
                     </property>
 
-                    <!-- Example secondary file system configuration (IGFS configured over Hadoop HDFS): -->
+                    <!-- Sample secondary file system configuration.
+                        'uri'      - the URI of the secondary file system.
+                        'cfgPath'  - optional configuration path of the secondary file system,
+                            e.g. /opt/foo/core-site.xml. Typically left to be null.
+                        'userName' - optional user name to access the secondary file system on behalf of. Use it
+                            if Hadoop client and the Ignite node are running on behalf of different users.
+                    -->
                     <!--
-                    <property name="defaultMode" value="PROXY"/>
-
                     <property name="secondaryFileSystem">
                         <bean class="org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem">
-                            <constructor-arg name="uri"     value="hdfs://1.2.3.4:9000"/>
-                            <constructor-arg name="cfgPath" value="/opt/hadoop-server/etc/hadoop/core-site.xml"/>
+                            <constructor-arg name="uri" value="hdfs://localhost:9000"/>
+                            <constructor-arg name="cfgPath"><null/></constructor-arg>
+                            <constructor-arg name="userName" value="client-user-name"/>
                         </bean>
                     </property>
                     -->


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

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3


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

Branch: refs/heads/ignite-688
Commit: 1a8bd5b78b5ac848c2aa8c4f20bcd23b9711814b
Parents: a9d5177 25af55a
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 7 13:01:41 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 7 13:01:41 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       |   3 -
 .../processors/cache/CacheLazyEntry.java        |  10 +-
 .../processors/cache/KeyCacheObjectImpl.java    |  13 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   3 +-
 .../IgniteCacheObjectProcessorImpl.java         |  28 +--
 .../org/apache/ignite/lang/IgniteImmutable.java |  49 -----
 .../GridCacheOnCopyFlagAbstractSelfTest.java    | 112 +----------
 .../GridCacheReturnValueTransferSelfTest.java   |   1 -
 .../IgniteCacheStoreValueAbstractTest.java      | 186 ++++++++++++++++++-
 9 files changed, 201 insertions(+), 204 deletions(-)
----------------------------------------------------------------------



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

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3


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

Branch: refs/heads/ignite-688
Commit: 21e328db304529da686b6d22d1f540d5e0a521b2
Parents: 2a64621 943a49b
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Apr 7 15:34:28 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Apr 7 15:34:28 2015 +0300

----------------------------------------------------------------------
 .../ignite/examples/streaming/StreamTransformerExample.java       | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------



[12/27] incubator-ignite git commit: ignite-678 site deploy

Posted by sb...@apache.org.
ignite-678 site deploy


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

Branch: refs/heads/ignite-688
Commit: f0bcbc9931e809b3dbd81f9232b7518361d0cc6a
Parents: 5f2d8c2
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 7 14:25:41 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 7 14:25:41 2015 +0300

----------------------------------------------------------------------
 pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f0bcbc99/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6dcf63d..8abda8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -549,6 +549,7 @@
                                         <copy file="${basedir}/target/${project.artifactId}-${project.version}-source-release.zip.asc" todir="${basedir}/target/site" />
                                         <copy file="${basedir}/target/${project.artifactId}-${project.version}-source-release.zip.md5" todir="${basedir}/target/site" />
                                         <copy file="${basedir}/target/${project.artifactId}-${project.version}-source-release.zip.sha1" todir="${basedir}/target/site" />
+                                        <copy file="${basedir}/KEYS" todir="${basedir}/target/site" />
                                     </target>
                                 </configuration>
                             </execution>


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

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


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

Branch: refs/heads/ignite-688
Commit: cd65c17763eef3924230bec4808c1df85b245072
Parents: 404da5f 1a8bd5b
Author: Andrey Novikov <an...@gridgain.com>
Authored: Tue Apr 7 17:08:40 2015 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Tue Apr 7 17:08:40 2015 +0700

----------------------------------------------------------------------
 examples/pom.xml                                |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../configuration/CacheConfiguration.java       |   3 -
 .../processors/cache/CacheLazyEntry.java        |  10 +-
 .../processors/cache/KeyCacheObjectImpl.java    |  13 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   3 +-
 .../IgniteCacheObjectProcessorImpl.java         |  28 +--
 .../org/apache/ignite/lang/IgniteImmutable.java |  49 -----
 .../GridCacheOnCopyFlagAbstractSelfTest.java    | 112 +----------
 .../GridCacheReturnValueTransferSelfTest.java   |   1 -
 .../IgniteCacheStoreValueAbstractTest.java      | 186 ++++++++++++++++++-
 modules/extdata/p2p/pom.xml                     |   2 +-
 modules/extdata/uri/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/rest-http/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/spring/pom.xml                          |   2 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/urideploy/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 +-
 38 files changed, 230 insertions(+), 233 deletions(-)
----------------------------------------------------------------------



[06/27] incubator-ignite git commit: sprint-3 version rollback

Posted by sb...@apache.org.
sprint-3 version rollback


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

Branch: refs/heads/ignite-688
Commit: a9d51775b0ab3cd31ac59146ca28ce0cf8d1ce99
Parents: 238cbb1
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 7 13:00:07 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 7 13:00:07 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml              | 2 +-
 modules/aop/pom.xml           | 2 +-
 modules/aws/pom.xml           | 2 +-
 modules/clients/pom.xml       | 2 +-
 modules/codegen/pom.xml       | 2 +-
 modules/core/pom.xml          | 2 +-
 modules/extdata/p2p/pom.xml   | 2 +-
 modules/extdata/uri/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/rest-http/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/spring/pom.xml        | 2 +-
 modules/ssh/pom.xml           | 2 +-
 modules/tools/pom.xml         | 2 +-
 modules/urideploy/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 +-
 29 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 55e3e84..08f44eb 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>ignite-examples</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 4a4acb8..917ccc6 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aop</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 0691192..b738450 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aws</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 5be6a28..29250f4 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-clients</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 0b0234e..2990330 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-codegen</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 9882e20..466ccb9 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-core</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index c4ab1ca..c8f0d63 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-extdata-p2p</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index 01ec830..ed7bff5 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-extdata-uri</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index ce1882c..d0ae253 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-geospatial</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index bacb214..69d5294 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hadoop</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 4f4e6fb..eba98b5 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hibernate</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 5fe9017..5851e66 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-indexing</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index acf5b50..c2d1851 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jcl</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 8051a04..dbf4eac 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jta</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index bb5f222..6f88587 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 752b90d..cbade02 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-rest-http</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 5e5bd45..83de256 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index a8e6596..fe11f3f 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schedule</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index b7bd056..9eb95c1 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schema-import</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 336167f..9feba39 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-slf4j</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 2694a83..533c1f2 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spring</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 37bbe08..1f70406 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-ssh</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 38e322d..68b1fb9 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-tools</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index cb2d924..d8a9aa1 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-urideploy</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 8067a9c..bd1d20c 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-console</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 417c205..a63289d 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-plugins</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <!-- Ignite dependencies -->

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 7ef4f17..eeeec39 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-web</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index ce22309..0d2e81a 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yardstick</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
 
     <properties>
         <yardstick.version>0.7.0</yardstick.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9d51775/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 62e0466..6dcf63d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>incubator-ignite</artifactId>
-    <version>1.0.2-RC1-SNAPSHOT</version>
+    <version>1.0.1-RC1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>


[02/27] incubator-ignite git commit: # ignite-684

Posted by sb...@apache.org.
# ignite-684


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

Branch: refs/heads/ignite-688
Commit: ed0b8646deadb20ab0cd86e987c2a326d380ed78
Parents: 360a41f
Author: sboikov <sb...@gridgain.com>
Authored: Tue Apr 7 09:31:43 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Apr 7 09:31:43 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheLazyEntry.java        | 10 ++++----
 .../processors/cache/KeyCacheObjectImpl.java    | 13 +---------
 .../IgniteCacheObjectProcessorImpl.java         |  5 ----
 .../GridCacheOnCopyFlagAbstractSelfTest.java    | 27 +++++---------------
 .../IgniteCacheStoreValueAbstractTest.java      | 18 +++++++++++++
 5 files changed, 30 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed0b8646/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
index a2b0bff..d0f0d4f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
@@ -68,18 +68,18 @@ public class CacheLazyEntry<K, V> implements Cache.Entry<K, V> {
 
     /**
      * @param ctx Cache context.
-     * @param keyObject Key cache object.
+     * @param keyObj Key cache object.
      * @param key Key value.
      * @param valObj Cache object
      * @param val Cache value.
      */
     public CacheLazyEntry(GridCacheContext<K, V> ctx, 
-        KeyCacheObject keyObject, 
-        K key, 
-        CacheObject valObj, 
+        KeyCacheObject keyObj,
+        K key,
+        CacheObject valObj,
         V val) {
         this.cctx = ctx;
-        this.keyObj = keyObject;
+        this.keyObj = keyObj;
         this.key = key;
         this.valObj = valObj;
         this.val = val;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed0b8646/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
index 429b30c..61ca882 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
@@ -72,18 +72,7 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Nullable @Override public <T> T value(CacheObjectContext ctx, boolean cpy) {
-        cpy = cpy && needCopy(ctx);
-
-        if (cpy) {
-            try {
-                return (T)ctx.processor().unmarshal(ctx,
-                    valBytes,
-                    val.getClass().getClassLoader());
-            }
-            catch (IgniteCheckedException e) {
-                throw new IgniteException("Failed to unmarshal object.", e);
-            }
-        }
+        assert val != null;
 
         return (T)val;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed0b8646/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index bd79d0c..7815e91 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -278,11 +278,6 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
         }
 
         /** {@inheritDoc} */
-        @Nullable @Override public <T> T value(CacheObjectContext ctx, boolean cpy) {
-            return super.value(ctx, false);  // Do not need copy since user value is not in cache.
-        }
-
-        /** {@inheritDoc} */
         @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
             try {
                 if (!ctx.processor().immutable(val)) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed0b8646/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
index c1ad283..cea6ca1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
@@ -138,8 +138,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
                     assertSame(entry.getValue(), entry.getValue());
                     assertSame(entry.getKey(), entry.getKey());
 
-                    // Try change key and value.
-                    entry.getKey().field(WRONG_VALUE);
+                    // Try change value.
                     entry.getValue().val(WRONG_VALUE);
                 }
             });
@@ -161,8 +160,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
 
                     assertEquals(newTestVal, newVal);
 
-                    // Try change key and value.
-                    entry.getKey().field(WRONG_VALUE);
+                    // Try change value.
                     entry.getValue().val(WRONG_VALUE);
 
                     return newVal;
@@ -174,8 +172,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
                     assertSame(entry.getValue(), entry.getValue());
                     assertSame(entry.getKey(), entry.getKey());
 
-                    // Try change key and value.
-                    entry.getKey().field(WRONG_VALUE);
+                    // Try change value.
                     entry.getValue().val(WRONG_VALUE);
                 }
             });
@@ -221,7 +218,6 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
                 assertEquals(entry.getKey().key(), entry.getKey().field());
 
                 // Try changed entry.
-                entry.getKey().field(WRONG_VALUE);
                 entry.getValue().val(WRONG_VALUE);
 
                 return super.onBeforePut(entry, newVal);
@@ -231,7 +227,6 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
                 assertEquals(entry.getKey().key(), entry.getKey().field());
 
                 entry.getValue().val(WRONG_VALUE);
-                entry.getKey().field(WRONG_VALUE);
 
                 super.onAfterPut(entry);
             }
@@ -241,12 +236,10 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
             cache.invoke(new TestKey(i, i), new EntryProcessor<TestKey, TestValue, Object>() {
                 @Override public Object process(MutableEntry<TestKey, TestValue> entry, Object... arguments)
                     throws EntryProcessorException {
-                    // Check that we have correct value and key.
-                    assertEquals(entry.getKey().key(), entry.getKey().field());
+                    // Check that we have correct value.
                     assertEquals(entry.getKey().key(), entry.getValue().val());
 
                     // Try changed entry.
-                    entry.getKey().field(WRONG_VALUE);
                     entry.getValue().val(WRONG_VALUE);
 
                     return -1;
@@ -294,7 +287,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
 
             TestKey key1 = entry.key().value(cctx.cacheObjectContext(), true);
 
-            assertNotSame(key0, key1);
+            assertSame(key0, key1);
 
             TestValue val0 = entry.rawGet().value(cctx.cacheObjectContext(), false);
 
@@ -340,7 +333,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
 
             TestKey key1 = entry.key().value(cctx.cacheObjectContext(), true);
 
-            assertNotSame(key0, key1);
+            assertSame(key0, key1);
 
             byte[] val0 = entry.rawGet().value(cctx.cacheObjectContext(), false);
 
@@ -442,14 +435,6 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
             return field;
         }
 
-        /**
-         * *
-         * @param field Test field.
-         */
-        public void field(int field) {
-            this.field = field;
-        }
-
         /** {@inheritDoc} */
         @Override public boolean equals(Object o) {
             if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed0b8646/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
index 3835c8e..6c7c38d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheStoreValueAbstractTest.java
@@ -251,6 +251,15 @@ public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstr
                 assertNotNull("Unexpected value, node: " + g,
                     GridTestUtils.getFieldValue(keyObj, CacheObjectAdapter.class, "val"));
 
+                Object key0 = keyObj.value(cache0.context().cacheObjectContext(), true);
+                Object key1 = keyObj.value(cache0.context().cacheObjectContext(), false);
+                Object key2 = keyObj.value(cache0.context().cacheObjectContext(), true);
+                Object key3 = keyObj.value(cache0.context().cacheObjectContext(), false);
+
+                assertSame(key0, key1);
+                assertSame(key1, key2);
+                assertSame(key2, key3);
+
                 CacheObject obj = e.rawGet();
 
                 if (obj != null) {
@@ -379,6 +388,15 @@ public abstract class IgniteCacheStoreValueAbstractTest extends IgniteCacheAbstr
                 assertNotNull("Unexpected value, node: " + g,
                     GridTestUtils.getFieldValue(keyObj, CacheObjectAdapter.class, "val"));
 
+                Object key0 = keyObj.value(cache0.context().cacheObjectContext(), true);
+                Object key1 = keyObj.value(cache0.context().cacheObjectContext(), false);
+                Object key2 = keyObj.value(cache0.context().cacheObjectContext(), true);
+                Object key3 = keyObj.value(cache0.context().cacheObjectContext(), false);
+
+                assertSame(key0, key1);
+                assertSame(key1, key2);
+                assertSame(key2, key3);
+
                 CacheObject obj = e.rawGet();
 
                 if (obj != null) {


[04/27] incubator-ignite git commit: # ignite-684

Posted by sb...@apache.org.
# ignite-684


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

Branch: refs/heads/ignite-688
Commit: 6be884eec804c5ef1f060a7b0364f5ab52caf23a
Parents: 72c6dd1
Author: sboikov <sb...@gridgain.com>
Authored: Tue Apr 7 12:17:31 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Apr 7 12:17:31 2015 +0300

----------------------------------------------------------------------
 .../processors/cacheobject/IgniteCacheObjectProcessorImpl.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6be884ee/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 7815e91..95fb9f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -337,7 +337,8 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
                     ClassLoader ldr = ctx.p2pEnabled() ?
                         IgniteUtils.detectClass(this.val).getClassLoader() : val.getClass().getClassLoader();
 
-                    Object val = ctx.processor().unmarshal(ctx, valBytes, ldr);
+                    Object val = this.val != null && ctx.processor().immutable(this.val) ? this.val :
+                        ctx.processor().unmarshal(ctx, valBytes, ldr);
 
                     return new CacheObjectImpl(val, valBytes);
                 }


[14/27] incubator-ignite git commit: minor

Posted by sb...@apache.org.
minor


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

Branch: refs/heads/ignite-688
Commit: 174729d925cbe87d032cf9d4de5c6dcc5b2d7bef
Parents: 5f2d8c2
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Apr 7 15:08:08 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Apr 7 15:08:08 2015 +0300

----------------------------------------------------------------------
 .../ignite/examples/streaming/StreamTransformerExample.java       | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/174729d9/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
index 5901984..5e95892 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
@@ -64,8 +64,7 @@ public class StreamTransformerExample {
 
                     // Configure data transformation to count random numbers added to the stream.
                     stmr.receiver(new StreamTransformer<Integer, Long>() {
-                        @Override
-                        public Object process(MutableEntry<Integer, Long> e, Object... args) {
+                        @Override public Object process(MutableEntry<Integer, Long> e, Object... args) {
                             // Get current count.
                             Long val = e.getValue();
 


[23/27] incubator-ignite git commit: ignite-678 site deploy + javadoc stage fix

Posted by sb...@apache.org.
ignite-678 site deploy + javadoc stage fix


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

Branch: refs/heads/ignite-688
Commit: 20bc2ed7cf8e847440d12b38ad2dade6f412cebd
Parents: f0bcbc9
Author: avinogradov <av...@gridgain.com>
Authored: Tue Apr 7 18:16:34 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Tue Apr 7 18:16:34 2015 +0300

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 pom.xml        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20bc2ed7/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index f24f4ae..661b310 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -545,7 +545,7 @@
                         <goals>
                             <goal>jar</goal>
                         </goals>
-                        <phase>install</phase>
+                        <phase>package</phase>
                         <configuration>
                             <stylesheetfile>
                                 ${project.basedir}/${project.parent.relativePath}/../assembly/docfiles/javadoc.css

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20bc2ed7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8abda8a..c9dfce4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -542,6 +542,7 @@
                                                 <include name="${project.artifactId}-${project.version}-source-release.zip.asc" />
                                                 <include name="${project.artifactId}-${project.version}-source-release.zip.md5" />
                                                 <include name="${project.artifactId}-${project.version}-source-release.zip.sha1" />
+                                                <include name="${basedir}/KEYS" />
                                             </zipfileset>
                                         </zip>
                                         <mkdir dir="${basedir}/target/site" />


[22/27] incubator-ignite git commit: IGNITE-632 Fixed tests.

Posted by sb...@apache.org.
IGNITE-632 Fixed tests.


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

Branch: refs/heads/ignite-688
Commit: cceceb674bc6f132fb0203db5458b669567dfa85
Parents: 65f3472
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Apr 7 17:48:32 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Apr 7 17:48:32 2015 +0300

----------------------------------------------------------------------
 .../communication/tcp/GridTcpCommunicationSpiAbstractTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cceceb67/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
index 5c16bfd..ea51aff 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.spi.communication.tcp;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 
@@ -79,8 +80,8 @@ abstract class GridTcpCommunicationSpiAbstractTest extends GridAbstractCommunica
             ConcurrentMap<UUID, GridTcpCommunicationClient> clients = U.field(spi, "clients");
 
             for (int i = 0; i < 20 && !clients.isEmpty(); i++) {
-                info("Check failed for SPI [grid=" + GridTestUtils.getFieldValue(spi, "gridName") +
-                    ", spi=" + spi + ']');
+                info("Check failed for SPI [grid=" +
+                    GridTestUtils.getFieldValue(spi, IgniteSpiAdapter.class, "gridName") + ", spi=" + spi + ']');
 
                 U.sleep(1000);
             }


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

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3


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

Branch: refs/heads/ignite-688
Commit: 943a49b26fd1fbc26d2b30ba15b6174f85ec862a
Parents: 174729d bed567f
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Apr 7 15:08:30 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Apr 7 15:08:30 2015 +0300

----------------------------------------------------------------------
 .../ipc/shmem/IpcSharedMemoryNativeLoader.java  | 48 ++++++++++++++------
 pom.xml                                         |  1 +
 2 files changed, 36 insertions(+), 13 deletions(-)
----------------------------------------------------------------------



[26/27] incubator-ignite git commit: ignite-688 Age related cluster group doesn't refresh dynamically

Posted by sb...@apache.org.
ignite-688 Age related cluster group doesn't refresh dynamically


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

Branch: refs/heads/ignite-688
Commit: 97ad565f1605013433e556be37c5b8f4d659b144
Parents: 6fd1615
Author: Andrey Gura <ag...@gridgain.com>
Authored: Tue Apr 7 14:54:09 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Tue Apr 7 18:31:37 2015 +0300

----------------------------------------------------------------------
 .../internal/cluster/ClusterGroupAdapter.java   | 86 ++++++++++++++++++--
 1 file changed, 80 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/97ad565f/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index 40462c3..b93a920 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -60,10 +60,10 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
     private String gridName;
 
     /** Subject ID. */
-    private UUID subjId;
+    protected UUID subjId;
 
     /** Cluster group predicate. */
-    protected IgnitePredicate<ClusterNode> p;
+    protected volatile IgnitePredicate<ClusterNode> p;
 
     /** Node IDs. */
     private Set<UUID> ids;
@@ -114,6 +114,28 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
     }
 
     /**
+     * @param subjId Subject ID.
+     * @param ctx Grid kernal context.
+     * @param p Predicate.
+     * @param ids Node IDs.
+     */
+    private ClusterGroupAdapter(@Nullable GridKernalContext ctx,
+                                @Nullable UUID subjId,
+                                @Nullable IgnitePredicate<ClusterNode> p,
+                                Set<UUID> ids)
+    {
+        if (ctx != null)
+            setKernalContext(ctx);
+
+        this.subjId = subjId;
+        this.p = p;
+        this.ids = ids;
+
+        if (p == null && ids != null)
+            this.p = F.nodeForNodeIds(ids);
+    }
+
+    /**
      * <tt>ctx.gateway().readLock()</tt>
      */
     protected void guard() {
@@ -303,7 +325,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
     }
 
     /** {@inheritDoc} */
-    @Override public final ClusterGroup forPredicate(IgnitePredicate<ClusterNode> p) {
+    @Override public ClusterGroup forPredicate(IgnitePredicate<ClusterNode> p) {
         A.notNull(p, "p");
 
         guard();
@@ -769,6 +791,9 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
         /** Selected node. */
         private volatile ClusterNode node;
 
+        /** Node predicate. */
+        private IgnitePredicate<ClusterNode> parentP;
+
         /** Last topology version. */
         private volatile long lastTopVer;
 
@@ -784,8 +809,9 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
          * @param isOldest Oldest flag.
          */
         private AgeClusterGroup(ClusterGroupAdapter parent, boolean isOldest) {
-            super(parent.ctx, parent.subjId, (IgnitePredicate<ClusterNode>)null);
+            super(parent.ctx, parent.subjId, parent.p, parent.ids);
 
+            this.parentP = parent.p;
             this.isOldest = isOldest;
 
             reset();
@@ -800,9 +826,9 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
             try {
                 lastTopVer = ctx.discovery().topologyVersion();
 
-                Collection<ClusterNode> nodes = ctx.discovery().allNodes();
+                this.p = parentP;
 
-                this.node = isOldest ? U.oldest(nodes, null) : U.youngest(nodes, null);
+                this.node = isOldest ? U.oldest(super.nodes(), null) : U.youngest(super.nodes(), null);
 
                 this.p = F.nodeForNodes(node);
             }
@@ -828,5 +854,53 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
 
             return node == null ? Collections.<ClusterNode>emptyList() : Collections.singletonList(node);
         }
+
+        /** {@inheritDoc} */
+        @Override public ClusterGroup forPredicate(IgnitePredicate<ClusterNode> p) {
+            A.notNull(p, "p");
+
+            guard();
+
+            try {
+                if (p != null)
+                    ctx.resource().injectGeneric(p);
+
+                return new ClusterGroupAdapter(ctx, this.subjId, new GroupPredicate(this, p));
+            }
+            catch (IgniteCheckedException e) {
+                throw U.convertException(e);
+            }
+            finally {
+                unguard();
+            }
+        }
+    }
+
+    /**
+     * Dynamic cluster group based predicate.
+     */
+    private static class GroupPredicate implements IgnitePredicate<ClusterNode> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** Target cluster group. */
+        private final ClusterGroup grp;
+
+        /** Predicate. */
+        private final IgnitePredicate<ClusterNode> p;
+
+        /**
+         * @param grp Cluster group.
+         * @param p Predicate.
+         */
+        public GroupPredicate(ClusterGroup grp, IgnitePredicate<ClusterNode> p) {
+            this.grp = grp;
+            this.p = p;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean apply(ClusterNode node) {
+            return grp.predicate().apply(node) && p.apply(node);
+        }
     }
 }


[25/27] incubator-ignite git commit: ignite-688 Age related cluster group doesn't refresh dynamically

Posted by sb...@apache.org.
ignite-688 Age related cluster group doesn't refresh dynamically


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

Branch: refs/heads/ignite-688
Commit: 6fd16157825a600119b26d9b4b5f6166cc97c093
Parents: f11e357
Author: agura <ag...@gridgain.com>
Authored: Tue Apr 7 02:03:50 2015 +0300
Committer: Andrey Gura <ag...@gridgain.com>
Committed: Tue Apr 7 18:31:37 2015 +0300

----------------------------------------------------------------------
 .../internal/cluster/ClusterGroupAdapter.java   | 29 ++++----------------
 1 file changed, 5 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6fd16157/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index 0daffcc..40462c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -114,28 +114,6 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
     }
 
     /**
-     * @param subjId Subject ID.
-     * @param ctx Grid kernal context.
-     * @param p Predicate.
-     * @param ids Node IDs.
-     */
-    private ClusterGroupAdapter(@Nullable GridKernalContext ctx,
-        @Nullable UUID subjId,
-        @Nullable IgnitePredicate<ClusterNode> p,
-        Set<UUID> ids)
-    {
-        if (ctx != null)
-            setKernalContext(ctx);
-
-        this.subjId = subjId;
-        this.p = p;
-        this.ids = ids;
-
-        if (p == null && ids != null)
-            this.p = F.nodeForNodeIds(ids);
-    }
-
-    /**
      * <tt>ctx.gateway().readLock()</tt>
      */
     protected void guard() {
@@ -806,7 +784,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
          * @param isOldest Oldest flag.
          */
         private AgeClusterGroup(ClusterGroupAdapter parent, boolean isOldest) {
-            super(parent.ctx, parent.subjId, (IgnitePredicate<ClusterNode>) null);
+            super(parent.ctx, parent.subjId, (IgnitePredicate<ClusterNode>)null);
 
             this.isOldest = isOldest;
 
@@ -822,7 +800,10 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
             try {
                 lastTopVer = ctx.discovery().topologyVersion();
 
-                this.node = isOldest ? U.oldest(super.nodes(), null) : U.youngest(super.nodes(), null);
+                Collection<ClusterNode> nodes = ctx.discovery().allNodes();
+
+                this.node = isOldest ? U.oldest(nodes, null) : U.youngest(nodes, null);
+
                 this.p = F.nodeForNodes(node);
             }
             finally {


[13/27] incubator-ignite git commit: # IGNITE-679: Applied patch from Ivan V.

Posted by sb...@apache.org.
# IGNITE-679: Applied patch from Ivan V.


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

Branch: refs/heads/ignite-688
Commit: bed567f9e468b2aa6b752475cc2936cb6c0dc6a3
Parents: f0bcbc9
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Apr 7 14:37:36 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Apr 7 14:37:36 2015 +0300

----------------------------------------------------------------------
 .../ipc/shmem/IpcSharedMemoryNativeLoader.java  | 48 ++++++++++++++------
 1 file changed, 35 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bed567f9/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
index ef9f46a..dc00ca6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
@@ -33,18 +33,15 @@ import static org.apache.ignite.internal.IgniteVersionUtils.*;
  */
 @SuppressWarnings("ErrorNotRethrown")
 public class IpcSharedMemoryNativeLoader {
-    /** Loaded flag. */
-    private static volatile boolean loaded;
-
     /** Library name base. */
     private static final String LIB_NAME_BASE = "igniteshmem";
 
-    /** Lock file path. */
-    private static final File LOCK_FILE = new File(System.getProperty("java.io.tmpdir"), "igniteshmem.lock");
-
     /** Library name. */
     static final String LIB_NAME = LIB_NAME_BASE + "-" + VER_STR;
 
+    /** Loaded flag. */
+    private static volatile boolean loaded;
+
     /**
      * @return Operating system name to resolve path to library.
      */
@@ -121,16 +118,20 @@ public class IpcSharedMemoryNativeLoader {
             errs.add(e);
         }
 
+        File tmpDir = getUserSpecificTempDir();
+
+        File lockFile = new File(tmpDir, "igniteshmem.lock");
+
         // Obtain lock on file to prevent concurrent extracts.
-        try (RandomAccessFile randomAccessFile = new RandomAccessFile(LOCK_FILE, "rws");
+        try (RandomAccessFile randomAccessFile = new RandomAccessFile(lockFile, "rws");
              FileLock ignored = randomAccessFile.getChannel().lock()) {
-            if (extractAndLoad(errs, platformSpecificResourcePath()))
+            if (extractAndLoad(errs, tmpDir, platformSpecificResourcePath()))
                 return;
 
-            if (extractAndLoad(errs, osSpecificResourcePath()))
+            if (extractAndLoad(errs, tmpDir, osSpecificResourcePath()))
                 return;
 
-            if (extractAndLoad(errs, resourcePath()))
+            if (extractAndLoad(errs, tmpDir, resourcePath()))
                 return;
 
             // Failed to find the library.
@@ -139,11 +140,32 @@ public class IpcSharedMemoryNativeLoader {
             throw new IgniteCheckedException("Failed to load native IPC library: " + errs);
         }
         catch (IOException e) {
-            throw new IgniteCheckedException("Failed to obtain file lock: " + LOCK_FILE, e);
+            throw new IgniteCheckedException("Failed to obtain file lock: " + lockFile, e);
         }
     }
 
     /**
+     * Gets temporary directory unique for each OS user.
+     * The directory guaranteed to exist, though may not be empty.
+     */
+    private static File getUserSpecificTempDir() throws IgniteCheckedException {
+        String tmp = System.getProperty("java.io.tmpdir");
+
+        String userName = System.getProperty("user.name");
+
+        File tmpDir = new File(tmp, userName);
+
+        if (!tmpDir.exists())
+            //noinspection ResultOfMethodCallIgnored
+            tmpDir.mkdirs();
+
+        if (!(tmpDir.exists() && tmpDir.isDirectory()))
+            throw new IgniteCheckedException("Failed to create temporary directory [dir=" + tmpDir + ']');
+
+        return tmpDir;
+    }
+
+    /**
      * @return OS resource path.
      */
     private static String osSpecificResourcePath() {
@@ -181,13 +203,13 @@ public class IpcSharedMemoryNativeLoader {
      * @param rsrcPath Path.
      * @return {@code True} if library was found and loaded.
      */
-    private static boolean extractAndLoad(Collection<Throwable> errs, String rsrcPath) {
+    private static boolean extractAndLoad(Collection<Throwable> errs, File tmpDir, String rsrcPath) {
         ClassLoader clsLdr = U.detectClassLoader(IpcSharedMemoryNativeLoader.class);
 
         URL rsrc = clsLdr.getResource(rsrcPath);
 
         if (rsrc != null)
-            return extract(errs, rsrc, new File(System.getProperty("java.io.tmpdir"), mapLibraryName(LIB_NAME)));
+            return extract(errs, rsrc, new File(tmpDir, mapLibraryName(LIB_NAME)));
         else {
             errs.add(new IllegalStateException("Failed to find resource with specified class loader " +
                 "[rsrc=" + rsrcPath + ", clsLdr=" + clsLdr + ']'));