You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/27 12:57:14 UTC

[01/15] ignite git commit: IGNITE-5095 NULL strings in REST-HTTP should be serialized as null.

Repository: ignite
Updated Branches:
  refs/heads/ignite-5072-merge fe50d761e -> 588ddcb8f


IGNITE-5095 NULL strings in REST-HTTP should be serialized as null.


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

Branch: refs/heads/ignite-5072-merge
Commit: 6ccfc0b26ea9af2d40d76359e3da621f0fded95d
Parents: f5db974
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Thu Apr 27 15:37:17 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu Apr 27 15:37:17 2017 +0700

----------------------------------------------------------------------
 .../client/ClientDefaultCacheSelfTest.java      |   4 +-
 .../JettyRestProcessorAbstractSelfTest.java     | 143 +++++++++----------
 .../http/jetty/GridJettyObjectMapper.java       |  13 +-
 3 files changed, 74 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6ccfc0b2/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java
index 25fa2e9..2fe6084 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientDefaultCacheSelfTest.java
@@ -176,8 +176,8 @@ public class ClientDefaultCacheSelfTest extends GridCommonAbstractTest {
 
         assertFalse(node.get("affinityNodeId").asText().isEmpty());
         assertEquals(0, node.get("successStatus").asInt());
-        assertTrue(node.get("error").asText().isEmpty());
-        assertTrue(node.get("sessionToken").asText().isEmpty());
+        assertTrue(node.get("error").isNull());
+        assertTrue(node.get("sessionToken").isNull());
 
         return node.get("response");
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/6ccfc0b2/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 130d9d1..0207782 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -238,9 +238,9 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         JsonNode node = JSON_MAPPER.readTree(content);
 
         assertEquals(1, node.get("successStatus").asInt());
-        assertFalse(node.get("error").asText().isEmpty());
+        assertFalse(node.get("error").isNull());
         assertTrue(node.get("response").isNull());
-        assertTrue(node.get("sessionToken").asText().isEmpty());
+        assertTrue(node.get("sessionToken").isNull());
     }
 
     /**
@@ -270,11 +270,11 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         JsonNode node = JSON_MAPPER.readTree(content);
 
-        assertEquals(bulk, node.get("affinityNodeId").asText().isEmpty());
+        assertEquals(bulk, node.get("affinityNodeId").isNull());
         assertEquals(0, node.get("successStatus").asInt());
-        assertTrue(node.get("error").asText().isEmpty());
+        assertTrue(node.get("error").isNull());
 
-        assertNotSame(securityEnabled(), node.get("sessionToken").asText().isEmpty());
+        assertNotSame(securityEnabled(), node.get("sessionToken").isNull());
 
         return node.get("response");
     }
@@ -319,9 +319,9 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         JsonNode node = JSON_MAPPER.readTree(content);
 
         assertEquals(0, node.get("successStatus").asInt());
-        assertTrue(node.get("error").asText().isEmpty());
+        assertTrue(node.get("error").isNull());
 
-        assertNotSame(securityEnabled(), node.get("sessionToken").asText().isEmpty());
+        assertNotSame(securityEnabled(), node.get("sessionToken").isNull());
 
         return node.get("response");
     }
@@ -337,18 +337,18 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         JsonNode node = JSON_MAPPER.readTree(content);
 
         assertEquals(0, node.get("successStatus").asInt());
-        assertTrue(node.get("error").asText().isEmpty());
+        assertTrue(node.get("error").isNull());
         assertFalse(node.get("response").isNull());
 
-        assertEquals(securityEnabled(), !node.get("sessionToken").asText().isEmpty());
+        assertEquals(securityEnabled(), !node.get("sessionToken").isNull());
 
         JsonNode res = node.get("response");
 
         assertTrue(res.isObject());
 
-        assertFalse(res.get("id").asText().isEmpty());
+        assertFalse(res.get("id").isNull());
         assertTrue(res.get("finished").asBoolean());
-        assertTrue(res.get("error").asText().isEmpty());
+        assertTrue(res.get("error").isNull());
 
         return res.get("result");
     }
@@ -359,7 +359,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testGet() throws Exception {
         jcache().put("getKey", "getVal");
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "getKey"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "getKey"));
 
         info("Get command result: " + ret);
 
@@ -376,7 +376,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("mapKey1", map1);
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "mapKey1"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "mapKey1"));
 
         info("Get command result: " + ret);
 
@@ -390,7 +390,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("mapKey2", map2);
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "mapKey2"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "mapKey2"));
 
         info("Get command result: " + ret);
 
@@ -407,7 +407,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("simplePersonKey", p);
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "simplePersonKey"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "simplePersonKey"));
 
         info("Get command result: " + ret);
 
@@ -434,7 +434,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("utilDateKey", utilDate);
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "utilDateKey"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "utilDateKey"));
 
         info("Get command result: " + ret);
 
@@ -444,7 +444,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("sqlDateKey", sqlDate);
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "sqlDateKey"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "sqlDateKey"));
 
         info("Get SQL result: " + ret);
 
@@ -452,7 +452,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("timestampKey", new java.sql.Timestamp(utilDate.getTime()));
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "timestampKey"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "timestampKey"));
 
         info("Get timestamp: " + ret);
 
@@ -467,7 +467,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("uuidKey", uuid);
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "uuidKey"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "uuidKey"));
 
         info("Get command result: " + ret);
 
@@ -477,7 +477,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("igniteUuidKey", igniteUuid);
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "igniteUuidKey"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "igniteUuidKey"));
 
         info("Get command result: " + ret);
 
@@ -492,7 +492,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("tupleKey", t);
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_GET.key(), "key", "tupleKey"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_GET.key(), "key", "tupleKey"));
 
         info("Get command result: " + ret);
 
@@ -510,7 +510,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         jcache().put("getKey", "getVal");
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_SIZE.key()));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_SIZE.key()));
 
         info("Size command result: " + ret);
 
@@ -521,7 +521,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testIgniteName() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.NAME.key()));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.NAME.key()));
 
         info("Name command result: " + ret);
 
@@ -532,13 +532,13 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testGetOrCreateCache() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.GET_OR_CREATE_CACHE.key(), "cacheName", "testCache"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.GET_OR_CREATE_CACHE.key(), "cacheName", "testCache"));
 
         info("Name command result: " + ret);
 
         grid(0).cache("testCache").put("1", "1");
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.DESTROY_CACHE.key(), "cacheName", "testCache"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.DESTROY_CACHE.key(), "cacheName", "testCache"));
 
         assertTrue(jsonResponse(ret).isNull());
 
@@ -711,7 +711,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testPut() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_PUT.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_PUT.key(),
             "key", "putKey", "val", "putVal"));
 
         info("Put command result: " + ret);
@@ -725,7 +725,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testPutWithExpiration() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_PUT.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_PUT.key(),
             "key", "putKey", "val", "putVal", "exp", "2000"));
 
         assertCacheOperation(ret, true);
@@ -743,7 +743,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testAdd() throws Exception {
         jcache().put("addKey1", "addVal1");
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_ADD.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_ADD.key(),
             "key", "addKey2", "val", "addVal2"));
 
         assertCacheOperation(ret, true);
@@ -756,7 +756,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testAddWithExpiration() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_ADD.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_ADD.key(),
             "key", "addKey", "val", "addVal", "exp", "2000"));
 
         assertCacheOperation(ret, true);
@@ -797,7 +797,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("rmvVal", jcache().localPeek("rmvKey"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_REMOVE.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_REMOVE.key(),
             "key", "rmvKey"));
 
         info("Remove command result: " + ret);
@@ -821,7 +821,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertEquals("rmvVal3", jcache().localPeek("rmvKey3"));
         assertEquals("rmvVal4", jcache().localPeek("rmvKey4"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_REMOVE_ALL.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_REMOVE_ALL.key(),
             "k1", "rmvKey1", "k2", "rmvKey2"));
 
         info("Remove all command result: " + ret);
@@ -833,7 +833,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertCacheBulkOperation(ret, true);
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_REMOVE_ALL.key()));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_REMOVE_ALL.key()));
 
         info("Remove all command result: " + ret);
 
@@ -854,7 +854,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("casOldVal", jcache().localPeek("casKey"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_CAS.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_CAS.key(),
             "key", "casKey", "val2", "casOldVal", "val1", "casNewVal"));
 
         info("CAS command result: " + ret);
@@ -874,7 +874,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("repOldVal", jcache().localPeek("repKey"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_REPLACE.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_REPLACE.key(),
             "key", "repKey", "val", "repVal"));
 
         info("Replace command result: " + ret);
@@ -892,7 +892,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("replaceVal", jcache().get("replaceKey"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_REPLACE.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_REPLACE.key(),
             "key", "replaceKey", "val", "replaceValNew", "exp", "2000"));
 
         assertCacheOperation(ret, true);
@@ -911,7 +911,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testAppend() throws Exception {
         jcache().put("appendKey", "appendVal");
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_APPEND.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_APPEND.key(),
             "key", "appendKey", "val", "_suffix"));
 
         assertCacheOperation(ret, true);
@@ -925,7 +925,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testPrepend() throws Exception {
         jcache().put("prependKey", "prependVal");
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_PREPEND.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_PREPEND.key(),
             "key", "prependKey", "val", "prefix_"));
 
         assertCacheOperation(ret, true);
@@ -937,7 +937,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testIncrement() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.ATOMIC_INCREMENT.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.ATOMIC_INCREMENT.key(),
             "key", "incrKey", "init", "2", "delta", "3"));
 
         JsonNode res = jsonResponse(ret);
@@ -945,7 +945,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertEquals(5, res.asInt());
         assertEquals(5, grid(0).atomicLong("incrKey", 0, true).get());
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.ATOMIC_INCREMENT.key(), "key", "incrKey", "delta", "10"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.ATOMIC_INCREMENT.key(), "key", "incrKey", "delta", "10"));
 
         res = jsonResponse(ret);
 
@@ -957,7 +957,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testDecrement() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.ATOMIC_DECREMENT.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.ATOMIC_DECREMENT.key(),
             "key", "decrKey", "init", "15", "delta", "10"));
 
         JsonNode res = jsonResponse(ret);
@@ -965,7 +965,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertEquals(5, res.asInt());
         assertEquals(5, grid(0).atomicLong("decrKey", 0, true).get());
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.ATOMIC_DECREMENT.key(),
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.ATOMIC_DECREMENT.key(),
             "key", "decrKey", "delta", "3"));
 
         res = jsonResponse(ret);
@@ -982,7 +982,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("casOldVal", jcache().localPeek("casKey"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_CAS.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_CAS.key(),
             "key", "casKey", "val2", "casOldVal"));
 
         info("CAR command result: " + ret);
@@ -998,7 +998,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     public void testPutIfAbsent() throws Exception {
         assertNull(jcache().localPeek("casKey"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_CAS.key(),
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_CAS.key(),
             "key", "casKey", "val1", "casNewVal"));
 
         info("PutIfAbsent command result: " + ret);
@@ -1016,7 +1016,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals("casVal", jcache().localPeek("casKey"));
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_CAS.key(), "key", "casKey"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_CAS.key(), "key", "casKey"));
 
         info("CAS Remove command result: " + ret);
 
@@ -1029,7 +1029,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testMetrics() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_METRICS.key()));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_METRICS.key()));
 
         info("Cache metrics command result: " + ret);
 
@@ -1127,13 +1127,13 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         Collection<GridCacheSqlMetadata> metas = cache.context().queries().sqlMetadata();
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_METADATA.key()));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_METADATA.key()));
 
         info("Cache metadata: " + ret);
 
         testMetadata(metas, ret);
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_METADATA.key(), "cacheName", "person"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_METADATA.key(), "cacheName", "person"));
 
         info("Cache metadata with cacheName parameter: " + ret);
 
@@ -1153,13 +1153,13 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         Collection<GridCacheSqlMetadata> metas = c.context().queries().sqlMetadata();
 
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_METADATA.key()));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_METADATA.key()));
 
         info("Cache metadata: " + ret);
 
         testMetadata(metas, ret);
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CACHE_METADATA.key(), "cacheName", "person"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CACHE_METADATA.key(), "cacheName", "person"));
 
         info("Cache metadata with cacheName parameter: " + ret);
 
@@ -1170,7 +1170,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testTopology() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.TOPOLOGY.key(), "attr", "false", "mtr", "false"));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.TOPOLOGY.key(), "attr", "false", "mtr", "false"));
 
         info("Topology command result: " + ret);
 
@@ -1214,7 +1214,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testNode() throws Exception {
-        String ret = content(F.asMap("cmd",GridRestCommand.NODE.key(), "attr", "true", "mtr", "true", "id",
+        String ret = content(F.asMap("cmd", GridRestCommand.NODE.key(), "attr", "true", "mtr", "true", "id",
             grid(0).localNode().id().toString()));
 
         info("Topology command result: " + ret);
@@ -1224,7 +1224,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertTrue(res.get("attributes").isObject());
         assertTrue(res.get("metrics").isObject());
 
-        ret = content(F.asMap("cmd",GridRestCommand.NODE.key(), "attr", "false", "mtr", "false", "ip", LOC_HOST));
+        ret = content(F.asMap("cmd", GridRestCommand.NODE.key(), "attr", "false", "mtr", "false", "ip", LOC_HOST));
 
         info("Topology command result: " + ret);
 
@@ -1233,7 +1233,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertTrue(res.get("attributes").isNull());
         assertTrue(res.get("metrics").isNull());
 
-        ret = content(F.asMap("cmd",GridRestCommand.NODE.key(), "attr", "false", "mtr", "false", "ip", LOC_HOST, "id",
+        ret = content(F.asMap("cmd", GridRestCommand.NODE.key(), "attr", "false", "mtr", "false", "ip", LOC_HOST, "id",
             UUID.randomUUID().toString()));
 
         info("Topology command result: " + ret);
@@ -1251,14 +1251,14 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testExe() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.EXE.key()));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.EXE.key()));
 
         info("Exe command result: " + ret);
 
         assertResponseContainsError(ret);
 
         // Attempt to execute unknown task (UNKNOWN_TASK) will result in exception on server.
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.EXE.key(), "name", "UNKNOWN_TASK"));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.EXE.key(), "name", "UNKNOWN_TASK"));
 
         info("Exe command result: " + ret);
 
@@ -1267,7 +1267,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         grid(0).compute().localDeployTask(TestTask1.class, TestTask1.class.getClassLoader());
         grid(0).compute().localDeployTask(TestTask2.class, TestTask2.class.getClassLoader());
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.EXE.key(), "name", TestTask1.class.getName()));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.EXE.key(), "name", TestTask1.class.getName()));
 
         info("Exe command result: " + ret);
 
@@ -1275,7 +1275,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertTrue(res.isNull());
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.EXE.key(), "name", TestTask2.class.getName()));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.EXE.key(), "name", TestTask2.class.getName()));
 
         info("Exe command result: " + ret);
 
@@ -1283,7 +1283,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertEquals(TestTask2.RES, res.asText());
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.RESULT.key()));
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.RESULT.key()));
 
         info("Exe command result: " + ret);
 
@@ -1602,14 +1602,14 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         // Spring XML to start cache via Visor task.
         final String START_CACHE =
             "<beans xmlns=\"http://www.springframework.org/schema/beans\"\n" +
-                    "    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
-                    "    xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n" +
-                    "        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\">\n" +
-                    "    <bean id=\"cacheConfiguration\" class=\"org.apache.ignite.configuration.CacheConfiguration\">\n" +
-                    "        <property name=\"cacheMode\" value=\"PARTITIONED\"/>\n" +
-                    "        <property name=\"name\" value=\"c\"/>\n" +
-                    "   </bean>\n" +
-                    "</beans>";
+                "    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+                "    xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n" +
+                "        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\">\n" +
+                "    <bean id=\"cacheConfiguration\" class=\"org.apache.ignite.configuration.CacheConfiguration\">\n" +
+                "        <property name=\"cacheMode\" value=\"PARTITIONED\"/>\n" +
+                "        <property name=\"name\" value=\"c\"/>\n" +
+                "   </bean>\n" +
+                "</beans>";
 
         ret = content(new VisorGatewayArgument(VisorCacheStartTask.class)
             .argument(VisorCacheStartTaskArg.class, false, "person2",
@@ -1653,7 +1653,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
      * @throws Exception If failed.
      */
     public void testVersion() throws Exception {
-        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.VERSION.key()));
+        String ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.VERSION.key()));
 
         JsonNode res = jsonResponse(ret);
 
@@ -1759,7 +1759,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         assertFalse(jsonResponse(ret).get("queryId").isNull());
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.FETCH_SQL_QUERY.key(),
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.FETCH_SQL_QUERY.key(),
             "pageSize", "1", "qryId", qryId.asText()));
 
         JsonNode res = jsonResponse(ret);
@@ -1769,7 +1769,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertEquals(qryId0, qryId);
         assertFalse(res.get("last").asBoolean());
 
-        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.FETCH_SQL_QUERY.key(),
+        ret = content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.FETCH_SQL_QUERY.key(),
             "pageSize", "1", "qryId", qryId.asText()));
 
         res = jsonResponse(ret);
@@ -1911,7 +1911,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
 
         String qryId = res.get("queryId").asText();
 
-        content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd",GridRestCommand.CLOSE_SQL_QUERY.key(), "cacheName", "person", "qryId", qryId));
+        content(F.asMap("cacheName", DEFAULT_CACHE_NAME, "cmd", GridRestCommand.CLOSE_SQL_QUERY.key(), "cacheName", "person", "qryId", qryId));
 
         assertFalse(queryCursorFound());
     }
@@ -2016,7 +2016,6 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
         assertEquals(2, personCache.query(qry).getAll().size());
     }
 
-
     /**
      * Organization class.
      */
@@ -2216,7 +2215,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
          * @return This helper for chaining method calls.
          */
         public VisorGatewayArgument arguments(Object... vals) {
-            for (Object val: vals)
+            for (Object val : vals)
                 put("p" + idx++, String.valueOf(val));
 
             return this;

http://git-wip-us.apache.org/repos/asf/ignite/blob/6ccfc0b2/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
index 44dd09c..5a94315 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyObjectMapper.java
@@ -77,14 +77,6 @@ public class GridJettyObjectMapper extends ObjectMapper {
         }
     };
 
-    /** Custom {@code null} string serializer. */
-    private static final JsonSerializer<Object> NULL_STRING_VALUE_SERIALIZER = new JsonSerializer<Object>() {
-        /** {@inheritDoc} */
-        @Override public void serialize(Object val, JsonGenerator gen, SerializerProvider ser) throws IOException {
-            gen.writeString("");
-        }
-    };
-
     /**
      * Custom serializers provider that provide special serializers for {@code null} values.
      */
@@ -108,7 +100,7 @@ public class GridJettyObjectMapper extends ObjectMapper {
         }
 
         /** {@inheritDoc} */
-        public DefaultSerializerProvider createInstance(SerializationConfig cfg, SerializerFactory jsf) {
+        @Override public DefaultSerializerProvider createInstance(SerializationConfig cfg, SerializerFactory jsf) {
             return new CustomSerializerProvider(this, cfg, jsf);
         }
 
@@ -120,9 +112,6 @@ public class GridJettyObjectMapper extends ObjectMapper {
 
         /** {@inheritDoc} */
         @Override public JsonSerializer<Object> findNullValueSerializer(BeanProperty prop) throws JsonMappingException {
-            if (prop.getType().getRawClass() == String.class)
-                return NULL_STRING_VALUE_SERIALIZER;
-
             return NULL_VALUE_SERIALIZER;
         }
     }


[09/15] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0


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

Branch: refs/heads/ignite-5072-merge
Commit: c294b2706b0be11e77795593744330c292d98711
Parents: a0731f3 8dc3a4c
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 27 12:35:20 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 27 12:35:20 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheProcessor.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------



[08/15] ignite git commit: Fixed default test timeouts.

Posted by ag...@apache.org.
Fixed default test timeouts.


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

Branch: refs/heads/ignite-5072-merge
Commit: a0731f31016c3076f90ab0c2b9d038b80a6594ba
Parents: 9f5f57a
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 27 12:34:57 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 27 12:34:57 2017 +0300

----------------------------------------------------------------------
 .../apache/ignite/testframework/junits/GridAbstractTest.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a0731f31/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index c800cfb..d9dd639 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -1475,10 +1475,10 @@ public abstract class GridAbstractTest extends TestCase {
         }
         else {
             // Set network timeout to 10 sec to avoid unexpected p2p class loading errors.
-            cfg.setNetworkTimeout(10000);
+            cfg.setNetworkTimeout(10_000);
 
-            // Increase failure detection timeoute to avoid unexpected node fails.
-            cfg.setFailureDetectionTimeout(300000);
+            cfg.setFailureDetectionTimeout(10_000);
+            cfg.setClientFailureDetectionTimeout(10_000);
         }
 
         // Set metrics update interval to 1 second to speed up tests.


[07/15] ignite git commit: Quick fix for cache activate/deactivate.

Posted by ag...@apache.org.
Quick fix for cache activate/deactivate.


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

Branch: refs/heads/ignite-5072-merge
Commit: 8dc3a4cb1f0eb32503a2524fd91d5178843dce6b
Parents: 9f5f57a
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 12:33:48 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 12:33:48 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheProcessor.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8dc3a4cb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 8e58856..d6225c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -3614,9 +3614,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @return Descriptor.
      */
     public DynamicCacheDescriptor cacheDescriptor(String name) {
-        assert name != null;
-
-        return registeredCaches.get(name);
+        return name != null ? registeredCaches.get(name) : null;
     }
 
     /**


[02/15] ignite git commit: Fixed IGFS and Memcached examples.

Posted by ag...@apache.org.
Fixed IGFS and Memcached examples.


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

Branch: refs/heads/ignite-5072-merge
Commit: ff13240c428439327b0de7efd8bad4bc773a093c
Parents: f5db974
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 11:45:03 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 11:45:03 2017 +0300

----------------------------------------------------------------------
 .../misc/client/memcache/MemcacheRestExample.java |  2 +-
 .../memcache/MemcacheRestExampleNodeStartup.java  |  1 +
 .../processors/cache/GridCacheProcessor.java      |  2 +-
 modules/core/src/test/config/igfs-loopback.xml    | 18 ------------------
 modules/core/src/test/config/igfs-shmem.xml       | 18 ------------------
 5 files changed, 3 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ff13240c/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
index eb0e2d4..7913ea6 100644
--- a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
@@ -52,7 +52,7 @@ public class MemcacheRestExample {
             System.out.println();
             System.out.println(">>> Memcache REST example started.");
 
-            IgniteCache<String, Object> cache = ignite.cache(null);
+            IgniteCache<String, Object> cache = ignite.cache("default");
 
             client = startMemcachedClient(host, port);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff13240c/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java
index 439e042..aa3685e 100644
--- a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java
+++ b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExampleNodeStartup.java
@@ -65,6 +65,7 @@ public class MemcacheRestExampleNodeStartup {
 
         CacheConfiguration cacheCfg = new CacheConfiguration();
 
+        cacheCfg.setName("default");
         cacheCfg.setAtomicityMode(TRANSACTIONAL);
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         cacheCfg.setRebalanceMode(SYNC);

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff13240c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index a01bac6..8e58856 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -708,7 +708,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @throws IgniteCheckedException If failed.
      */
     private void registerCache(CacheConfiguration<?, ?> cfg) throws IgniteCheckedException {
-        assert cfg.getName() != null;
+        CU.validateCacheName(cfg.getName());
 
         cloneCheckSerializable(cfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff13240c/modules/core/src/test/config/igfs-loopback.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/igfs-loopback.xml b/modules/core/src/test/config/igfs-loopback.xml
index 7ec5f10..6584348 100644
--- a/modules/core/src/test/config/igfs-loopback.xml
+++ b/modules/core/src/test/config/igfs-loopback.xml
@@ -53,24 +53,6 @@
         Configuration below demonstrates how to setup a IGFS node with file data.
     -->
     <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <!--
-            Configure optimized marshaller.
-        -->
-        <property name="marshaller">
-            <bean class="org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller">
-                <!--
-                    For better performance set this property to true in case
-                    all marshalled classes implement java.io.Serializable.
-                    Default value is true.
-
-                    Note, that it is recommended to implement java.io.Externalizable
-                    instead of java.io.Serializable for smaller network footprint
-                    and even better performance.
-                -->
-                <property name="requireSerializable" value="false"/>
-            </bean>
-        </property>
-
         <property name="fileSystemConfiguration">
             <list>
                 <bean class="org.apache.ignite.configuration.FileSystemConfiguration">

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff13240c/modules/core/src/test/config/igfs-shmem.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/igfs-shmem.xml b/modules/core/src/test/config/igfs-shmem.xml
index f6b1790..79aacb8 100644
--- a/modules/core/src/test/config/igfs-shmem.xml
+++ b/modules/core/src/test/config/igfs-shmem.xml
@@ -53,24 +53,6 @@
         Configuration below demonstrates how to setup a IGFS node with file data.
     -->
     <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-        <!--
-            Configure optimized marshaller.
-        -->
-        <property name="marshaller">
-            <bean class="org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller">
-                <!--
-                    For better performance set this property to true in case
-                    all marshalled classes implement java.io.Serializable.
-                    Default value is true.
-
-                    Note, that it is recommended to implement java.io.Externalizable
-                    instead of java.io.Serializable for smaller network footprint
-                    and even better performance.
-                -->
-                <property name="requireSerializable" value="false"/>
-            </bean>
-        </property>
-
         <property name="fileSystemConfiguration">
             <list>
                 <bean class="org.apache.ignite.configuration.FileSystemConfiguration">


[04/15] ignite git commit: ignite-2.0 - Added missing license file for RocketMQ module

Posted by ag...@apache.org.
ignite-2.0 - Added missing license file for RocketMQ module


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

Branch: refs/heads/ignite-5072-merge
Commit: f9a2e02c9aea1f5bedfca452b939b91d1d9d7787
Parents: 64656d1
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 27 12:06:42 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 27 12:06:42 2017 +0300

----------------------------------------------------------------------
 modules/rocketmq/licenses/apache-2.0.txt | 202 ++++++++++++++++++++++++++
 1 file changed, 202 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f9a2e02c/modules/rocketmq/licenses/apache-2.0.txt
----------------------------------------------------------------------
diff --git a/modules/rocketmq/licenses/apache-2.0.txt b/modules/rocketmq/licenses/apache-2.0.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/modules/rocketmq/licenses/apache-2.0.txt
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.


[11/15] ignite git commit: TcpDiscoverySpi: removed unneeded const.

Posted by ag...@apache.org.
TcpDiscoverySpi: removed unneeded const.


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

Branch: refs/heads/ignite-5072-merge
Commit: 44e0de66bff9911eea05e82b8b23c927df108bee
Parents: c58b8a3
Author: sboikov <sb...@gridgain.com>
Authored: Thu Apr 27 12:49:52 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Apr 27 12:49:52 2017 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/44e0de66/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 46d6f06..99a7dac 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
@@ -238,12 +238,6 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi {
     /** Default value for thread priority (value is <tt>10</tt>). */
     public static final int DFLT_THREAD_PRI = 10;
 
-    /**
-     * Default metrics update messages issuing frequency
-     * (value is {@link IgniteConfiguration#DFLT_METRICS_UPDATE_FREQ}).
-     */
-    public static final long DFLT_METRICS_UPDATE_FREQ = IgniteConfiguration.DFLT_METRICS_UPDATE_FREQ;
-
     /** Default size of topology snapshots history. */
     public static final int DFLT_TOP_HISTORY_SIZE = 1000;
 
@@ -297,7 +291,7 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi {
     protected int threadPri = DFLT_THREAD_PRI;
 
     /** Metrics update messages issuing frequency. */
-    protected long metricsUpdateFreq = DFLT_METRICS_UPDATE_FREQ;
+    protected long metricsUpdateFreq;
 
     /** Size of topology snapshots history. */
     protected int topHistSize = DFLT_TOP_HISTORY_SIZE;


[06/15] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0


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

Branch: refs/heads/ignite-5072-merge
Commit: 9f5f57af8c2a5b575ddce716e17b431d7f63242a
Parents: 34f9290 f9a2e02
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 12:29:03 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 12:29:03 2017 +0300

----------------------------------------------------------------------
 modules/rocketmq/licenses/apache-2.0.txt | 202 ++++++++++++++++++++++++++
 1 file changed, 202 insertions(+)
----------------------------------------------------------------------



[15/15] ignite git commit: Merge branch 'ignite-2.0' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-5072-merge

Posted by ag...@apache.org.
Merge branch 'ignite-2.0' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-5072-merge


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

Branch: refs/heads/ignite-5072-merge
Commit: 588ddcb8f2fd0ddc6647c12cb55239e9254d9653
Parents: fe50d76 7bfff3b
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 27 15:57:30 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 27 15:57:30 2017 +0300

----------------------------------------------------------------------
 .../client/memcache/MemcacheRestExample.java    |   2 +-
 .../MemcacheRestExampleNodeStartup.java         |   1 +
 .../client/ClientDefaultCacheSelfTest.java      |   4 +-
 .../JettyRestProcessorAbstractSelfTest.java     | 143 +++++++------
 .../processors/cache/GridCacheProcessor.java    |   6 +-
 .../evict/PageAbstractEvictionTracker.java      |   3 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   8 +-
 modules/core/src/test/config/igfs-loopback.xml  |  18 --
 modules/core/src/test/config/igfs-shmem.xml     |  18 --
 .../IgniteClientReconnectCacheTest.java         |  12 +-
 .../paged/PageEvictionAbstractTest.java         |  13 +-
 ...LruNearEnabledPageEvictionMultinodeTest.java |  28 +++
 ...LruNearEnabledPageEvictionMultinodeTest.java |  28 +++
 ...DeadlockDetectionMessageMarshallingTest.java |   2 +-
 .../testframework/junits/GridAbstractTest.java  |   6 +-
 .../IgniteCacheEvictionSelfTestSuite.java       |   4 +
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   2 +-
 .../http/jetty/GridJettyObjectMapper.java       |  13 +-
 modules/rocketmq/licenses/apache-2.0.txt        | 202 +++++++++++++++++++
 19 files changed, 366 insertions(+), 147 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/588ddcb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/evict/PageAbstractEvictionTracker.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/588ddcb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
----------------------------------------------------------------------


[10/15] ignite git commit: IGNITE-5094 - Fix data page eviction for near-enabled caches

Posted by ag...@apache.org.
IGNITE-5094 - Fix data page eviction for near-enabled caches


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

Branch: refs/heads/ignite-5072-merge
Commit: c58b8a3211f84a1ec1663ba4ed3fae79c432f23e
Parents: c294b27
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 27 12:37:43 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 27 12:38:07 2017 +0300

----------------------------------------------------------------------
 .../evict/PageAbstractEvictionTracker.java      |  7 ++---
 .../paged/PageEvictionAbstractTest.java         | 13 ++++++++-
 ...LruNearEnabledPageEvictionMultinodeTest.java | 28 ++++++++++++++++++++
 ...LruNearEnabledPageEvictionMultinodeTest.java | 28 ++++++++++++++++++++
 .../IgniteCacheEvictionSelfTestSuite.java       |  4 +++
 5 files changed, 76 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c58b8a32/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/evict/PageAbstractEvictionTracker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/evict/PageAbstractEvictionTracker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/evict/PageAbstractEvictionTracker.java
index 88de545..61f62fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/evict/PageAbstractEvictionTracker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/evict/PageAbstractEvictionTracker.java
@@ -39,13 +39,13 @@ public abstract class PageAbstractEvictionTracker implements PageEvictionTracker
     private static final int COMPACT_TS_SHIFT = 8; // Enough if grid works for less than 17 years.
 
     /** Millis in day. */
-    private final static int DAY = 24 * 60 * 60 * 1000;
+    private static final int DAY = 24 * 60 * 60 * 1000;
 
     /** Page memory. */
     protected final PageMemory pageMem;
 
     /** Tracking array size. */
-    final int trackingSize;
+    protected final int trackingSize;
 
     /** Base compact timestamp. */
     private final long baseCompactTs;
@@ -161,7 +161,8 @@ public abstract class PageAbstractEvictionTracker implements PageEvictionTracker
             if (!cacheCtx.userCache())
                 continue;
 
-            GridCacheEntryEx entryEx = cacheCtx.cache().entryEx(dataRow.key());
+            GridCacheEntryEx entryEx = cacheCtx.isNear() ? cacheCtx.near().dht().entryEx(dataRow.key()) :
+                cacheCtx.cache().entryEx(dataRow.key());
 
             evictionDone |= entryEx.evictInternal(GridCacheVersionManager.EVICT_VER, null, true);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c58b8a32/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
index 3aee941..39927be 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionAbstractTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.configuration.DataPageEvictionMode;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.MemoryConfiguration;
 import org.apache.ignite.configuration.MemoryPolicyConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -70,6 +71,13 @@ public class PageEvictionAbstractTest extends GridCommonAbstractTest {
         return configuration;
     }
 
+    /**
+     * @return Near enabled flag.
+     */
+    protected boolean nearEnabled() {
+        return false;
+    }
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -102,7 +110,7 @@ public class PageEvictionAbstractTest extends GridCommonAbstractTest {
      * @param memoryPlcName Memory policy name.
      * @return Cache configuration.
      */
-    protected static CacheConfiguration<Object, Object> cacheConfig(
+    protected CacheConfiguration<Object, Object> cacheConfig(
         @NotNull String name,
         String memoryPlcName,
         CacheMode cacheMode,
@@ -120,6 +128,9 @@ public class PageEvictionAbstractTest extends GridCommonAbstractTest {
         if (cacheMode == CacheMode.PARTITIONED)
             cacheConfiguration.setBackups(1);
 
+        if (nearEnabled())
+            cacheConfiguration.setNearConfiguration(new NearCacheConfiguration<>());
+
         return cacheConfiguration;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c58b8a32/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/Random2LruNearEnabledPageEvictionMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/Random2LruNearEnabledPageEvictionMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/Random2LruNearEnabledPageEvictionMultinodeTest.java
new file mode 100644
index 0000000..252fc5b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/Random2LruNearEnabledPageEvictionMultinodeTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.internal.processors.cache.eviction.paged;
+
+/**
+ *
+ */
+public class Random2LruNearEnabledPageEvictionMultinodeTest extends Random2LruPageEvictionMultinodeTest {
+    /** {@inheritDoc} */
+    @Override protected boolean nearEnabled() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c58b8a32/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/RandomLruNearEnabledPageEvictionMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/RandomLruNearEnabledPageEvictionMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/RandomLruNearEnabledPageEvictionMultinodeTest.java
new file mode 100644
index 0000000..c9ee647
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/RandomLruNearEnabledPageEvictionMultinodeTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.internal.processors.cache.eviction.paged;
+
+/**
+ *
+ */
+public class RandomLruNearEnabledPageEvictionMultinodeTest extends RandomLruPageEvictionMultinodeTest {
+    /** {@inheritDoc} */
+    @Override protected boolean nearEnabled() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c58b8a32/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 1bdfdd1..9f03c60 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
@@ -35,8 +35,10 @@ import org.apache.ignite.internal.processors.cache.eviction.lru.LruNearEvictionP
 import org.apache.ignite.internal.processors.cache.eviction.lru.LruNearOnlyNearEvictionPolicySelfTest;
 import org.apache.ignite.internal.processors.cache.eviction.paged.PageEvictionReadThroughTest;
 import org.apache.ignite.internal.processors.cache.eviction.paged.PageEvictionTouchOrderTest;
+import org.apache.ignite.internal.processors.cache.eviction.paged.Random2LruNearEnabledPageEvictionMultinodeTest;
 import org.apache.ignite.internal.processors.cache.eviction.paged.Random2LruPageEvictionMultinodeTest;
 import org.apache.ignite.internal.processors.cache.eviction.paged.Random2LruPageEvictionWithRebalanceTest;
+import org.apache.ignite.internal.processors.cache.eviction.paged.RandomLruNearEnabledPageEvictionMultinodeTest;
 import org.apache.ignite.internal.processors.cache.eviction.paged.RandomLruPageEvictionMultinodeTest;
 import org.apache.ignite.internal.processors.cache.eviction.paged.RandomLruPageEvictionWithRebalanceTest;
 import org.apache.ignite.internal.processors.cache.eviction.sorted.SortedEvictionPolicySelfTest;
@@ -70,7 +72,9 @@ public class IgniteCacheEvictionSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCacheEvictableEntryEqualsSelfTest.class));
 
         suite.addTest(new TestSuite(RandomLruPageEvictionMultinodeTest.class));
+        suite.addTest(new TestSuite(RandomLruNearEnabledPageEvictionMultinodeTest.class));
         suite.addTest(new TestSuite(Random2LruPageEvictionMultinodeTest.class));
+        suite.addTest(new TestSuite(Random2LruNearEnabledPageEvictionMultinodeTest.class));
         suite.addTest(new TestSuite(RandomLruPageEvictionWithRebalanceTest.class));
         suite.addTest(new TestSuite(Random2LruPageEvictionWithRebalanceTest.class));
         suite.addTest(new TestSuite(PageEvictionTouchOrderTest.class));


[03/15] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0


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

Branch: refs/heads/ignite-5072-merge
Commit: 64656d17a531690b6ac6bf04fd0f55db11d72bb4
Parents: ff13240 6ccfc0b
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 11:45:25 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 11:45:25 2017 +0300

----------------------------------------------------------------------
 .../client/ClientDefaultCacheSelfTest.java      |   4 +-
 .../JettyRestProcessorAbstractSelfTest.java     | 143 +++++++++----------
 .../http/jetty/GridJettyObjectMapper.java       |  13 +-
 3 files changed, 74 insertions(+), 86 deletions(-)
----------------------------------------------------------------------



[12/15] ignite git commit: Fixed failure in TxDeadlockDetectionMessageMarshallingTest.

Posted by ag...@apache.org.
Fixed failure in TxDeadlockDetectionMessageMarshallingTest.


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

Branch: refs/heads/ignite-5072-merge
Commit: 24bb2328bca08238c917bf87ee9a9053e32ef328
Parents: 8dc3a4c
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 15:39:32 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 15:39:32 2017 +0300

----------------------------------------------------------------------
 .../transactions/TxDeadlockDetectionMessageMarshallingTest.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/24bb2328/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetectionMessageMarshallingTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetectionMessageMarshallingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetectionMessageMarshallingTest.java
index dd7c3b3..9126053 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetectionMessageMarshallingTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetectionMessageMarshallingTest.java
@@ -61,7 +61,7 @@ public class TxDeadlockDetectionMessageMarshallingTest extends GridCommonAbstrac
         try {
             Ignite ignite = startGrid(0);
 
-            CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>();
+            CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
 
             IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(ccfg);
 


[05/15] ignite git commit: Fixed IGFS test causing overtimes.

Posted by ag...@apache.org.
Fixed IGFS test causing overtimes.


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

Branch: refs/heads/ignite-5072-merge
Commit: 34f92907779bedaaf38a1842c87b0922787ae159
Parents: 64656d1
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 12:28:40 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 12:28:40 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/34f92907/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index b16f7e9..a2519fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -98,7 +98,7 @@ public class IgniteIgfsTestSuite extends TestSuite {
         suite.addTest(new TestSuite(IgfsLocalSecondaryFileSystemDualSyncClientSelfTest.class));
         suite.addTest(new TestSuite(IgfsLocalSecondaryFileSystemDualAsyncClientSelfTest.class));
 
-        suite.addTest(new TestSuite(IgfsSizeSelfTest.class));
+        //suite.addTest(new TestSuite(IgfsSizeSelfTest.class));
         suite.addTest(new TestSuite(IgfsAttributesSelfTest.class));
         suite.addTest(new TestSuite(IgfsFileInfoSelfTest.class));
         suite.addTest(new TestSuite(IgfsMetaManagerSelfTest.class));


[13/15] ignite git commit: Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0

Posted by ag...@apache.org.
Merge remote-tracking branch 'origin/ignite-2.0' into ignite-2.0


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

Branch: refs/heads/ignite-5072-merge
Commit: c219ff06fe4ba4171544a52713e31f1bb8c67e20
Parents: 24bb232 44e0de6
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 15:39:57 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 15:39:57 2017 +0300

----------------------------------------------------------------------
 .../evict/PageAbstractEvictionTracker.java      |  7 ++---
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  8 +-----
 .../paged/PageEvictionAbstractTest.java         | 13 ++++++++-
 ...LruNearEnabledPageEvictionMultinodeTest.java | 28 ++++++++++++++++++++
 ...LruNearEnabledPageEvictionMultinodeTest.java | 28 ++++++++++++++++++++
 .../testframework/junits/GridAbstractTest.java  |  6 ++---
 .../IgniteCacheEvictionSelfTestSuite.java       |  4 +++
 7 files changed, 80 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[14/15] ignite git commit: Fixed IgniteClientReconnectCacheTest.

Posted by ag...@apache.org.
Fixed IgniteClientReconnectCacheTest.


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

Branch: refs/heads/ignite-5072-merge
Commit: 7bfff3b89bddb6ae19bc6b045198baa0fab33154
Parents: c219ff0
Author: devozerov <vo...@gridgain.com>
Authored: Thu Apr 27 15:49:51 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Apr 27 15:49:51 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/IgniteClientReconnectCacheTest.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7bfff3b8/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
index 264a837..7cafa93 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
@@ -257,7 +257,7 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
 
         assertTrue(reconnectLatch.await(5000, MILLISECONDS));
 
-        checkCacheDiscoveryData(srv, client, null, true, true, false);
+        checkCacheDiscoveryData(srv, client, DEFAULT_CACHE_NAME, true, true, false);
 
         checkCacheDiscoveryData(srv, client, "nearCache", true, true, true);
 
@@ -295,7 +295,7 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
 
         assertEquals(4, cache.get(key));
 
-        checkCacheDiscoveryData(srv2, client, null, true, true, false);
+        checkCacheDiscoveryData(srv2, client, DEFAULT_CACHE_NAME, true, true, false);
 
         checkCacheDiscoveryData(srv2, client, "nearCache", true, true, true);
 
@@ -843,11 +843,11 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
             }
         }, IllegalStateException.class, null);
 
-        checkCacheDiscoveryData(srv, client, null, false, false, false);
+        checkCacheDiscoveryData(srv, client, DEFAULT_CACHE_NAME, false, false, false);
 
         IgniteCache<Object, Object> clientCache0 = client.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME));
 
-        checkCacheDiscoveryData(srv, client, null, true, true, false);
+        checkCacheDiscoveryData(srv, client, DEFAULT_CACHE_NAME, true, true, false);
 
         clientCache0.put(1, 1);
 
@@ -889,11 +889,11 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
             }
         }, IllegalStateException.class, null);
 
-        checkCacheDiscoveryData(srv, client, null, true, false, false);
+        checkCacheDiscoveryData(srv, client, DEFAULT_CACHE_NAME, true, false, false);
 
         IgniteCache<Object, Object> clientCache0 = client.cache(DEFAULT_CACHE_NAME);
 
-        checkCacheDiscoveryData(srv, client, null, true, true, false);
+        checkCacheDiscoveryData(srv, client, DEFAULT_CACHE_NAME, true, true, false);
 
         assertEquals(TRANSACTIONAL,
             clientCache0.getConfiguration(CacheConfiguration.class).getAtomicityMode());