Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-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 B8A071859C for ; Wed, 20 Apr 2016 22:29:28 +0000 (UTC) Received: (qmail 11449 invoked by uid 500); 20 Apr 2016 22:29:28 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 11419 invoked by uid 500); 20 Apr 2016 22:29:28 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 11410 invoked by uid 99); 20 Apr 2016 22:29:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2016 22:29:28 +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 3A8BFC0DE6 for ; Wed, 20 Apr 2016 22:29:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id k2ZdYSJt3wNd for ; Wed, 20 Apr 2016 22:29:25 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 2381E5F5A1 for ; Wed, 20 Apr 2016 22:29:23 +0000 (UTC) Received: (qmail 11022 invoked by uid 99); 20 Apr 2016 22:29:23 -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; Wed, 20 Apr 2016 22:29:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 31B1EE04EB; Wed, 20 Apr 2016 22:29:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: upthewaterspout@apache.org To: commits@geode.incubator.apache.org Date: Wed, 20 Apr 2016 22:29:26 -0000 Message-Id: <10ceaa77c0e74674a2fa8659449a23e3@git.apache.org> In-Reply-To: <79ff518ae5db4f699cf462d547c6beb7@git.apache.org> References: <79ff518ae5db4f699cf462d547c6beb7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/6] incubator-geode git commit: Removing the inbuilt aggregate classes specific to bucket nodes/ query nodes Removing the inbuilt aggregate classes specific to bucket nodes/ query nodes Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8bc7afac Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8bc7afac Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8bc7afac Branch: refs/heads/feature/GEODE-1269 Commit: 8bc7afac334ecdeee89d9576af95aea2e73a52bf Parents: 4f85cac Author: Asif Shahid Authored: Thu Apr 14 22:03:14 2016 -0700 Committer: Asif Shahid Committed: Thu Apr 14 22:03:14 2016 -0700 ---------------------------------------------------------------------- .../query/internal/aggregate/AvgBucketNode.java | 48 -------------------- .../aggregate/AvgDistinctPRQueryNode.java | 34 -------------- .../internal/aggregate/AvgPRQueryNode.java | 46 ------------------- .../aggregate/CountDistinctPRQueryNode.java | 43 ------------------ .../internal/aggregate/CountPRQueryNode.java | 47 ------------------- .../aggregate/SumDistinctPRQueryNode.java | 45 ------------------ 6 files changed, 263 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bc7afac/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgBucketNode.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgBucketNode.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgBucketNode.java deleted file mode 100644 index dae038e..0000000 --- a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgBucketNode.java +++ /dev/null @@ -1,48 +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 com.gemstone.gemfire.cache.query.internal.aggregate; - -import com.gemstone.gemfire.cache.query.QueryService; - -/** - * The aggregator for compuing average which is used on the bucket node for - * partitioned region based queries. - * - * - */ -public class AvgBucketNode extends Sum { - - private int count = 0; - - @Override - public void accumulate(Object value) { - if (value != null && value != QueryService.UNDEFINED) { - super.accumulate(value); - ++count; - } - } - - /** - * Returns a two element array of the total number of values & the computed - * sum of the values. - */ - @Override - public Object terminate() { - return new Object[] { Integer.valueOf(count), super.terminate() }; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bc7afac/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgDistinctPRQueryNode.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgDistinctPRQueryNode.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgDistinctPRQueryNode.java deleted file mode 100644 index 20d368d..0000000 --- a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgDistinctPRQueryNode.java +++ /dev/null @@ -1,34 +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 com.gemstone.gemfire.cache.query.internal.aggregate; - -/** - * Computes the final average of distinct values for the partitioned region - * based queries. This aggregator is initialized on the PR query node & acts on - * the results obtained from bucket nodes. - * - * - */ -public class AvgDistinctPRQueryNode extends SumDistinctPRQueryNode { - - @Override - public Object terminate() { - double sum = ((Number) super.terminate()).doubleValue(); - double result = sum / this.distinct.size(); - return downCast(result); - } -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bc7afac/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgPRQueryNode.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgPRQueryNode.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgPRQueryNode.java deleted file mode 100644 index f892971..0000000 --- a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/AvgPRQueryNode.java +++ /dev/null @@ -1,46 +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 com.gemstone.gemfire.cache.query.internal.aggregate; - -/** - * Computes the final non distinct average for a partitioned region based query. - * This aggregator is instantiated on the PR query node. - * - * - */ -public class AvgPRQueryNode extends Sum { - private int count = 0; - - /** - * Takes the input of data received from bucket nodes. The data is of the form - * of two element array. The first element is the number of values, while the - * second element is the sum of the values. - */ - @Override - public void accumulate(Object value) { - Object[] array = (Object[]) value; - this.count += ((Integer) array[0]).intValue(); - super.accumulate(array[1]); - } - - @Override - public Object terminate() { - double sum = ((Number) super.terminate()).doubleValue(); - double result = sum / count; - return downCast(result); - } -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bc7afac/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountDistinctPRQueryNode.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountDistinctPRQueryNode.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountDistinctPRQueryNode.java deleted file mode 100644 index b2f88a7..0000000 --- a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountDistinctPRQueryNode.java +++ /dev/null @@ -1,43 +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 com.gemstone.gemfire.cache.query.internal.aggregate; - -import java.util.Set; - -/** - * Computes the count of the distinct rows on the PR query node. - * - * - */ -public class CountDistinctPRQueryNode extends DistinctAggregator { - - /** - * The input data is the Set containing distinct values from each of the - * bucket nodes. - */ - @Override - public void accumulate(Object value) { - this.distinct.addAll((Set) value); - - } - - @Override - public Object terminate() { - return Integer.valueOf(this.distinct.size()); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bc7afac/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountPRQueryNode.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountPRQueryNode.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountPRQueryNode.java deleted file mode 100644 index 50eb07b..0000000 --- a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/CountPRQueryNode.java +++ /dev/null @@ -1,47 +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 com.gemstone.gemfire.cache.query.internal.aggregate; - -import com.gemstone.gemfire.cache.query.Aggregator; - -/** - * Computes the count of the rows on the PR query node - * - * - */ -public class CountPRQueryNode implements Aggregator { - private int count = 0; - - /** - * Recieves the input of the individual counts from the bucket nodes. - */ - @Override - public void accumulate(Object value) { - this.count += ((Integer) value).intValue(); - } - - @Override - public void init() { - - } - - @Override - public Object terminate() { - return Integer.valueOf(count); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bc7afac/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/SumDistinctPRQueryNode.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/SumDistinctPRQueryNode.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/SumDistinctPRQueryNode.java deleted file mode 100644 index bee5df2..0000000 --- a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/aggregate/SumDistinctPRQueryNode.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 com.gemstone.gemfire.cache.query.internal.aggregate; - -import java.util.Set; - -/** - * Computes the sum of distinct values on the PR query node. - * - * - */ -public class SumDistinctPRQueryNode extends DistinctAggregator { - - /** - * The input data is the Set of values(distinct) receieved from each of the - * bucket nodes. - */ - @Override - public void accumulate(Object value) { - this.distinct.addAll((Set) value); - } - - @Override - public Object terminate() { - double sum = 0; - for (Object o : this.distinct) { - sum += ((Number) o).doubleValue(); - } - return downCast(sum); - } -}