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 C5A40177CD for ; Mon, 13 Apr 2015 09:04:07 +0000 (UTC) Received: (qmail 81900 invoked by uid 500); 13 Apr 2015 09:03:55 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 81870 invoked by uid 500); 13 Apr 2015 09:03:55 -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 81861 invoked by uid 99); 13 Apr 2015 09:03:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 09:03:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 13 Apr 2015 09:03:53 +0000 Received: (qmail 81317 invoked by uid 99); 13 Apr 2015 09:03:33 -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; Mon, 13 Apr 2015 09:03:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4C546E025F; Mon, 13 Apr 2015 09:03:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 13 Apr 2015 09:03:33 -0000 Message-Id: <81e2d4543cec4119b276f88b304cce29@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/5] incubator-ignite git commit: # IGNITE-693: Done. X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-ignite Updated Branches: refs/heads/ignite-560-1 03025deef -> a9632b13b # IGNITE-693: Done. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5bf4734a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5bf4734a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5bf4734a Branch: refs/heads/ignite-560-1 Commit: 5bf4734a7cee9b6ed0004a05b0099a922827aa80 Parents: d20d29b Author: vozerov-gridgain Authored: Tue Apr 7 12:37:07 2015 +0300 Committer: vozerov-gridgain Committed: Tue Apr 7 12:37:07 2015 +0300 ---------------------------------------------------------------------- .../CacheQueryCloseableScanBiPredicate.java | 30 ++++++++++++++++++++ .../cache/query/GridCacheQueryManager.java | 8 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5bf4734a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java new file mode 100644 index 0000000..fe2fb8e --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java @@ -0,0 +1,30 @@ +/* + * 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.internal.processors.cache.query; + +import org.apache.ignite.lang.*; + +/** + * Special version of bi-predicate for cache scan queries with close callback. + */ +public interface CacheQueryCloseableScanBiPredicate extends IgniteBiPredicate { + /** + * Callback invoked when predicate is not longer needed. + */ + public void onClose(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5bf4734a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java index d571243..4991691 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java @@ -900,7 +900,13 @@ public abstract class GridCacheQueryManager extends GridCacheManagerAdapte } @Override protected void onClose() throws IgniteCheckedException { - heapIt.close(); + try { + heapIt.close(); + } + finally { + if (keyValFilter instanceof CacheQueryCloseableScanBiPredicate) + ((CacheQueryCloseableScanBiPredicate)keyValFilter).onClose(); + } } }; }