ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [5/5] incubator-ignite git commit: IGNITE-51 - Fixed compilation
Date Sun, 08 Feb 2015 07:35:07 GMT
IGNITE-51 - Fixed compilation


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

Branch: refs/heads/ignite-51
Commit: 71c7a694cee50ac34519d9346e15925656901d0e
Parents: dff026b
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Sat Feb 7 23:34:44 2015 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Sat Feb 7 23:34:44 2015 -0800

----------------------------------------------------------------------
 .../ignite/client/ClientPutPortableTask.java    | 43 ----------
 .../ClientTestPortableAffinityKeyTask.java      | 85 --------------------
 .../GridCacheOffHeapTieredAbstractSelfTest.java | 15 +---
 ...heOffHeapTieredEvictionAbstractSelfTest.java | 78 ++----------------
 .../org/apache/ignite/IgniteSpringBean.java     |  7 --
 5 files changed, 10 insertions(+), 218 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71c7a694/modules/clients/src/test/java/org/apache/ignite/client/ClientPutPortableTask.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/ClientPutPortableTask.java
b/modules/clients/src/test/java/org/apache/ignite/client/ClientPutPortableTask.java
deleted file mode 100644
index a1452cd..0000000
--- a/modules/clients/src/test/java/org/apache/ignite/client/ClientPutPortableTask.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.client;
-
-import org.apache.ignite.*;
-import org.apache.ignite.resources.*;
-
-/**
- * Task creates portable object and puts it in cache.
- */
-public class ClientPutPortableTask extends TaskSingleJobSplitAdapter {
-    /** */
-    @IgniteInstanceResource
-    private Ignite ignite;
-
-    /** {@inheritDoc} */
-    @Override protected Object executeJob(int gridSize, Object arg) {
-        String cacheName = (String)arg;
-
-        IgniteCache<Object, Object> cache = ignite.jcache(cacheName);
-
-        ClientTestPortable p = new ClientTestPortable(100, true);
-
-        cache.put(1, p);
-
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71c7a694/modules/clients/src/test/java/org/apache/ignite/client/ClientTestPortableAffinityKeyTask.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/client/ClientTestPortableAffinityKeyTask.java
b/modules/clients/src/test/java/org/apache/ignite/client/ClientTestPortableAffinityKeyTask.java
deleted file mode 100644
index 0c459f5..0000000
--- a/modules/clients/src/test/java/org/apache/ignite/client/ClientTestPortableAffinityKeyTask.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.client;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.compute.*;
-import org.gridgain.grid.portables.*;
-import org.apache.ignite.resources.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * Task used to test portable affinity key.
- */
-public class ClientTestPortableAffinityKeyTask extends ComputeTaskAdapter<Object, Boolean>
{
-    /** */
-    @IgniteInstanceResource
-    private Ignite ignite;
-
-    /** {@inheritDoc} */
-    @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode>
clusterNodes,
-        @Nullable final Object arg) {
-        for (ClusterNode node : clusterNodes) {
-            if (node.isLocal())
-                return Collections.singletonMap(new ComputeJobAdapter() {
-                    @Override public Object execute() {
-                        return executeJob(arg);
-                    }
-                }, node);
-        }
-
-        throw new IgniteException("Failed to find local node in task topology: " + clusterNodes);
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public Boolean reduce(List<ComputeJobResult> results) {
-        return results.get(0).getData();
-    }
-
-    /**
-     * @param arg Argument.
-     * @return Execution result.
-     * @throws IgniteException If failed.
-     */
-     protected Boolean executeJob(Object arg) throws IgniteException {
-        Collection args = (Collection)arg;
-
-        Iterator<Object> it = args.iterator();
-
-        assert args.size() == 3 : args.size();
-
-        PortableObject obj = (PortableObject)it.next();
-
-        String cacheName = (String)it.next();
-
-        String expAffKey = (String)it.next();
-
-        Object affKey = ignite.cache(cacheName).affinity().affinityKey(obj);
-
-        if (!expAffKey.equals(affKey))
-            throw new IgniteException("Unexpected affinity key: " + affKey);
-
-        if (!ignite.cache(cacheName).affinity().mapKeyToNode(obj).isLocal())
-            throw new IgniteException("Job is not run on primary node.");
-
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71c7a694/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
index 4d6162e..3e31419 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.lang.*;
-import org.gridgain.grid.portables.*;
 import org.apache.ignite.transactions.*;
 import org.jetbrains.annotations.*;
 import org.junit.*;
@@ -58,18 +57,8 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
     }
 
     /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        if (portableEnabled()) {
-            PortableConfiguration pCfg = new PortableConfiguration();
-
-            pCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
-
-            cfg.setPortableConfiguration(pCfg);
-        }
-
-        return cfg;
+    protected boolean portableEnabled() {
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71c7a694/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
index bc43dec..1f83ac1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.gridgain.grid.portables.*;
 import org.apache.ignite.testframework.*;
 
 import javax.cache.processor.*;
@@ -61,21 +60,6 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends
Gri
     }
 
     /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        if (portableEnabled()) {
-            PortableConfiguration pCfg = new PortableConfiguration();
-
-            pCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
-
-            cfg.setPortableConfiguration(pCfg);
-        }
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
     @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception
{
         CacheConfiguration ccfg = super.cacheConfiguration(gridName);
 
@@ -207,10 +191,8 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest
extends Gri
      * @param acceptNull If {@code true} value can be null;
      * @return Predicate.
      */
-    private TestPredicate testPredicate(String expVal, boolean acceptNull) {
-        return portableEnabled() ?
-            new PortableValuePredicate(expVal, acceptNull) :
-            new TestValuePredicate(expVal, acceptNull);
+    protected TestPredicate testPredicate(String expVal, boolean acceptNull) {
+        return new TestValuePredicate(expVal, acceptNull);
     }
 
     /**
@@ -218,10 +200,8 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest
extends Gri
      * @param acceptNull If {@code true} value can be null;
      * @return Predicate.
      */
-    private TestProcessor testClosure(String expVal, boolean acceptNull) {
-        return portableEnabled() ?
-            new PortableValueClosure(expVal, acceptNull) :
-            new TestValueClosure(expVal, acceptNull);
+    protected TestProcessor testClosure(String expVal, boolean acceptNull) {
+        return new TestValueClosure(expVal, acceptNull);
     }
 
     /**
@@ -288,28 +268,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest
extends Gri
         /**
          * @param val Value.
          */
-        abstract void checkValue(Object val);
-    }
-
-    /**
-     *
-     */
-    @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValuePredicate extends TestPredicate {
-        /**
-         * @param expVal Expected value.
-         * @param acceptNull If {@code true} value can be null;
-         */
-        PortableValuePredicate(String expVal, boolean acceptNull) {
-            super(expVal, acceptNull);
-        }
-
-        /** {@inheritDoc} */
-        @Override void checkValue(Object val) {
-            PortableObject obj = (PortableObject)val;
-
-            assertEquals(expVal, obj.field("val"));
-        }
+        public abstract void checkValue(Object val);
     }
 
     /**
@@ -326,7 +285,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends
Gri
         }
 
         /** {@inheritDoc} */
-        @Override void checkValue(Object val) {
+        @Override public void checkValue(Object val) {
             TestValue obj = (TestValue)val;
 
             assertEquals(expVal, obj.val);
@@ -375,28 +334,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest
extends Gri
         /**
          * @param val Value.
          */
-        abstract void checkValue(Object val);
-    }
-
-    /**
-     *
-     */
-    @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValueClosure extends TestProcessor {
-        /**
-         * @param expVal Expected value.
-         * @param acceptNull If {@code true} value can be null;
-         */
-        PortableValueClosure(String expVal, boolean acceptNull) {
-            super(expVal, acceptNull);
-        }
-
-        /** {@inheritDoc} */
-        @Override void checkValue(Object val) {
-            PortableObject obj = (PortableObject)val;
-
-            assertEquals(expVal, obj.field("val"));
-        }
+        public abstract void checkValue(Object val);
     }
 
     /**
@@ -413,7 +351,7 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends
Gri
         }
 
         /** {@inheritDoc} */
-        @Override void checkValue(Object val) {
+        @Override public void checkValue(Object val) {
             TestValue obj = (TestValue)val;
 
             assertEquals(expVal, obj.val);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71c7a694/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
index 74c810a..6a46da1 100644
--- a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
+++ b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
@@ -242,13 +242,6 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     }
 
     /** {@inheritDoc} */
-    @Override public IgnitePortables portables() {
-        assert g != null;
-
-        return g.portables();
-    }
-
-    /** {@inheritDoc} */
     @Override public String name() {
         assert g != null;
 


Mime
View raw message