ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [12/50] [abbrv] incubator-ignite git commit: ignite-45 - Fixing examples after merge.
Date Mon, 16 Mar 2015 09:22:59 GMT
ignite-45 - Fixing examples after merge.


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

Branch: refs/heads/ignite-421
Commit: 6c78f455273f7ab543c85814b62ab1bd78620a81
Parents: 769cdab
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Fri Mar 13 19:11:18 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Fri Mar 13 19:11:18 2015 -0700

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         |  2 +-
 .../affinity/AffinityTopologyVersion.java       |  2 +-
 .../processors/query/GridQueryIndexing.java     | 21 ++++++--------
 .../processors/query/GridQueryProcessor.java    | 12 ++++----
 .../resource/GridResourceProcessor.java         |  2 --
 .../processors/query/h2/IgniteH2Indexing.java   | 29 +++++++++++---------
 6 files changed, 32 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c78f455/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 4e1c5cf..4be1ee6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -837,7 +837,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
      */
     private String topologySnapshotMessage(int rmtNodesNum, int totalCpus, double heap) {
         return PREFIX + " [" +
-            (discoOrdered ? "ver=" + topVer + ", " : "") +
+            (discoOrdered ? "ver=" + topVer.get().topologyVersion() + ", " : "") +
             "nodes=" + (rmtNodesNum + 1) +
             ", CPUs=" + totalCpus +
             ", heap=" + heap + "GB" +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c78f455/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
index 0509e77..9ff02f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
@@ -194,7 +194,7 @@ public class AffinityTopologyVersion implements Comparable<AffinityTopologyVersi
 
     /** {@inheritDoc} */
     @Override public byte directType() {
-        return 106;
+        return 111;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c78f455/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index bdd9de2..faed40e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.query.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.lang.*;
@@ -51,18 +50,6 @@ public interface GridQueryIndexing {
     public void stop() throws IgniteCheckedException;
 
     /**
-     * @param ctx Cache context.
-     * @throws IgniteCheckedException If failed.
-     */
-    public void onCacheStarted(GridCacheContext ctx) throws IgniteCheckedException;
-
-    /**
-     * @param ctx Cache context.
-     * @throws IgniteCheckedException If failed.
-     */
-    public void onCacheStopped(GridCacheContext ctx) throws IgniteCheckedException;
-
-    /**
      * Runs two step query.
      *
      * @param space Space name.
@@ -153,6 +140,14 @@ public interface GridQueryIndexing {
     public void registerCache(CacheConfiguration<?,?> ccfg) throws IgniteCheckedException;
 
     /**
+     * Deregisters cache.
+     *
+     * @param ccfg Cache configuration.
+     * @throws IgniteCheckedException If failed to drop cache schema.
+     */
+    public void unregisterCache(CacheConfiguration<?, ?> ccfg) throws IgniteCheckedException;
+
+    /**
      * Registers type if it was not known before or updates it otherwise.
      *
      * @param spaceName Space name.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c78f455/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 2d1f183..0d82327 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -99,9 +99,6 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             execSvc = ctx.getExecutorService();
 
             idx.start(ctx);
-
-            for (CacheConfiguration<?, ?> ccfg : ctx.config().getCacheConfiguration())
-                initializeCache(ccfg);
         }
     }
 
@@ -219,7 +216,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             return;
 
         try {
-            idx.onCacheStarted(cctx);
+            initializeCache(cctx.config());
         }
         finally {
             busyLock.leaveBusy();
@@ -237,15 +234,18 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             return;
 
         try {
-            idx.onCacheStopped(cctx);
+            idx.unregisterCache(cctx.config());
 
             Iterator<Map.Entry<TypeId, TypeDescriptor>> it = types.entrySet().iterator();
 
             while (it.hasNext()) {
                 Map.Entry<TypeId, TypeDescriptor> entry = it.next();
 
-                if (F.eq(cctx.name(), entry.getKey().space))
+                if (F.eq(cctx.name(), entry.getKey().space)) {
                     it.remove();
+
+                    typesByName.remove(new TypeName(cctx.name(), entry.getValue().name()));
+                }
             }
         }
         catch (IgniteCheckedException e) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c78f455/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
index 3611a09..f08a287 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.managers.deployment.*;
 import org.apache.ignite.internal.processors.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lifecycle.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.services.*;
@@ -250,7 +249,6 @@ public class GridResourceProcessor extends GridProcessorAdapter {
         if (obj != null) {
             if (log.isDebugEnabled())
                 log.debug("Cleaning up resources: " + obj);
-            U.debug(log, "Cleaning up resources: " + obj);
 
             // Unwrap Proxy object.
             obj = unwrapTarget(obj);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c78f455/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index f28a479..d86062b 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -1198,18 +1198,6 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             };
     }
 
-    /** {@inheritDoc} */
-    @Override public void onCacheStarted(GridCacheContext ctx) throws IgniteCheckedException
{
-        createSchema(schema(ctx.name()));
-    }
-
-    /** {@inheritDoc} */
-    @Override public void onCacheStopped(GridCacheContext ctx) throws IgniteCheckedException
{
-        dropSchema(schema(ctx.name()));
-
-        schemas.remove(schema(ctx.name()));
-    }
-
     /**
      * Registers SQL functions.
      *
@@ -1273,7 +1261,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
     }
 
     /** {@inheritDoc} */
-    public void registerCache(CacheConfiguration<?,?> ccfg) throws IgniteCheckedException
{
+    @Override public void registerCache(CacheConfiguration<?,?> ccfg) throws IgniteCheckedException
{
         String schema = schema(ccfg.getName());
 
         if (schemas.putIfAbsent(schema, new Schema(ccfg.getName(),
@@ -1285,6 +1273,21 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         createSqlFunctions(schema, ccfg.getSqlFunctionClasses());
     }
 
+    @Override public void unregisterCache(CacheConfiguration<?, ?> ccfg) {
+        String schema = schema(ccfg.getName());
+
+        Schema rmv = schemas.remove(schema);
+
+        if (rmv != null) {
+            try {
+                dropSchema(schema);
+            }
+            catch (IgniteCheckedException e) {
+                U.error(log, "Failed to drop schema on cache stop (will ignore): " + ccfg.getName(),
e);
+            }
+        }
+    }
+
     /** {@inheritDoc} */
     @Override public IndexingQueryFilter backupFilter() {
         return new IndexingQueryFilter() {


Mime
View raw message