Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C87B618E19 for ; Fri, 31 Jul 2015 09:34:49 +0000 (UTC) Received: (qmail 50155 invoked by uid 500); 31 Jul 2015 09:34:49 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 50124 invoked by uid 500); 31 Jul 2015 09:34:49 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 50115 invoked by uid 99); 31 Jul 2015 09:34:49 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 09:34:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 310C1C071B for ; Fri, 31 Jul 2015 09:34:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.771 X-Spam-Level: X-Spam-Status: No, score=0.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Yyq-3Fl_kSPz for ; Fri, 31 Jul 2015 09:34:37 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id E773750615 for ; Fri, 31 Jul 2015 09:34:31 +0000 (UTC) Received: (qmail 49288 invoked by uid 99); 31 Jul 2015 09:34:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 09:34:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 35269E00DB; Fri, 31 Jul 2015 09:34:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ntikhonov@apache.org To: commits@ignite.incubator.apache.org Date: Fri, 31 Jul 2015 09:34:37 -0000 Message-Id: In-Reply-To: <60a6461b1eb6434898b2e3fe0784fd8f@git.apache.org> References: <60a6461b1eb6434898b2e3fe0784fd8f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [8/9] incubator-ignite git commit: ignite-946: added documentation 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 Authored: Fri Jul 31 12:14:54 2015 +0300 Committer: nikolay_tikhonov 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. + *

+ * {@code VersionedEntry} is supported only for {@link Cache.Entry} returned by one of the following methods: + *

    + *
  • {@link Cache#invoke(Object, EntryProcessor, Object...)}
  • + *
  • {@link Cache#invokeAll(Set, EntryProcessor, Object...)}
  • + *
  • invoke and invokeAll methods of {@link IgniteCache}
  • + *
  • {@link IgniteCache#randomEntry()}
  • + *
+ *

+ * {@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. + *

Java Example

+ *
+ * Cache cache = grid(0).cache(null);
+ *
+ *  cache.invoke(100, new EntryProcessor() {
+ *      public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
+ *          VersionedEntry verEntry = entry.unwrap(VersionedEntry.class);
+ *          return entry;
+ *       }
+ *   });
+ * 
*/ public interface VersionedEntry extends Cache.Entry { /**