You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by ma...@apache.org on 2013/02/07 20:12:17 UTC
git commit: GIRAPH-509: Factor out AggregatorUsage (majakabiljo)
Updated Branches:
refs/heads/trunk 8ed06fe5f -> a90747149
GIRAPH-509: Factor out AggregatorUsage (majakabiljo)
Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/a9074714
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/a9074714
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/a9074714
Branch: refs/heads/trunk
Commit: a907471497be3b9bdbc2a88b9296c6fe923ae0ea
Parents: 8ed06fe
Author: Maja Kabiljo <ma...@maja-mbp.thefacebook.com>
Authored: Thu Feb 7 11:06:44 2013 -0800
Committer: Maja Kabiljo <ma...@maja-mbp.thefacebook.com>
Committed: Thu Feb 7 11:10:24 2013 -0800
----------------------------------------------------------------------
CHANGELOG | 2 +
.../apache/giraph/aggregators/AggregatorUsage.java | 35 +++++++++++++++
.../giraph/master/MasterAggregatorUsage.java | 12 +----
.../giraph/worker/WorkerAggregatorUsage.java | 12 +----
4 files changed, 41 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/giraph/blob/a9074714/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index c6e2b75..808c51b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
Giraph Change Log
Release 0.2.0 - unreleased
+ GIRAPH-509: Factor out AggregatorUsage (majakabiljo)
+
GIRAPH-505: Metrics Updates (nitay)
GIRAPH-506: Concurrency issue - response can arrive before request is added to the outstanding map (majakabiljo)
http://git-wip-us.apache.org/repos/asf/giraph/blob/a9074714/giraph-core/src/main/java/org/apache/giraph/aggregators/AggregatorUsage.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/aggregators/AggregatorUsage.java b/giraph-core/src/main/java/org/apache/giraph/aggregators/AggregatorUsage.java
new file mode 100644
index 0000000..4de45d5
--- /dev/null
+++ b/giraph-core/src/main/java/org/apache/giraph/aggregators/AggregatorUsage.java
@@ -0,0 +1,35 @@
+/*
+ * 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.giraph.aggregators;
+
+import org.apache.hadoop.io.Writable;
+
+/**
+ * Master and workers can access aggregators through this interface.
+ */
+public interface AggregatorUsage {
+ /**
+ * Get value of an aggregator.
+ *
+ * @param name Name of aggregator
+ * @param <A> Aggregated value
+ * @return Value of the aggregator
+ */
+ <A extends Writable> A getAggregatedValue(String name);
+}
http://git-wip-us.apache.org/repos/asf/giraph/blob/a9074714/giraph-core/src/main/java/org/apache/giraph/master/MasterAggregatorUsage.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/master/MasterAggregatorUsage.java b/giraph-core/src/main/java/org/apache/giraph/master/MasterAggregatorUsage.java
index 4281bf5..cadae67 100644
--- a/giraph-core/src/main/java/org/apache/giraph/master/MasterAggregatorUsage.java
+++ b/giraph-core/src/main/java/org/apache/giraph/master/MasterAggregatorUsage.java
@@ -19,12 +19,13 @@
package org.apache.giraph.master;
import org.apache.giraph.aggregators.Aggregator;
+import org.apache.giraph.aggregators.AggregatorUsage;
import org.apache.hadoop.io.Writable;
/**
* Master compute can access and change aggregators through this interface
*/
-public interface MasterAggregatorUsage {
+public interface MasterAggregatorUsage extends AggregatorUsage {
/**
* Register an aggregator in preSuperstep() and/or preApplication(). This
* aggregator will have its value reset at the end of each super step.
@@ -53,15 +54,6 @@ public interface MasterAggregatorUsage {
InstantiationException, IllegalAccessException;
/**
- * Get value of an aggregator.
- *
- * @param name Name of aggregator
- * @param <A> Aggregated value
- * @return Value of the aggregator
- */
- <A extends Writable> A getAggregatedValue(String name);
-
- /**
* Sets value of an aggregator.
*
* @param name Name of aggregator
http://git-wip-us.apache.org/repos/asf/giraph/blob/a9074714/giraph-core/src/main/java/org/apache/giraph/worker/WorkerAggregatorUsage.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/worker/WorkerAggregatorUsage.java b/giraph-core/src/main/java/org/apache/giraph/worker/WorkerAggregatorUsage.java
index 75cc6dc..983549f 100644
--- a/giraph-core/src/main/java/org/apache/giraph/worker/WorkerAggregatorUsage.java
+++ b/giraph-core/src/main/java/org/apache/giraph/worker/WorkerAggregatorUsage.java
@@ -18,12 +18,13 @@
package org.apache.giraph.worker;
+import org.apache.giraph.aggregators.AggregatorUsage;
import org.apache.hadoop.io.Writable;
/**
* Vertex classes can access and change aggregators through this interface
*/
-public interface WorkerAggregatorUsage {
+public interface WorkerAggregatorUsage extends AggregatorUsage {
/**
* Add a new value
*
@@ -32,13 +33,4 @@ public interface WorkerAggregatorUsage {
* @param <A> Aggregated value
*/
<A extends Writable> void aggregate(String name, A value);
-
- /**
- * Get value of an aggregator.
- *
- * @param name Name of aggregator
- * @param <A> Aggregated value
- * @return Value of the aggregator
- */
- <A extends Writable> A getAggregatedValue(String name);
}