ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [8/9] incubator-ignite git commit: ignite-946: added documentation
Date Fri, 31 Jul 2015 09:34:37 GMT
ignite-946: added documentation


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

Branch: refs/heads/ignite-946
Commit: d7f672d026bdea471822507ca932024261fcde0d
Parents: 0ac76bc
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Jul 31 12:14:54 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri Jul 31 12:33:09 2015 +0300

----------------------------------------------------------------------
 .../ignite/cache/version/VersionedEntry.java    | 31 +++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d7f672d0/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
index 6f9d8f6..e669f15 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
@@ -17,11 +17,40 @@
 
 package org.apache.ignite.cache.version;
 
+import org.apache.ignite.*;
+
 import javax.cache.*;
+import javax.cache.processor.*;
 import java.util.*;
 
 /**
- * Cache entry along with version information.
+ * Cache entry that stores entry's version related information.
+ *
+ * To get a {@code VersionedEntry} of an {@link Cache.Entry} use {@link Cache.Entry#unwrap(Class)}
by passing
+ * {@code VersionedEntry} class to it as the argument.
+ * <p>
+ * {@code VersionedEntry} is supported only for {@link Cache.Entry} returned by one of the
following methods:
+ * <ul>
+ * <li>{@link Cache#invoke(Object, EntryProcessor, Object...)}</li>
+ * <li>{@link Cache#invokeAll(Set, EntryProcessor, Object...)}</li>
+ * <li>invoke and invokeAll methods of {@link IgniteCache}</li>
+ * <li>{@link IgniteCache#randomEntry()}</li>
+ * </ul>
+ * <p>
+ * {@code VersionedEntry} is not supported for {@link Cache#iterator()} because of performance
reasons.
+ * {@link Cache#iterator()} loads entries from all the cluster nodes and to speed up the
load version information
+ * is excluded from responses.
+ * <h2 class="header">Java Example</h2>
+ * <pre name="code" class="java">
+ * Cache<Integer, String> cache = grid(0).cache(null);
+ *
+ *  cache.invoke(100, new EntryProcessor<Integer, String, Object>() {
+ *      public Object process(MutableEntry<Integer, String> entry, Object... arguments)
throws EntryProcessorException {
+ *          VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
+ *          return entry;
+ *       }
+ *   });
+ * </pre>
  */
 public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
     /**


Mime
View raw message