ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] ignite git commit: IGNITE-4872: GridQueryProcessor.registerType() now return void.
Date Tue, 28 Mar 2017 08:59:34 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 738bb1224 -> ab516da1a


IGNITE-4872: GridQueryProcessor.registerType() now return void.


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

Branch: refs/heads/master
Commit: 48701fb5d43ca340713fccb8060eb2048b84c774
Parents: 87477e0
Author: devozerov <vozerov@gridgain.com>
Authored: Tue Mar 28 11:59:03 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Tue Mar 28 11:59:03 2017 +0300

----------------------------------------------------------------------
 .../processors/query/GridQueryProcessor.java       |  8 ++++----
 .../processors/query/QueryTypeDescriptorImpl.java  | 17 -----------------
 .../processors/query/h2/IgniteH2Indexing.java      |  8 ++------
 3 files changed, 6 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/48701fb5/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 a58ca53..676c836 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
@@ -185,7 +185,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 if (altTypeId != null)
                     types.put(altTypeId, desc);
 
-                desc.registered(idx.registerType(space, desc));
+                idx.registerType(space, desc);
             }
         }
         catch (IgniteCheckedException | RuntimeException e) {
@@ -362,7 +362,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
             QueryTypeDescriptorImpl desc = types.get(id);
 
-            if (desc == null || !desc.registered())
+            if (desc == null)
                 return;
 
             if (!binaryVal && !desc.valueClass().isAssignableFrom(valCls))
@@ -775,7 +775,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         for (Map.Entry<QueryTypeIdKey, QueryTypeDescriptorImpl> e : types.entrySet())
{
             QueryTypeDescriptorImpl desc = e.getValue();
 
-            if (desc.registered() && F.eq(e.getKey().space(), space))
+            if (F.eq(e.getKey().space(), space))
                 spaceTypes.add(desc);
         }
 
@@ -793,7 +793,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     public QueryTypeDescriptorImpl type(@Nullable String space, String typeName) throws IgniteCheckedException
{
         QueryTypeDescriptorImpl type = typesByName.get(new QueryTypeNameKey(space, typeName));
 
-        if (type == null || !type.registered())
+        if (type == null)
             throw new IgniteCheckedException("Failed to find SQL table for type: " + typeName);
 
         return type;

http://git-wip-us.apache.org/repos/asf/ignite/blob/48701fb5/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java
index f22cc11..5b29fbb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeDescriptorImpl.java
@@ -75,23 +75,6 @@ public class QueryTypeDescriptorImpl implements GridQueryTypeDescriptor
{
     /** */
     private String affKey;
 
-    /** SPI can decide not to register this type. */
-    private boolean registered;
-
-    /**
-     * @return {@code True} if type registration in SPI was finished and type was not rejected.
-     */
-    public boolean registered() {
-        return registered;
-    }
-
-    /**
-     * @param registered Sets registered flag.
-     */
-    public void registered(boolean registered) {
-        this.registered = registered;
-    }
-
     /** {@inheritDoc} */
     @Override public String name() {
         return name;

http://git-wip-us.apache.org/repos/asf/ignite/blob/48701fb5/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 79121e4..17bc7a7 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
@@ -1649,8 +1649,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
      */
     @Override public boolean registerType(@Nullable String spaceName, GridQueryTypeDescriptor
type)
         throws IgniteCheckedException {
-        if (!validateTypeDescriptor(type))
-            return false;
+        validateTypeDescriptor(type);
 
         String schemaName = schema(spaceName);
 
@@ -1678,10 +1677,9 @@ public class IgniteH2Indexing implements GridQueryIndexing {
      * Validates properties described by query types.
      *
      * @param type Type descriptor.
-     * @return True if type is valid.
      * @throws IgniteCheckedException If validation failed.
      */
-    private boolean validateTypeDescriptor(GridQueryTypeDescriptor type)
+    private void validateTypeDescriptor(GridQueryTypeDescriptor type)
         throws IgniteCheckedException {
         assert type != null;
 
@@ -1699,8 +1697,6 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             if (name.equalsIgnoreCase(KEY_FIELD_NAME) || name.equalsIgnoreCase(VAL_FIELD_NAME))
                 throw new IgniteCheckedException(MessageFormat.format(ptrn, name));
         }
-
-        return true;
     }
 
     /**


Mime
View raw message