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 2017/05/17 16:03:24 UTC

[1/9] ignite git commit: Web Console: bind to all interfaces in dev mode.

Repository: ignite
Updated Branches:
  refs/heads/ignite-5075-cacheStart ace34f2f6 -> 194446dd8


Web Console: bind to all interfaces in dev mode.


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: c4b7f401b410a5dbd051d42abaf5fca4bc394cc3
Parents: 7a4a194
Author: Andrey Novikov <an...@gridgain.com>
Authored: Wed May 17 15:51:16 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Wed May 17 15:51:16 2017 +0700

----------------------------------------------------------------------
 modules/web-console/frontend/gulpfile.babel.js/tasks/bundle.js  | 2 +-
 .../gulpfile.babel.js/webpack/environments/development.js       | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c4b7f401/modules/web-console/frontend/gulpfile.babel.js/tasks/bundle.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/gulpfile.babel.js/tasks/bundle.js b/modules/web-console/frontend/gulpfile.babel.js/tasks/bundle.js
index 07244b9..d42a711 100644
--- a/modules/web-console/frontend/gulpfile.babel.js/tasks/bundle.js
+++ b/modules/web-console/frontend/gulpfile.babel.js/tasks/bundle.js
@@ -28,7 +28,7 @@ gulp.task('bundle', (cb) => {
     if (process.env.NODE_ENV === 'development') {
         // Important! Call webpack and WebpackDevServer must be inline.
         new WebpackDevServer(webpack(webpackConfig), devServerConfig)
-            .listen(devServerConfig.port, devServerConfig.host || 'localhost', cb);
+            .listen(devServerConfig.port, devServerConfig.host, cb);
     }
     else
         webpack(webpackConfig, cb);

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4b7f401/modules/web-console/frontend/gulpfile.babel.js/webpack/environments/development.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/gulpfile.babel.js/webpack/environments/development.js b/modules/web-console/frontend/gulpfile.babel.js/webpack/environments/development.js
index 87094a8..28ecc13 100644
--- a/modules/web-console/frontend/gulpfile.babel.js/webpack/environments/development.js
+++ b/modules/web-console/frontend/gulpfile.babel.js/webpack/environments/development.js
@@ -19,7 +19,7 @@ import {destDir} from '../../paths';
 
 const backendPort = 3000;
 const devServerPort = process.env.PORT || 9000;
-const devServerHost = process.env.HOST;
+const devServerHost = process.env.HOST || '0.0.0.0';
 
 export default {
     devtool: 'source-map',
@@ -33,17 +33,14 @@ export default {
         proxy: {
             '/socket.io': {
                 target: `http://localhost:${backendPort}`,
-                changeOrigin: true,
                 ws: true
             },
             '/agents': {
                 target: `http://localhost:${backendPort}`,
-                changeOrigin: true,
                 ws: true
             },
             '/api/v1/*': {
                 target: `http://localhost:${backendPort}`,
-                changeOrigin: true,
                 pathRewrite: {
                     '^/api/v1': ''
                 }


[3/9] ignite git commit: IGNITE-5208: Fixed sigfault on concurrent map access

Posted by sb...@apache.org.
IGNITE-5208: Fixed sigfault on concurrent map access


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: 821446317086102ab1f11633864f8d9c08c3bcba
Parents: e1f3e4a
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed May 17 12:38:20 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed May 17 12:38:20 2017 +0300

----------------------------------------------------------------------
 .../ignite/impl/binary/binary_type_manager.h    |  6 +-
 .../src/impl/binary/binary_type_manager.cpp     | 83 +++++++++-----------
 2 files changed, 41 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/82144631/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
index 01538b8..dc147fa 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
@@ -52,7 +52,7 @@ namespace ignite
                  * @param typeName Type name.
                  * @param typeId Type ID.
                  */
-                ignite::common::concurrent::SharedPointer<BinaryTypeHandler> GetHandler(const std::string& typeName, int32_t typeId);
+                common::concurrent::SharedPointer<BinaryTypeHandler> GetHandler(const std::string& typeName, int32_t typeId);
 
                 /**
                  * Submit handler for processing.
@@ -104,13 +104,13 @@ namespace ignite
 
             private:
                 /** Current snapshots. */
-                ignite::common::concurrent::SharedPointer<std::map<int32_t, SPSnap> > snapshots;
+                std::map<int32_t, SPSnap>* snapshots;
 
                 /** Pending snapshots. */
                 std::vector<SPSnap>* pending;
 
                 /** Critical section. */
-                ignite::common::concurrent::CriticalSection cs;
+                common::concurrent::CriticalSection cs;
 
                 /** Type updater */
                 BinaryTypeUpdater* updater;

http://git-wip-us.apache.org/repos/asf/ignite/blob/82144631/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp b/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
index 4a8c14c..98d4602 100644
--- a/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
+++ b/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
@@ -41,20 +41,17 @@ namespace ignite
 
             BinaryTypeManager::~BinaryTypeManager()
             {
-                pending->erase(pending->begin(), pending->end());
-
+                delete snapshots;
                 delete pending;
             }
 
             SharedPointer<BinaryTypeHandler> BinaryTypeManager::GetHandler(const std::string& typeName, int32_t typeId)
             {
-                std::map<int32_t, SPSnap>& snapshots0 = *snapshots.Get();
-
                 { // Locking scope.
                     CsLockGuard guard(cs);
 
-                    std::map<int32_t, SPSnap>::iterator it = snapshots0.find(typeId);
-                    if (it != snapshots0.end())
+                    std::map<int32_t, SPSnap>::iterator it = snapshots->find(typeId);
+                    if (it != snapshots->end())
                         return SharedPointer<BinaryTypeHandler>(new BinaryTypeHandler(it->second));
                 }
 
@@ -65,7 +62,7 @@ namespace ignite
 
             void BinaryTypeManager::SubmitHandler(BinaryTypeHandler& hnd)
             {
-                // If this is the very first write of a class or difference exists, 
+                // If this is the very first write of a class or difference exists,
                 // we need to enqueue it for write.
                 if (hnd.HasUpdate())
                 {
@@ -102,45 +99,30 @@ namespace ignite
                 {
                     Snap* pendingSnap = it->Get();
 
+                    if (!pendingSnap)
+                        continue; // Snapshot has been processed already.
+
                     if (!updater->Update(*pendingSnap, err))
                         return false; // Stop as we cannot move further.
 
-                    // Perform copy-on-write update of snapshot collection.
-                    SharedPointer< std::map<int32_t, SPSnap> > newSnapshots(new std::map<int32_t, SPSnap>());
-                    std::map<int32_t, SPSnap>& newSnapshots0 = *newSnapshots.Get();
+                    std::map<int32_t, SPSnap>::iterator elem = snapshots->lower_bound(pendingSnap->GetTypeId());
 
-                    bool snapshotFound = false;
-
-                    for (std::map<int32_t, SPSnap>::iterator snapIt = snapshots.Get()->begin();
-                        snapIt != snapshots.Get()->end(); ++snapIt)
+                    if (elem == snapshots->end() || elem->first != pendingSnap->GetTypeId())
+                        snapshots->insert(elem, std::make_pair(pendingSnap->GetTypeId(), *it));
+                    else
                     {
-                        int32_t curTypeId = snapIt->first;
-                        Snap* curSnap = snapIt->second.Get();
-
-                        if (pendingSnap->GetTypeId() != curTypeId)
-                        {
-                            // Just transfer exising snapshot.
-                            newSnapshots0[curTypeId] = snapIt->second;
+                        // Temporary snapshot.
+                        SPSnap tmp;
 
-                            continue;
-                        }
+                        // Move all values from pending update.
+                        tmp.Swap(*it);
 
-                        // Create new snapshot.
-                        SPSnap newSnap(new Snap(*pendingSnap));
+                        // Add old fields. Only non-existing values added.
+                        tmp.Get()->CopyFieldsFrom(elem->second.Get());
 
-                        // Add old fields.
-                        newSnap.Get()->CopyFieldsFrom(curSnap);
-
-                        newSnapshots0[curTypeId].Swap(newSnap);
-
-                        snapshotFound = true;
+                        // Move to snapshots storage.
+                        tmp.Swap(elem->second);
                     }
-
-                    // Handle situation when completely new snapshot is found.
-                    if (!snapshotFound)
-                        newSnapshots0[pendingSnap->GetTypeId()] = *it;
-
-                    snapshots.Swap(newSnapshots);
                 }
 
                 pending->clear();
@@ -152,17 +134,21 @@ namespace ignite
 
             SPSnap BinaryTypeManager::GetMeta(int32_t typeId)
             {
-                std::map<int32_t, SPSnap>::iterator it = snapshots.Get()->find(typeId);
+                { // Locking scope.
+                    CsLockGuard guard(cs);
 
-                if (it != snapshots.Get()->end() && it->second.Get())
-                    return it->second;
+                    std::map<int32_t, SPSnap>::iterator it = snapshots->find(typeId);
 
-                for (int32_t i = 0; i < pending->size(); ++i)
-                {
-                    SPSnap& snap = (*pending)[i];
+                    if (it != snapshots->end() && it->second.Get())
+                        return it->second;
 
-                    if (snap.Get()->GetTypeId() == typeId)
-                        return snap;
+                    for (int32_t i = 0; i < pending->size(); ++i)
+                    {
+                        SPSnap& snap = (*pending)[i];
+
+                        if (snap.Get()->GetTypeId() == typeId)
+                            return snap;
+                    }
                 }
 
                 IgniteError err;
@@ -171,6 +157,13 @@ namespace ignite
 
                 IgniteError::ThrowIfNeeded(err);
 
+                // Caching meta snapshot for faster access in future.
+                { // Locking scope.
+                    CsLockGuard guard(cs);
+
+                    snapshots->insert(std::make_pair(typeId, snap));
+                }
+
                 return snap;
             }
         }


[5/9] ignite git commit: IGNITE-4597: CPP: Add methods to reset arguments in sql query.

Posted by sb...@apache.org.
IGNITE-4597: CPP: Add methods to reset arguments in sql query.


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: 03ed3813c51d06653a88162e8822468a66f462ba
Parents: ccaed07
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed May 17 13:15:06 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed May 17 13:33:40 2017 +0300

----------------------------------------------------------------------
 .../cpp/core-test/src/cache_query_test.cpp      | 22 ++++++++++++++++++++
 .../core/include/ignite/cache/query/query_sql.h |  8 +++++++
 .../ignite/cache/query/query_sql_fields.h       | 10 ++++++++-
 .../query-example/src/query_example.cpp         |  6 +++---
 4 files changed, 42 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/03ed3813/modules/platforms/cpp/core-test/src/cache_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_query_test.cpp b/modules/platforms/cpp/core-test/src/cache_query_test.cpp
index e9c4610..65dcda5 100644
--- a/modules/platforms/cpp/core-test/src/cache_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_query_test.cpp
@@ -871,6 +871,20 @@ BOOST_AUTO_TEST_CASE(TestSqlQuery)
     cursor = cache.Query(qry);
     CheckSingleGetAllIter(cursor, 1, "A1", 10);
 
+    // Test resetting query arguments.
+    qry.ClearArguments();
+    qry.AddArgument<int>(30);
+    qry.AddArgument<std::string>("A2");
+
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 2, "A2", 20);
+
+    cursor = cache.Query(qry);
+    CheckSingleGetAll(cursor, 2, "A2", 20);
+
+    cursor = cache.Query(qry);
+    CheckSingleGetAllIter(cursor, 2, "A2", 20);
+
     // Test query returning multiple entries.
     qry = SqlQuery("QueryPerson", "age < 30");
 
@@ -1150,6 +1164,14 @@ BOOST_AUTO_TEST_CASE(TestSqlFieldsQueryBasic)
 
     cursor = cache.Query(qry);
     CheckSingle(cursor, 1, "A1", 10);
+
+    // Test resetting query arguments.
+    qry.ClearArguments();
+    qry.AddArgument<int>(30);
+    qry.AddArgument<std::string>("A2");
+
+    cursor = cache.Query(qry);
+    CheckSingle(cursor, 2, "A2", 20);
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/03ed3813/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
index 289d70a..d733476 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
@@ -245,6 +245,14 @@ namespace ignite
                 }
 
                 /**
+                 * Remove all added arguments.
+                 */
+                void ClearArguments()
+                {
+                    args.clear();
+                }
+
+                /**
                  * Write query info to the stream.
                  *
                  * @param writer Writer.

http://git-wip-us.apache.org/repos/asf/ignite/blob/03ed3813/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
index 7c09d85..954cf43 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
@@ -268,6 +268,14 @@ namespace ignite
                 }
 
                 /**
+                 * Remove all added arguments.
+                 */
+                void ClearArguments()
+                {
+                    args.clear();
+                }
+
+                /**
                  * Write query info to the stream.
                  *
                  * @param writer Writer.
@@ -312,4 +320,4 @@ namespace ignite
     }    
 }
 
-#endif //_IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS
\ No newline at end of file
+#endif //_IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS

http://git-wip-us.apache.org/repos/asf/ignite/blob/03ed3813/modules/platforms/cpp/examples/query-example/src/query_example.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/query-example/src/query_example.cpp b/modules/platforms/cpp/examples/query-example/src/query_example.cpp
index 9524100..db7437e 100644
--- a/modules/platforms/cpp/examples/query-example/src/query_example.cpp
+++ b/modules/platforms/cpp/examples/query-example/src/query_example.cpp
@@ -77,7 +77,7 @@ void DoSqlQueryWithDistributedJoin()
 
     std::cout << std::endl;
 
-    qry = SqlQuery("Person", joinSql);
+    qry.ClearArguments();
 
     qry.AddArgument<std::string>("Other");
 
@@ -258,7 +258,7 @@ void DoSqlQueryWithJoin()
 
     std::cout << "Following people are 'Other' employees: " << std::endl;
 
-    qry = SqlQuery(PERSON_TYPE, sql);
+    qry.ClearArguments();
 
     qry.AddArgument<std::string>("Other");
 
@@ -302,7 +302,7 @@ void DoSqlQuery()
 
     std::cout << std::endl;
 
-    qry = SqlQuery(PERSON_TYPE, sql);
+    qry.ClearArguments();
 
     // Execute queries for salary range 1000 - 2000.
     std::cout << "People with salaries between 1000 and 2000 (queried with SQL query): " << std::endl;


[7/9] ignite git commit: Results printout for IO latency test

Posted by sb...@apache.org.
Results printout for IO latency test


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: a0fc6ee6018007ed9b358b1766e4998cd0a1e9d2
Parents: 958b08f
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed May 17 16:36:27 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed May 17 16:36:27 2017 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoManager.java   | 68 +++++++++++++++-----
 1 file changed, 52 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a0fc6ee6/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index fc94667..800f3cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -524,7 +524,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                             Thread.sleep(sleepDuration);
                         }
 
-                        // At this point all threads have finished the test and stored data to the result map.
+                        // At this point all threads have finished the test and
+                        // stored data to the resulting array of maps.
+                        // Need to iterate it over and sum values for all threads.
                         Map<UUID, long[]> res0 = new HashMap<>();
 
                         for (Map<UUID, long[]> r : res) {
@@ -540,21 +542,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
                             }
                         }
 
-                        StringBuilder b = new StringBuilder("IO test results " +
-                            "[range=" + (maxLatency / (1000 * rangesCnt)) + "mcs]");
-
-                        b.append(U.nl());
-
-                        for (Entry<UUID, long[]> e : res0.entrySet()) {
-                            ClusterNode node = ctx.discovery().node(e.getKey());
-
-                            b.append("    ").append(e.getKey()).append(" (addrs=")
-                                .append(node != null ? node.addresses().toString() : "n/a").append(')')
-                                .append(Arrays.toString(e.getValue())).append(U.nl());
-                        }
-
-                        if (log.isInfoEnabled())
-                            log.info(b.toString());
+                        printIoTestResults(maxLatency / (1000 * rangesCnt), res0);
                     }
                     catch (InterruptedException | BrokenBarrierException e) {
                         U.error(log, "IO test failed.", e);
@@ -637,6 +625,54 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         }
     }
 
+    /**
+     * @param binLatencyMcs Bin latency in microseconds.
+     * @param res Resulting map.
+     */
+    private void printIoTestResults(long binLatencyMcs, Map<UUID, long[]> res) {
+        StringBuilder b = new StringBuilder(U.nl())
+            .append("IO test results (round-trip count per each latency bin) " +
+                "[binLatency=" + binLatencyMcs + "mcs]")
+            .append(U.nl());
+
+        for (Entry<UUID, long[]> e : res.entrySet()) {
+            ClusterNode node = ctx.discovery().node(e.getKey());
+
+            b.append("Node ID: ").append(e.getKey()).append(" (addrs=")
+                .append(node != null ? node.addresses().toString() : "n/a").append(')').append(U.nl());
+
+            b.append("Latency bin, mcs | Count exclusive | Percentage exclusive | " +
+                "Count inclusive | Percentage inclusive ").append(U.nl());
+
+            long[] nodeRes = e.getValue();
+
+            long sum = 0;
+
+            for (int i = 0; i < nodeRes.length; i++)
+                sum += nodeRes[i];
+
+            long curSum = 0;
+
+            for (int i = 0; i < nodeRes.length; i++) {
+                curSum += nodeRes[i];
+
+                if (i < nodeRes.length - 1)
+                    b.append(String.format("<%11d mcs | %15d | %19.6f%% | %15d | %19.6f%%\n",
+                        (i + 1) * binLatencyMcs,
+                        nodeRes[i], (100.0 * nodeRes[i]) / sum,
+                        curSum, (100.0 * curSum) / sum));
+                else
+                    b.append(String.format(">%11d mcs | %15d | %19.6f%% | %15d | %19.6f%%\n",
+                        i * binLatencyMcs,
+                        nodeRes[i], (100.0 * nodeRes[i]) / sum,
+                        curSum, (100.0 * curSum) / sum));
+            }
+        }
+
+        if (log.isInfoEnabled())
+            log.info(b.toString());
+    }
+
     /** {@inheritDoc} */
     @SuppressWarnings({"deprecation", "SynchronizationOnLocalVariableOrMethodParameter"})
     @Override public void onKernalStart0() throws IgniteCheckedException {


[6/9] ignite git commit: IGNITE-5050 .NET: IIgnite.GetMemoryMetrics - fix test stability

Posted by sb...@apache.org.
IGNITE-5050 .NET: IIgnite.GetMemoryMetrics - fix test stability


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: 958b08f502290e9ab59b523535554212a74d1cdc
Parents: 03ed381
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed May 17 16:11:25 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed May 17 16:11:25 2017 +0300

----------------------------------------------------------------------
 .../Cache/MemoryMetricsTest.cs                        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/958b08f5/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/MemoryMetricsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/MemoryMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/MemoryMetricsTest.cs
index 07b596a..0aba377 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/MemoryMetricsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/MemoryMetricsTest.cs
@@ -42,12 +42,12 @@ namespace Apache.Ignite.Core.Tests.Cache
             var ignite = StartIgniteWithTwoPolicies();
 
             // Verify metrics.
-            var metrics = ignite.GetMemoryMetrics().ToArray();
+            var metrics = ignite.GetMemoryMetrics().OrderBy(x => x.Name).ToArray();
             Assert.AreEqual(3, metrics.Length);  // two defined plus system.
 
-            var sysMetrics = metrics[0];
-            Assert.AreEqual("sysMemPlc", sysMetrics.Name);
-            AssertMetricsAreEmpty(sysMetrics);
+            var emptyMetrics = metrics[0];
+            Assert.AreEqual(MemoryPolicyNoMetrics, emptyMetrics.Name);
+            AssertMetricsAreEmpty(emptyMetrics);
 
             var memMetrics = metrics[1];
             Assert.AreEqual(MemoryPolicyWithMetrics, memMetrics.Name);
@@ -57,9 +57,9 @@ namespace Apache.Ignite.Core.Tests.Cache
             Assert.Greater(memMetrics.PageFillFactor, 0);
             Assert.Greater(memMetrics.TotalAllocatedPages, 1000);
 
-            var emptyMetrics = metrics[2];
-            Assert.AreEqual(MemoryPolicyNoMetrics, emptyMetrics.Name);
-            AssertMetricsAreEmpty(emptyMetrics);
+            var sysMetrics = metrics[2];
+            Assert.AreEqual("sysMemPlc", sysMetrics.Name);
+            AssertMetricsAreEmpty(sysMetrics);
         }
 
         /// <summary>


[9/9] ignite git commit: ignite-5075

Posted by sb...@apache.org.
ignite-5075


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: 194446dd87b454eea501c042909b58bc9be2eb72
Parents: 11fc7ca
Author: sboikov <sb...@gridgain.com>
Authored: Wed May 17 19:03:13 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed May 17 19:03:13 2017 +0300

----------------------------------------------------------------------
 .../cache/CacheAffinitySharedManager.java       | 60 ++++++++++----------
 .../CacheClientReconnectDiscoveryData.java      | 11 ++--
 .../processors/cache/ClusterCachesInfo.java     | 37 ++++++------
 .../cache/DynamicCacheDescriptor.java           | 12 ++--
 .../processors/cache/ExchangeActions.java       | 25 +++++---
 .../processors/cache/GridCacheProcessor.java    | 23 ++++----
 .../CacheDiscoveryDataConcurrentJoinTest.java   | 13 ++---
 .../testsuites/IgniteCacheTestSuite4.java       | 16 +++++-
 8 files changed, 110 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index cdc83ec..f53ff07 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -49,7 +49,6 @@ import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.lang.IgniteInClosureX;
 import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiInClosure;
@@ -323,31 +322,29 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
      * @param exchActions Cache change requests to execute on exchange.
      */
     private void updateCachesInfo(ExchangeActions exchActions) {
-        for (ExchangeActions.ActionData action : exchActions.stopRequests()) {
+        for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) {
             DynamicCacheDescriptor desc = registeredCaches.remove(action.descriptor().cacheId());
 
             assert desc != null : action.request().cacheName();
         }
 
-        for (ExchangeActions.ActionData action : exchActions.newAndClientCachesStartRequests()) {
+        for (ExchangeActions.ActionData action : exchActions.cacheStartRequests()) {
             DynamicCacheChangeRequest req = action.request();
 
-            if (!req.clientStartOnly()) {
-                Integer cacheId = CU.cacheId(req.cacheName());
+            Integer cacheId = action.descriptor().cacheId();
 
-                DynamicCacheDescriptor desc = new DynamicCacheDescriptor(cctx.kernalContext(),
-                    req.startCacheConfiguration(),
-                    req.cacheType(),
-                    false,
-                    action.descriptor().receivedFrom(),
-                    action.descriptor().staticallyConfigured(),
-                    req.deploymentId(),
-                    req.schema());
+            DynamicCacheDescriptor desc = new DynamicCacheDescriptor(cctx.kernalContext(),
+                req.startCacheConfiguration(),
+                req.cacheType(),
+                false,
+                action.descriptor().receivedFrom(),
+                action.descriptor().staticallyConfigured(),
+                req.deploymentId(),
+                req.schema());
 
-                DynamicCacheDescriptor old = registeredCaches.put(cacheId, desc);
+            DynamicCacheDescriptor old = registeredCaches.put(cacheId, desc);
 
-                assert old == null : old;
-            }
+            assert old == null : old;
         }
     }
 
@@ -417,6 +414,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                     if (clientCacheStarted)
                         initAffinity(cacheDesc, cacheCtx.affinity().affinityCache(), fut, lateAffAssign);
                     else if (!req.clientStartOnly()) {
+                        assert fut.topologyVersion().equals(cacheCtx.startTopologyVersion());
+
                         GridAffinityAssignmentCache aff = cacheCtx.affinity().affinityCache();
 
                         assert aff.lastVersion().equals(AffinityTopologyVersion.NONE) : aff.lastVersion();
@@ -458,7 +457,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
 
         Set<Integer> stoppedCaches = null;
 
-        for (ExchangeActions.ActionData action : exchActions.stopRequests()) {
+        for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) {
             DynamicCacheDescriptor desc = action.descriptor();
 
             cctx.cache().blockGateway(action.request());
@@ -689,7 +688,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                 });
             }
             else
-                initCachesAffinity(fut);
+                initAffinityNoLateAssignment(fut);
         }
     }
 
@@ -799,7 +798,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
     }
 
     /**
-     * Initialized affinity started on this exchange.
+     * Initialized affinity for cache received from node joining on this exchange.
      *
      * @param crd Coordinator flag.
      * @param fut Exchange future.
@@ -850,7 +849,9 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
         GridDhtPartitionsExchangeFuture fut,
         boolean fetch)
         throws IgniteCheckedException {
-        if (!fetch && canCalculateAffinity(aff, fut)) {
+        assert desc != null;
+
+        if (!fetch && canCalculateAffinity(desc, aff, fut)) {
             List<List<ClusterNode>> assignment = aff.calculate(fut.topologyVersion(), fut.discoveryEvent(), fut.discoCache());
 
             aff.initialize(fut.topologyVersion(), assignment);
@@ -868,11 +869,16 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
     }
 
     /**
+     * @param desc Cache descriptor.
      * @param aff Affinity.
      * @param fut Exchange future.
      * @return {@code True} if local node can calculate affinity on it's own for this partition map exchange.
      */
-    private boolean canCalculateAffinity(GridAffinityAssignmentCache aff, GridDhtPartitionsExchangeFuture fut) {
+    private boolean canCalculateAffinity(DynamicCacheDescriptor desc,
+        GridAffinityAssignmentCache aff,
+        GridDhtPartitionsExchangeFuture fut) {
+        assert desc != null : aff.cacheName();
+
         // Do not request affinity from remote nodes if affinity function is not centralized.
         if (!aff.centralizedAffinityFunction())
             return true;
@@ -880,11 +886,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
         // If local node did not initiate exchange or local node is the only cache node in grid.
         Collection<ClusterNode> affNodes = cctx.discovery().cacheAffinityNodes(aff.cacheId(), fut.topologyVersion());
 
-        DynamicCacheDescriptor cacheDesc = registeredCaches.get(aff.cacheId());
-
-        assert cacheDesc != null : aff.cacheName();
-
-        return fut.cacheAddedOnExchange(aff.cacheId(), cacheDesc.receivedFrom()) ||
+        return fut.cacheAddedOnExchange(aff.cacheId(), desc.receivedFrom()) ||
             !fut.exchangeId().nodeId().equals(cctx.localNodeId()) ||
             (affNodes.size() == 1 && affNodes.contains(cctx.localNode()));
     }
@@ -925,7 +927,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                 waitRebalanceInfo = initAffinityOnNodeJoin(fut, crd);
         }
         else
-            initCachesAffinity(fut);
+            initAffinityNoLateAssignment(fut);
 
         synchronized (mux) {
             affCalcVer = fut.topologyVersion();
@@ -1069,7 +1071,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
             centralizedAff = true;
         }
         else {
-            initCachesAffinity(fut);
+            initAffinityNoLateAssignment(fut);
 
             centralizedAff = false;
         }
@@ -1087,7 +1089,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
      * @param fut Exchange future.
      * @throws IgniteCheckedException If failed.
      */
-    private void initCachesAffinity(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException {
+    private void initAffinityNoLateAssignment(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException {
         assert !lateAffAssign;
 
         for (GridCacheContext cacheCtx : cctx.cacheContexts()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
index f970469..a30331f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClientReconnectDiscoveryData.java
@@ -17,13 +17,12 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.io.Serializable;
+import java.util.Map;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteUuid;
 
-import java.io.Serializable;
-import java.util.Map;
-
 /**
  * Discovery data sent from client reconnecting to cluster.
  */
@@ -37,7 +36,7 @@ public class CacheClientReconnectDiscoveryData implements Serializable {
     /**
      * @param clientCaches Information about caches started on re-joining client node.
      */
-    public CacheClientReconnectDiscoveryData(Map<String, CacheInfo> clientCaches) {
+    CacheClientReconnectDiscoveryData(Map<String, CacheInfo> clientCaches) {
         this.clientCaches = clientCaches;
     }
 
@@ -77,7 +76,7 @@ public class CacheClientReconnectDiscoveryData implements Serializable {
          * @param nearCache Near cache flag.
          * @param flags Flags (for future usage).
          */
-        public CacheInfo(CacheConfiguration ccfg,
+        CacheInfo(CacheConfiguration ccfg,
             CacheType cacheType,
             IgniteUuid deploymentId,
             boolean nearCache,
@@ -94,7 +93,7 @@ public class CacheClientReconnectDiscoveryData implements Serializable {
         }
 
         /**
-         * @return Cache configuraiton.
+         * @return Cache configuration.
          */
         CacheConfiguration config() {
             return ccfg;

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
index fad03bb..28ec600 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
@@ -17,9 +17,19 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheExistsException;
@@ -36,25 +46,13 @@ import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.spi.discovery.DiscoveryDataBag;
 
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
 import static org.apache.ignite.cache.CacheMode.LOCAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
 import static org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType.CACHE_PROC;
 
 /**
- *
+ * Logic related to cache discovery date processing.
  */
 class ClusterCachesInfo {
     /** */
@@ -129,7 +127,8 @@ class ClusterCachesInfo {
      * @param rmt Remote node.
      * @throws IgniteCheckedException If check failed.
      */
-    private void checkCache(CacheConfiguration locCfg, CacheConfiguration rmtCfg, UUID rmt) throws IgniteCheckedException {
+    private void checkCache(CacheConfiguration<?, ?> locCfg, CacheConfiguration<?, ?> rmtCfg, UUID rmt)
+        throws IgniteCheckedException {
         GridCacheAttributes rmtAttr = new GridCacheAttributes(rmtCfg);
         GridCacheAttributes locAttr = new GridCacheAttributes(locCfg);
 
@@ -277,7 +276,7 @@ class ClusterCachesInfo {
                             "client cache (a cache with the given name is not started): " + req.cacheName()));
                     }
                     else {
-                        CacheConfiguration ccfg = req.startCacheConfiguration();
+                        CacheConfiguration<?, ?> ccfg = req.startCacheConfiguration();
 
                         assert req.cacheType() != null : req;
                         assert F.eq(ccfg.getName(), req.cacheName()) : req;
@@ -630,7 +629,7 @@ class ClusterCachesInfo {
         }
 
         for (CacheData cacheData : cachesData.caches().values()) {
-            CacheConfiguration cfg = cacheData.cacheConfiguration();
+            CacheConfiguration<?, ?> cfg = cacheData.cacheConfiguration();
 
             DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
                 ctx,
@@ -683,7 +682,7 @@ class ClusterCachesInfo {
                 if (firstNode && !joinDiscoData.caches().containsKey(desc.cacheName()))
                     continue;
 
-                CacheConfiguration cfg = desc.cacheConfiguration();
+                CacheConfiguration<?, ?> cfg = desc.cacheConfiguration();
 
                 CacheJoinNodeDiscoveryData.CacheInfo locCfg = joinDiscoData.caches().get(cfg.getName());
 
@@ -761,7 +760,7 @@ class ClusterCachesInfo {
      */
     private void processJoiningNode(CacheJoinNodeDiscoveryData joinData, UUID nodeId) {
         for (CacheJoinNodeDiscoveryData.CacheInfo cacheInfo : joinData.templates().values()) {
-            CacheConfiguration cfg = cacheInfo.config();
+            CacheConfiguration<?, ?> cfg = cacheInfo.config();
 
             if (!registeredTemplates.containsKey(cfg.getName())) {
                 DynamicCacheDescriptor desc = new DynamicCacheDescriptor(ctx,
@@ -780,7 +779,7 @@ class ClusterCachesInfo {
         }
 
         for (CacheJoinNodeDiscoveryData.CacheInfo cacheInfo : joinData.caches().values()) {
-            CacheConfiguration cfg = cacheInfo.config();
+            CacheConfiguration<?, ?> cfg = cacheInfo.config();
 
             if (!registeredCaches.containsKey(cfg.getName())) {
                 DynamicCacheDescriptor desc = new DynamicCacheDescriptor(ctx,

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
index a9861b1..40d3706 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
@@ -98,6 +98,7 @@ public class DynamicCacheDescriptor {
      * @param rcvdFrom ID of node provided cache configuration
      * @param staticCfg {@code True} if cache statically configured.
      * @param deploymentId Deployment ID.
+     * @param schema Query schema.
      */
     @SuppressWarnings("unchecked")
     public DynamicCacheDescriptor(GridKernalContext ctx,
@@ -188,6 +189,7 @@ public class DynamicCacheDescriptor {
      * Creates and caches cache object context if needed.
      *
      * @param proc Object processor.
+     * @return Cache object context.
      */
     public CacheObjectContext cacheObjectContext(IgniteCacheObjectProcessor proc) throws IgniteCheckedException {
         if (objCtx == null) {
@@ -224,14 +226,14 @@ public class DynamicCacheDescriptor {
     /**
      * @return {@code True} if received in discovery data.
      */
-    public boolean receivedOnDiscovery() {
+    boolean receivedOnDiscovery() {
         return rcvdOnDiscovery;
     }
 
     /**
      * @param rcvdOnDiscovery {@code True} if received in discovery data.
      */
-    public void receivedOnDiscovery(boolean rcvdOnDiscovery) {
+    void receivedOnDiscovery(boolean rcvdOnDiscovery) {
         this.rcvdOnDiscovery = rcvdOnDiscovery;
     }
 
@@ -245,14 +247,14 @@ public class DynamicCacheDescriptor {
     /**
      * @return Topology version when node provided cache configuration was started.
      */
-    @Nullable public AffinityTopologyVersion receivedFromStartVersion() {
+    @Nullable AffinityTopologyVersion receivedFromStartVersion() {
         return rcvdFromVer;
     }
 
     /**
      * @param rcvdFromVer Topology version when node provided cache configuration was started.
      */
-    public void receivedFromStartVersion(AffinityTopologyVersion rcvdFromVer) {
+    void receivedFromStartVersion(AffinityTopologyVersion rcvdFromVer) {
         this.rcvdFromVer = rcvdFromVer;
     }
 
@@ -281,7 +283,7 @@ public class DynamicCacheDescriptor {
     /**
      * @param clientCacheStartVer Version when client cache on local node was started.
      */
-    public void clientCacheStartVersion(AffinityTopologyVersion clientCacheStartVer) {
+    void clientCacheStartVersion(AffinityTopologyVersion clientCacheStartVer) {
         this.clientCacheStartVer = clientCacheStartVer;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
index 99fd29d..eac1120 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
@@ -17,17 +17,16 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import org.apache.ignite.internal.util.typedef.F;
-
-import java.util.ArrayList;
-import java.util.List;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -55,7 +54,7 @@ public class ExchangeActions {
     /**
      * @return {@code True} if server nodes should not participate in exchange.
      */
-    public boolean clientOnlyExchange() {
+    boolean clientOnlyExchange() {
         return F.isEmpty(cachesToStart) &&
             F.isEmpty(cachesToStop) &&
             F.isEmpty(cachesToResetLostParts);
@@ -65,7 +64,7 @@ public class ExchangeActions {
      * @param nodeId Local node ID.
      * @return Close cache requests.
      */
-    public List<DynamicCacheChangeRequest> closeRequests(UUID nodeId) {
+    List<DynamicCacheChangeRequest> closeRequests(UUID nodeId) {
         List<DynamicCacheChangeRequest> res = null;
 
         if (cachesToClose != null) {
@@ -83,6 +82,13 @@ public class ExchangeActions {
     }
 
     /**
+     * @return New caches start requests.
+     */
+    Collection<ActionData> cacheStartRequests() {
+        return cachesToStart != null ? cachesToStart.values() : Collections.<ActionData>emptyList();
+    }
+
+    /**
      * @return Start cache requests.
      */
     Collection<ActionData> newAndClientCachesStartRequests() {
@@ -104,8 +110,8 @@ public class ExchangeActions {
     /**
      * @return Stop cache requests.
      */
-    Collection<ActionData> stopRequests() {
-        return cachesToStop != null ? cachesToStop.values() : Collections.EMPTY_LIST;
+    Collection<ActionData> cacheStopRequests() {
+        return cachesToStop != null ? cachesToStop.values() : Collections.<ActionData>emptyList();
     }
 
     /**
@@ -194,7 +200,10 @@ public class ExchangeActions {
         return false;
     }
 
-    public void newClusterState(ClusterState state) {
+    /**
+     * @param state New cluster state.
+     */
+    void newClusterState(ClusterState state) {
         assert state != null;
 
         newState = state;

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/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 9ebfc4e..06ad62d 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
@@ -641,9 +641,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates = new HashMap<>();
 
-            registerCacheFromConfig(caches, templates);
+            addCacheOnJoinFromConfig(caches, templates);
 
-            registerCacheFromPersistentStore(caches, templates);
+            addCacheOnJoinFromPersistentStore(caches, templates);
 
             CacheJoinNodeDiscoveryData discoData = new CacheJoinNodeDiscoveryData(IgniteUuid.randomUuid(),
                 caches,
@@ -669,7 +669,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @param templates Templates map.
      * @throws IgniteCheckedException If failed.
      */
-    private void registerCache(CacheConfiguration cfg,
+    private void addCacheOnJoin(CacheConfiguration cfg,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> caches,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates) throws IgniteCheckedException {
         CU.validateCacheName(cfg.getName());
@@ -717,7 +717,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @param templates Templates map.
      * @throws IgniteCheckedException If failed.
      */
-    private void registerCacheFromConfig(
+    private void addCacheOnJoinFromConfig(
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> caches,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates
     ) throws IgniteCheckedException {
@@ -730,7 +730,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             cfgs[i] = cfg; // Replace original configuration value.
 
-            registerCache(cfg, caches, templates);
+            addCacheOnJoin(cfg, caches, templates);
         }
     }
 
@@ -739,7 +739,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @param templates Templates map.
      * @throws IgniteCheckedException If failed.
      */
-    private void registerCacheFromPersistentStore(
+    private void addCacheOnJoinFromPersistentStore(
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> caches,
         Map<String, CacheJoinNodeDiscoveryData.CacheInfo> templates
     ) throws IgniteCheckedException {
@@ -760,7 +760,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                     CacheConfiguration cfg = sharedCtx.pageStore().readConfiguration(name);
 
                     if (cfg != null)
-                        registerCache(cfg, caches, templates);
+                        addCacheOnJoin(cfg, caches, templates);
                 }
             }
         }
@@ -791,12 +791,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         ClusterNode locNode = ctx.discovery().localNode();
 
         try {
-            boolean check = !ctx.config().isDaemon() && !getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
+            boolean checkConsistency =
+                !ctx.config().isDaemon() && !getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
 
-            if (check)
+            if (checkConsistency)
                 checkConsistency();
 
-            cachesInfo.onKernalStart(check);
+            cachesInfo.onKernalStart(checkConsistency);
 
             boolean currStatus = ctx.state().active();
 
@@ -1917,7 +1918,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         }
 
         if (exchActions != null && err == null) {
-            for (ExchangeActions.ActionData action : exchActions.stopRequests()) {
+            for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) {
                 stopGateway(action.request());
 
                 prepareCacheStop(action.request());

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
index 2f11c86..a80830a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
@@ -17,6 +17,12 @@
 
 package org.apache.ignite.internal.processors.cache.distributed;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
 import org.apache.ignite.cluster.ClusterNode;
@@ -32,13 +38,6 @@ import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryJoinRequestMessa
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ThreadLocalRandom;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/194446dd/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 4a5d2d8..e423098 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -82,7 +82,19 @@ import org.apache.ignite.internal.processors.cache.IgniteStartCacheInTransaction
 import org.apache.ignite.internal.processors.cache.IgniteStartCacheInTransactionSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteSystemCacheOnClientTest;
 import org.apache.ignite.internal.processors.cache.MarshallerCacheJobRunNodeRestartTest;
-import org.apache.ignite.internal.processors.cache.distributed.*;
+import org.apache.ignite.internal.processors.cache.distributed.CacheAffinityEarlyTest;
+import org.apache.ignite.internal.processors.cache.distributed.CacheAtomicPrimarySyncBackPressureTest;
+import org.apache.ignite.internal.processors.cache.distributed.CacheDiscoveryDataConcurrentJoinTest;
+import org.apache.ignite.internal.processors.cache.distributed.CacheGetFutureHangsSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.CacheNoValueClassOnServerNodeTest;
+import org.apache.ignite.internal.processors.cache.distributed.CacheStartOnJoinTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheCreatePutMultiNodeSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheCreatePutTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteCachePrimarySyncTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheReadFromBackupTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheSingleGetMessageTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteTxCachePrimarySyncTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteTxCacheWriteSynchronizationModesMultithreadedTest;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheDhtTxPreloadSelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheLockFailoverSelfTest;
 import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheMultiTxLockSelfTest;
@@ -200,7 +212,6 @@ public class IgniteCacheTestSuite4 extends TestSuite {
 
         suite.addTestSuite(IgniteCacheTxPreloadNoWriteTest.class);
 
-        suite.addTestSuite(IgniteCacheStartTest.class);
         suite.addTestSuite(IgniteDynamicCacheStartSelfTest.class);
         suite.addTestSuite(IgniteDynamicCacheWithConfigStartSelfTest.class);
         suite.addTestSuite(IgniteCacheDynamicStopSelfTest.class);
@@ -213,6 +224,7 @@ public class IgniteCacheTestSuite4 extends TestSuite {
         suite.addTestSuite(IgniteCacheCreatePutMultiNodeSelfTest.class);
         suite.addTestSuite(IgniteCacheCreatePutTest.class);
         suite.addTestSuite(CacheStartOnJoinTest.class);
+        suite.addTestSuite(IgniteCacheStartTest.class);
         suite.addTestSuite(CacheDiscoveryDataConcurrentJoinTest.class);
 
         suite.addTestSuite(GridCacheTxLoadFromStoreOnLockSelfTest.class);


[2/9] ignite git commit: IGNITE-5131: Hadoop: updated org.ow2.asm version from 4.2 to 5.0.3. This closes #1946.

Posted by sb...@apache.org.
IGNITE-5131: Hadoop: updated org.ow2.asm version from 4.2 to 5.0.3. This closes #1946.


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: e1f3e4a679ac3a2230085bb244b6c153b40b5eb7
Parents: c4b7f40
Author: Ivan Veselovskiy <iv...@gridgain.com>
Authored: Wed May 17 12:06:16 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed May 17 12:06:16 2017 +0300

----------------------------------------------------------------------
 assembly/LICENSE_FABRIC | 2 +-
 assembly/LICENSE_HADOOP | 2 +-
 modules/hadoop/pom.xml  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e1f3e4a6/assembly/LICENSE_FABRIC
----------------------------------------------------------------------
diff --git a/assembly/LICENSE_FABRIC b/assembly/LICENSE_FABRIC
index 35a8529..a16381e 100644
--- a/assembly/LICENSE_FABRIC
+++ b/assembly/LICENSE_FABRIC
@@ -285,7 +285,7 @@ This product bundles Java Transaction API which is available under it's own lice
 See http://download.oracle.com/otndocs/jcp/jta-1.1-classes-oth-JSpec/jta-1.1-classes-oth-JSpec-license.html for details.
 
 ==============================================================================
-For ASM All (http://asm.objectweb.org/asm-all/) org.ow2.asm:asm-all:jar:4.2
+For ASM All (http://asm.objectweb.org/asm-all/) org.ow2.asm:asm-all:jar:5.0.3
 ==============================================================================
 This product bundles ASM All which is available under the following:
 BSD. For details, see http://asm.objectweb.org/license.html.

http://git-wip-us.apache.org/repos/asf/ignite/blob/e1f3e4a6/assembly/LICENSE_HADOOP
----------------------------------------------------------------------
diff --git a/assembly/LICENSE_HADOOP b/assembly/LICENSE_HADOOP
index f2128fe..3db2360 100644
--- a/assembly/LICENSE_HADOOP
+++ b/assembly/LICENSE_HADOOP
@@ -249,7 +249,7 @@ This product bundles Scala Library which is available under the following:
 BSD 3-Clause. For details, see http://www.scala-lang.org/license.html.
 
 ==============================================================================
-For ASM All (http://asm.objectweb.org/asm-all/) org.ow2.asm:asm-all:jar:4.2
+For ASM All (http://asm.objectweb.org/asm-all/) org.ow2.asm:asm-all:jar:5.0.3
 ==============================================================================
 This product bundles ASM All which is available under the following:
 BSD. For details, see http://asm.objectweb.org/license.html.

http://git-wip-us.apache.org/repos/asf/ignite/blob/e1f3e4a6/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index e7f71ec..b6d4b10 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -57,7 +57,7 @@
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm-all</artifactId>
-            <version>4.2</version>
+            <version>5.0.3</version>
         </dependency>
 
         <dependency>


[4/9] ignite git commit: IGNITE-5193: Hadoop: better handling of empty paths in environment variables. This closes #1928.

Posted by sb...@apache.org.
IGNITE-5193: Hadoop: better handling of empty paths in environment variables. This closes #1928.


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: ccaed07da57e2de2c69be55fdf45512d2d90de11
Parents: 8214463
Author: Ivan Veselovskiy <iv...@gridgain.com>
Authored: Wed May 17 13:27:11 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed May 17 13:27:11 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/hadoop/HadoopClasspathUtils.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ccaed07d/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
index 8f7f7a8..2b377ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
@@ -29,6 +29,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
+import org.apache.ignite.internal.util.typedef.F;
 
 /**
  * Hadoop classpath utilities.
@@ -258,7 +259,7 @@ public class HadoopClasspathUtils {
      * @return {@code True} if the given path denotes an existing directory.
      */
     public static boolean exists(String path) {
-        if (path == null)
+        if (F.isEmpty(path))
             return false;
 
         Path p = Paths.get(path);


[8/9] ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-5075-cacheStart

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-5075-cacheStart


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

Branch: refs/heads/ignite-5075-cacheStart
Commit: 11fc7ca85e5f37ef0d57e08cd8c18951929e7574
Parents: ace34f2 a0fc6ee
Author: sboikov <sb...@gridgain.com>
Authored: Wed May 17 18:19:26 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed May 17 18:19:26 2017 +0300

----------------------------------------------------------------------
 assembly/LICENSE_FABRIC                         |  2 +-
 assembly/LICENSE_HADOOP                         |  2 +-
 .../managers/communication/GridIoManager.java   | 68 ++++++++++++----
 .../processors/hadoop/HadoopClasspathUtils.java |  3 +-
 modules/hadoop/pom.xml                          |  2 +-
 .../ignite/impl/binary/binary_type_manager.h    |  6 +-
 .../src/impl/binary/binary_type_manager.cpp     | 83 +++++++++-----------
 .../cpp/core-test/src/cache_query_test.cpp      | 22 ++++++
 .../core/include/ignite/cache/query/query_sql.h |  8 ++
 .../ignite/cache/query/query_sql_fields.h       | 10 ++-
 .../query-example/src/query_example.cpp         |  6 +-
 .../Cache/MemoryMetricsTest.cs                  | 14 ++--
 .../frontend/gulpfile.babel.js/tasks/bundle.js  |  2 +-
 .../webpack/environments/development.js         |  5 +-
 14 files changed, 149 insertions(+), 84 deletions(-)
----------------------------------------------------------------------