ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [11/50] incubator-ignite git commit: sp-2: rename @CacheImmutable > @IgniteImmutable
Date Wed, 18 Mar 2015 14:06:23 GMT
sp-2: rename @CacheImmutable > @IgniteImmutable


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

Branch: refs/heads/ignite-424
Commit: aea01d50e5de87fec4ed6bc26d1d663acd7ba58f
Parents: 188554b
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Mon Mar 16 19:32:31 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Mon Mar 16 19:32:31 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheImmutable.java | 45 ------------------
 .../configuration/CacheConfiguration.java       |  5 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |  3 +-
 .../IgniteCacheObjectProcessorImpl.java         |  2 +-
 .../org/apache/ignite/lang/IgniteImmutable.java | 49 ++++++++++++++++++++
 .../GridCacheOnCopyFlagAbstractSelfTest.java    |  4 +-
 .../GridCacheReturnValueTransferSelfTest.java   |  3 +-
 7 files changed, 59 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aea01d50/modules/core/src/main/java/org/apache/ignite/cache/CacheImmutable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheImmutable.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheImmutable.java
deleted file mode 100644
index 42bfaa0..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheImmutable.java
+++ /dev/null
@@ -1,45 +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.cache;
-
-import org.apache.ignite.configuration.*;
-
-import java.lang.annotation.*;
-
-/**
- * If cache configuration flag {@link CacheConfiguration#isCopyOnRead()} is set
- * then for each operation implying return value copy of the value stored in cache is created.
- * Also if this flag is set copies are created for values passed to {@link CacheInterceptor}
and
- * to {@link CacheEntryProcessor}.
- * <p>
- * Copies are not created for types marked with {@link CacheImmutable} annotation and for
known
- * immutable types:
- * <ul>
- *     <li>Boxed primitives ({@link Integer}, {@link Long}, ...)</li>
- *     <li>{@link String}</li>
- *     <li>{@link java.util.UUID}</li>
- *     <li>{@link java.math.BigDecimal}</li>
- *     <li>{@link org.apache.ignite.lang.IgniteUuid}</li>
- * </ul>
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface CacheImmutable {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aea01d50/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 24ab2c5..a17ca58 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -24,6 +24,7 @@ import org.apache.ignite.cache.eviction.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.indexing.*;
 import org.jetbrains.annotations.*;
 
@@ -1606,10 +1607,10 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K,
V> {
      * for cache operation implying return value. Also if this flag is set copies are created
for values
      * passed to {@link CacheInterceptor} and to {@link CacheEntryProcessor}.
      * <p>
-     * Copies are not created for immutable types, see {@link CacheImmutable}.
+     * Copies are not created for immutable types, see {@link IgniteImmutable}.
      *
      * @return Copy on get flag.
-     * @see CacheImmutable
+     * @see IgniteImmutable
      */
     public boolean isCopyOnRead() {
         return cpOnRead;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aea01d50/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
index 002b28e..a8eda0e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.processors.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
 /**
@@ -147,7 +148,7 @@ public interface IgniteCacheObjectProcessor extends GridProcessor {
     /**
      * @param obj Value.
      * @return {@code True} if object is of known immutable type of it is marked
-     *          with {@link org.apache.ignite.cache.CacheImmutable} annotation.
+     *          with {@link IgniteImmutable} annotation.
      */
     public boolean immutable(Object obj);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aea01d50/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index fb89500..1966a21 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -297,7 +297,7 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter
impleme
         if (immutable != null)
             return immutable;
 
-        immutable = IgniteUtils.hasAnnotation(cls, CacheImmutable.class);
+        immutable = IgniteUtils.hasAnnotation(cls, IgniteImmutable.class);
 
         reflectionCache.putIfAbsent(cls, immutable);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aea01d50/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java
new file mode 100644
index 0000000..bcecd7d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteImmutable.java
@@ -0,0 +1,49 @@
+/*
+ * 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.lang;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+
+import java.lang.annotation.*;
+
+/**
+ * Immutable types should be annotated with this annotation to avoid unnecessary
+ * copying (e.g. in case of stateless compute closures or cache values).
+ * <p>
+ * If cache configuration flag {@link CacheConfiguration#isCopyOnRead()} is set
+ * then for each operation implying return value copy of the value stored in cache is created.
+ * Also if this flag is set copies are created for values passed to {@link CacheInterceptor}
and
+ * to {@link CacheEntryProcessor}.
+ * <p>
+ * Copies are not created for types marked with {@link IgniteImmutable} annotation and for
known
+ * immutable types:
+ * <ul>
+ *     <li>Boxed primitives ({@link Integer}, {@link Long}, ...)</li>
+ *     <li>{@link String}</li>
+ *     <li>{@link java.util.UUID}</li>
+ *     <li>{@link java.math.BigDecimal}</li>
+ *     <li>{@link org.apache.ignite.lang.IgniteUuid}</li>
+ * </ul>
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface IgniteImmutable {
+    // No-op.
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aea01d50/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
index 3d34cd7..ea846dd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
@@ -652,7 +652,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
     /**
      *
      */
-    @CacheImmutable
+    @IgniteImmutable
     public static class TestImmutableKey extends TestKey {
         /**
          *
@@ -673,7 +673,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
     /**
      *
      */
-    @CacheImmutable
+    @IgniteImmutable
     public static class TestImmutableValue {
         /** */
         public int val;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aea01d50/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
index 22bd5fd..065dfb8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.lang.*;
 import org.apache.ignite.testframework.junits.common.*;
 
 import javax.cache.processor.*;
@@ -185,7 +186,7 @@ public class GridCacheReturnValueTransferSelfTest extends GridCommonAbstractTest
     /**
      *
      */
-    @CacheImmutable
+    @IgniteImmutable
     private static class TestObject implements Externalizable {
         /**
          *


Mime
View raw message