ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/3] incubator-ignite git commit: # ignite-180-1
Date Tue, 07 Apr 2015 09:54:12 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-180-1 1a4e7f1b3 -> 627cf0592


# ignite-180-1


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

Branch: refs/heads/ignite-180-1
Commit: 0c9c60c666ba9e45d96fd416545ef023dcd06e88
Parents: d8b2315
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Apr 7 12:52:42 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Apr 7 12:52:42 2015 +0300

----------------------------------------------------------------------
 .../configuration/CollectionConfiguration.java  | 22 +----------------
 .../CacheDataStructuresCacheKey.java            |  2 +-
 .../CacheDataStructuresConfigurationKey.java    |  2 +-
 .../datastructures/DataStructuresProcessor.java | 25 ++++++--------------
 .../IgniteDataStructureUniqueNameTest.java      | 23 ------------------
 5 files changed, 10 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c9c60c6/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
index 40ab40d..f776307 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
@@ -29,7 +29,7 @@ import static org.apache.ignite.cache.CacheMode.*;
 /**
  * Configuration for Ignite collections.
  */
-public class CollectionConfiguration implements Externalizable {
+public class CollectionConfiguration implements Serializable {
     /** Cache atomicity mode. */
     private CacheAtomicityMode atomicityMode = ATOMIC;
 
@@ -138,24 +138,4 @@ public class CollectionConfiguration implements Externalizable {
     @Override public String toString() {
         return S.toString(CollectionConfiguration.class, this);
     }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeInt(atomicityMode.ordinal());
-        out.writeInt(cacheMode.ordinal());
-        out.writeObject(memoryMode);
-        out.writeInt(backups);
-        out.writeLong(offHeapMaxMem);
-        out.writeBoolean(collocated);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        atomicityMode = CacheAtomicityMode.fromOrdinal(in.readInt());
-        cacheMode = CacheMode.fromOrdinal(in.readInt());
-        memoryMode = (CacheMemoryMode) in.readObject();
-        backups = in.readInt();
-        offHeapMaxMem = in.readLong();
-        collocated = in.readBoolean();
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c9c60c6/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresCacheKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresCacheKey.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresCacheKey.java
index 6a69486..26e1ac7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresCacheKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresCacheKey.java
@@ -37,7 +37,7 @@ public class CacheDataStructuresCacheKey implements GridCacheInternal, Externali
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return 33;
+        return getClass().getName().hashCode();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c9c60c6/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresConfigurationKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresConfigurationKey.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresConfigurationKey.java
index a2bec2b..6a5f25c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresConfigurationKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresConfigurationKey.java
@@ -37,7 +37,7 @@ public class CacheDataStructuresConfigurationKey implements GridCacheInternal,
E
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return 31;
+        return getClass().getName().hashCode();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c9c60c6/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
index dea96aa..96dfbfa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
@@ -38,6 +38,7 @@ import java.util.*;
 import java.util.concurrent.*;
 
 import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
 import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*;
 import static org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor.DataStructureType.*;
 import static org.apache.ignite.transactions.TransactionConcurrency.*;
@@ -724,6 +725,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
         ccfg.setCacheMode(cfg.cacheMode());
         ccfg.setMemoryMode(cfg.memoryMode());
         ccfg.setOffHeapMaxMemory(cfg.offHeapMaxMem());
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setAtomicWriteOrderMode(PRIMARY);
 
         return ccfg;
     }
@@ -1237,16 +1240,6 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
     }
 
     /**
-     * @param cctx Cache context.
-     * @throws IgniteCheckedException If {@link IgniteQueue} can with given cache.
-     */
-    private void checkSupportsQueue(GridCacheContext cctx) throws IgniteCheckedException
{
-        if (cctx.atomic() && !cctx.isLocal() && cctx.config().getAtomicWriteOrderMode()
== CLOCK)
-            throw new IgniteCheckedException("IgniteQueue can not be used with ATOMIC cache
with CLOCK write order mode" +
-                " (change write order mode to PRIMARY in configuration)");
-    }
-
-    /**
      *
      */
     static enum DataStructureType {
@@ -1378,14 +1371,13 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
 
         /** {@inheritDoc} */
         @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-            cfg = new CollectionConfiguration();
-            cfg.readExternal(in);
+            cfg = (CollectionConfiguration)in.readObject();
             cacheName = U.readString(in);
         }
 
         /** {@inheritDoc} */
         @Override public void writeExternal(ObjectOutput out) throws IOException {
-            cfg.writeExternal(out);
+            out.writeObject(cfg);
             U.writeString(out, cacheName);
         }
 
@@ -1745,7 +1737,6 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
                     col.cfg.cacheMode() == cfg.cacheMode() &&
                     col.cfg.backups() == cfg.backups() &&
                     col.cfg.offHeapMaxMem() == cfg.offHeapMaxMem())
-
                     return new T2<>(col.cacheName, null);
             }
 
@@ -1760,14 +1751,12 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
 
         /** {@inheritDoc} */
         @Override public void writeExternal(ObjectOutput out) throws IOException {
-            cfg.writeExternal(out);
+            out.writeObject(cfg);
         }
 
         /** {@inheritDoc} */
         @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-            cfg = new CollectionConfiguration();
-
-            cfg.readExternal(in);
+            cfg = (CollectionConfiguration)in.readObject();
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c9c60c6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteDataStructureUniqueNameTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteDataStructureUniqueNameTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteDataStructureUniqueNameTest.java
index f762ded..b05a509 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteDataStructureUniqueNameTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteDataStructureUniqueNameTest.java
@@ -86,29 +86,6 @@ public class IgniteDataStructureUniqueNameTest extends IgniteCollectionAbstractT
     /**
      * @throws Exception If failed.
      */
-    public void testQueueAtomicClockCache() throws Exception {
-        final String queueName = "testQueueAtomicClockCache";
-
-        GridTestUtils.assertThrows(log, new Callable<Void>() {
-            @Override public Void call() throws Exception {
-                CollectionConfiguration colCfg = new CollectionConfiguration();
-
-                colCfg.cacheMode(PARTITIONED);
-                colCfg.atomicityMode(ATOMIC);
-
-                ignite(0).queue(queueName, 0, colCfg);
-
-                return null;
-            }
-        }, IgniteException.class, "IgniteQueue can not be used with ATOMIC cache with CLOCK
write order mode " +
-            "(change write order mode to PRIMARY in configuration)");
-
-        assertNull(ignite(0).queue(queueName, 0, null));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testUniqueNameMultithreaded() throws Exception {
         testUniqueName(true);
     }


Mime
View raw message