i-432: review
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bd44e13d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bd44e13d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bd44e13d Branch: refs/heads/ignite-45 Commit: bd44e13dbb7652883a5b7fee0069f0b7ab998dc0 Parents: 71253c8 Author: Yakov Zhdanov <yzhda...@gridgain.com> Authored: Tue Mar 17 19:57:16 2015 +0300 Committer: Yakov Zhdanov <yzhda...@gridgain.com> Committed: Tue Mar 17 19:57:16 2015 +0300 ---------------------------------------------------------------------- .../org/apache/ignite/cache/query/Query.java | 8 +++-- .../internal/client/GridClientCacheFlag.java | 2 +- .../processors/cache/GridCachePeekMode.java | 6 +--- .../processors/cache/GridCacheProjectionEx.java | 10 +++---- .../processors/cache/query/CacheQuery.java | 5 +--- .../cache/query/GridCacheQueryAdapter.java | 2 +- .../ignite/internal/util/lang/GridFunc.java | 31 ++------------------ 7 files changed, 16 insertions(+), 48 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd44e13d/modules/core/src/main/java/org/apache/ignite/cache/query/Query.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/Query.java b/modules/core/src/main/java/org/apache/ignite/cache/query/Query.java index c24d704..831efd1 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/Query.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/query/Query.java @@ -18,7 +18,6 @@ package org.apache.ignite.cache.query; import org.apache.ignite.*; -import org.apache.ignite.configuration.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.apache.ignite.spi.indexing.*; @@ -43,6 +42,9 @@ public abstract class Query<T extends Query> implements Serializable { /** */ private static final long serialVersionUID = 0L; + /** Default query page size. */ + public static final int DFLT_PAGE_SIZE = 1024; + /** Page size. */ private int pageSize; @@ -115,7 +117,7 @@ public abstract class Query<T extends Query> implements Serializable { } /** - * Gets optional page size, if {@code 0}, then {@link CacheQueryConfiguration#getPageSize()} is used. + * Gets optional page size, if {@code 0}, then {@link #DFLT_PAGE_SIZE} is used. * * @return Optional page size. */ @@ -124,7 +126,7 @@ public abstract class Query<T extends Query> implements Serializable { } /** - * Sets optional page size, if {@code 0}, then {@link CacheQueryConfiguration#getPageSize()} is used. + * Sets optional page size, if {@code 0}, then {@link #DFLT_PAGE_SIZE} is used. * * @param pageSize Optional page size. * @return {@code this} For chaining. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd44e13d/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 1d8ac8e..0f6f076 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -43,7 +43,7 @@ public enum GridClientCacheFlag { * Disable deserialization of portable objects on get operations. * If set and portable marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@link org.gridgain.grid.portables.PortableObject} class instead of user objects. + * instances of {@code PortableObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd44e13d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java index 2ea60bc..0aef1ee 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePeekMode.java @@ -19,13 +19,9 @@ package org.apache.ignite.internal.processors.cache; import org.jetbrains.annotations.*; -import java.util.*; - /** * Enumeration of all supported cache peek modes. Peek modes can be passed into various - * {@code 'CacheProjection.peek(..)'} and {@code Entry.peek(..)} methods, - * such as {@link CacheProjection#peek(Object, Collection)}, - * {@link javax.cache.Cache.Entry#peek()}, and others. + * {@code 'CacheProjection.peek(..)'} and {@code Entry.peek(..)} methods. * <p> * The following modes are supported: * <ul> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd44e13d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java index 95a8f6e..2ccdc5a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java @@ -23,10 +23,10 @@ import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.dr.*; import org.apache.ignite.internal.processors.cache.version.*; import org.apache.ignite.lang.*; -import org.apache.ignite.transactions.*; import org.jetbrains.annotations.*; import javax.cache.*; +import javax.cache.Cache.*; import javax.cache.expiry.*; import javax.cache.processor.*; import java.util.*; @@ -197,7 +197,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * This method will return {@code true} if value is stored in cache and {@code false} otherwise. * <p> * If write-through is enabled, the stored value will be persisted to {@link CacheStore} - * via {@link CacheStore#put(Transaction, Object, Object)} method. + * via {@link CacheStore#write(Entry)} method. * <h2 class="header">Transactions</h2> * This method is transactional and will enlist the entry into ongoing transaction * if there is one. @@ -222,7 +222,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * This method will return {@code true} if value is stored in cache and {@code false} otherwise. * <p> * If write-through is enabled, the stored value will be persisted to {@link CacheStore} - * via {@link CacheStore#put(Transaction, Object, Object)} method. + * via {@link CacheStore#write(Entry)} method. * <h2 class="header">Transactions</h2> * This method is transactional and will enlist the entry into ongoing transaction * if there is one. @@ -244,7 +244,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * Removes given key mapping from cache if one exists and value is equal to the passed in value. * <p> * If write-through is enabled, the value will be removed from {@link CacheStore} - * via {@link CacheStore#remove(Transaction, Object)} method. + * via {@link CacheStore#delete(Object)} method. * <h2 class="header">Transactions</h2> * This method is transactional and will enlist the entry into ongoing transaction * if there is one. @@ -268,7 +268,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * provided filters have passed and there was something to remove, {@code false} otherwise. * <p> * If write-through is enabled, the value will be removed from {@link CacheStore} - * via {@link CacheStore#remove(Transaction, Object)} method. + * via {@link CacheStore#delete(Object)} method. * <h2 class="header">Transactions</h2> * This method is transactional and will enlist the entry into ongoing transaction * if there is one. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd44e13d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java index 14025f4..e89b208 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java @@ -187,11 +187,8 @@ import org.jetbrains.annotations.*; * </pre> */ public interface CacheQuery<T> { - /** Default query page size. */ - public static final int DFLT_PAGE_SIZE = 1024; - /** - * Sets result page size. If not provided, {@link #DFLT_PAGE_SIZE} will be used. + * Sets result page size. If not provided, {@link Query#DFLT_PAGE_SIZE} will be used. * Results are returned from queried nodes one page at a tme. * * @param pageSize Page size. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd44e13d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java index 94ddc37..60902ad 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java @@ -63,7 +63,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> { private volatile GridCacheQueryMetricsAdapter metrics; /** */ - private volatile int pageSize = DFLT_PAGE_SIZE; + private volatile int pageSize = Query.DFLT_PAGE_SIZE; /** */ private volatile long timeout; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd44e13d/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java index 9714647..a33bf2c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java @@ -333,17 +333,6 @@ public class GridFunc { }; /** */ - private static final IgniteClosure MAP_ENTRY_KEY = new IgniteClosure() { - @Override public Object apply(Object o) { - return ((Map.Entry)o).getKey(); - } - - @Override public String toString() { - return "Map entry to key transformer closure."; - } - }; - - /** */ private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() { @Override public Object apply(Object o) { return ((Cache.Entry)o).getKey(); @@ -378,18 +367,6 @@ public class GridFunc { }; /** */ - private static final IgniteClosure CACHE_ENTRY_VAL_PEEK = new IgniteClosure() { - @SuppressWarnings({"unchecked"}) - @Nullable @Override public Object apply(Object o) { - return ((Cache.Entry<?, ?>)o).getValue(); - } - - @Override public String toString() { - return "Cache entry to peek-value transformer closure."; - } - }; - - /** */ private static final IgnitePredicate CACHE_ENTRY_HAS_PEEK_VAL = new IgnitePredicate() { @SuppressWarnings({"unchecked"}) @Override public boolean apply(Object o) { @@ -7736,15 +7713,11 @@ public class GridFunc { } /** - * Gets predicate which returns {@code true} if - * {@link javax.cache.Cache.Entry#peek() Entry.peek()} method - * returns {@code non-null} value. + * Gets predicate which returns {@code true} if entry has peek value. * * @param <K> Cache key type. * @param <V> Cache value type. - * @return Predicate which returns {@code true} if - * {@link javax.cache.Cache.Entry#peek() Entry.peek()} - * method returns {@code non-null} value. + * @return Predicate which returns {@code true} if entry has peek value. */ @SuppressWarnings({"unchecked"}) public static <K, V> IgnitePredicate<Cache.Entry<K, V>> cacheHasPeekValue() {